← All datasets

Presidential Elections

Every US presidential election in one free CSV download: all 60 contests from Washington's unanimous 1788 win through 2024, one row per election, merged from Wikipedia's Electoral College margin list, popular vote margin list, and the voter turnout page. Rows carry the winner and runner-up with readable party names (no cryptic abbreviations: Republican, Democratic, Whig, Democratic-Republican), electoral votes for winner, runner-up and the total college (538 today, with the pre-12th-Amendment era handled honestly: electors cast two votes before 1804), the winner's share of electors (FDR's 1936 sweep clears 98 percent by test), popular vote share, raw votes and margin from the conventional 1824 start of comparable popular voting, VAP and VEP turnout where measured, and the headline flag Lost_Popular_Vote, which lights up exactly five times by test: 1824, 1876, 1888, 2000 and 2016. Open to analysis of margin compression, turnout eras, party system transitions, and the Electoral College's divergence from the popular vote. Ten acceptance tests, one enforcing the 25 percent fill rule on every column.
60 rows 1 file last pulled 2026-11-14
Source: Wikipedia
Where would you start?
Pick a question, or ask your own and answer it; publish what you find as an insight. The same question can carry many insights from different angles.
  • How often does the popular vote diverge from the electoral college?
  • Which states flipped parties most often across elections?
  • How has turnout moved with the economy across elections?
Presidential Elections 60 rows × 16 columns
YearElection_NumberWinnerWinner_PartyRunner_UpRunner_Up_PartyElectoral_Votes_WinnerElectoral_Votes_Runner_UpElectoral_Votes_TotalEV_PctPopular_Vote_PctPopular_Margin_PctPopular_VotesLost_Popular_VoteTurnout_VAP_PctTurnout_VEP_Pct

Questions and answers

What is the Presidential Elections dataset?

Every US presidential election in one free CSV download: all 60 contests from Washington's unanimous 1788 win through 2024, one row per election, merged from Wikipedia's Electoral College margin list, popular vote margin list, and the voter turnout page. Rows carry the winner and runner-up with readable party names (no cryptic abbreviations: Republican, Democratic, Whig, Democratic-Republican), electoral votes for winner, runner-up and the total college (538 today, with the pre-12th-Amendment era handled honestly: electors cast two votes before 1804), the winner's share of electors (FDR's 1936 sweep clears 98 percent by test), popular vote share, raw votes and margin from the conventional 1824 start of comparable popular voting, VAP and VEP turnout where measured, and the headline flag Lost_Popular_Vote, which lights up exactly five times by test: 1824, 1876, 1888, 2000 and 2016. Open to analysis of margin compression, turnout eras, party system transitions, and the Electoral College's divergence from the popular vote. Ten acceptance tests, one enforcing the 25 percent fill rule on every column.

How big is the Presidential Elections dataset?

60 rows in one CSV file, with 16 columns in total: Year, Election_Number, Winner, Winner_Party, Runner_Up, Runner_Up_Party, Electoral_Votes_Winner, Electoral_Votes_Runner_Up, Electoral_Votes_Total, EV_Pct, Popular_Vote_Pct, Popular_Margin_Pct, Popular_Votes, Lost_Popular_Vote, Turnout_VAP_Pct, Turnout_VEP_Pct.

Where does the data come from?

It is built by programmatically scraping en.wikipedia.org, last pulled on 2026-11-14. Datasets are versioned; older versions stay downloadable.

Is the dataset free to download?

Yes. Every CodeSights dataset is completely free as a CSV download; a free account is all it takes. Anyone can preview the data without signing in.

Can I see the code that built this dataset?

Yes. The exact Python scraper that built it is viewable on the dataset page by any signed-in member, so every number is reproducible.

Can the data contain errors?

Automated scraping leaves room for error and the underlying sources change over time, so no version is guaranteed accurate or complete. If a number matters, verify it against the original source.

Browse every free dataset on CodeSights