55.5 Million Votes — Breaking Down the 2022 Elections

What does the largest voter turnout in Philippine history actually look like when you break it down by region, race, and margin?

Election night in May 2022 was wild. I remember refreshing the COMELEC transparency server every few minutes, watching numbers climb in real time. The presidential race was called early — unusually early — and by midnight most of the national picture was clear. But I kept thinking: what would this data look like once I could sit down with it properly?

A few months later, I got my chance. COMELEC released the full transparency data, and I spent a couple of weeks pulling it apart.

The Dataset

The data came directly from COMELEC's transparency server. It covers every precinct-level vote count for the presidential and senatorial races. That's 55.5 million total votes cast, spread across 17 regions, 82 provinces, and thousands of municipalities.

55.5M
Total votes cast in the 2022 national elections

I focused on two races: the presidency (because of the historic margin) and the Senate (because 12 seats up for grabs makes the patterns more interesting). I didn't touch local races — that's a whole different project.

Under the Hood

The bulk of the work was cleaning and aggregating precinct-level data up to municipal, provincial, and regional levels. COMELEC's raw files aren't exactly tidy — there are encoding issues, inconsistent municipality names, and a handful of records that don't match any known precinct.

Once the data was clean, I built two main analysis tracks:

  • Vote margin calculations — computing the gap between the top two candidates at every geographic level, both as raw counts and percentages
  • Regional swing analysis — comparing 2022 results against 2016 voting patterns to see where the biggest shifts happened

I used pandas for all the aggregation and plotly for the choropleth maps. The maps turned out to be the most revealing part of the whole project.

What Stood Out

The presidential race wasn't close. The winning margin exceeded 16 million votes nationally — a gap that's hard to find in any democratic election worldwide. But the regional story is where it gets interesting.

The Visayas and parts of Mindanao showed dramatically different voting patterns from each other. In Western Visayas, the margin flipped entirely compared to the national trend. Central Visayas leaned one way, Eastern Visayas another. It wasn't a simple north-south or urban-rural divide.

16M+
Vote margin in the presidential race — the widest in modern Philippine history

The senatorial races were messier, in a good way. With 64 candidates fighting for 12 spots, the vote distribution stretched thin. The 12th-place winner and the 13th-place loser were separated by fewer than 800,000 votes out of 55.5 million cast. That's a margin of about 1.4%.

Turnout varied a lot by region too. NCR had some of the lowest turnout percentages despite having the most registered voters. Rural provinces in the Visayas consistently turned out above 80%.

Regional Patterns Worth Knowing

I mapped the vote share by province for the top two presidential candidates. A few things jumped out:

  • BARMM had the most lopsided results — some provinces went 90%+ for a single candidate
  • The Ilocos region was similarly one-sided, but for the other candidate
  • Metro Manila was actually more competitive than most people assume, with margins under 20% in several cities
  • The swing from 2016 was sharpest in Davao Region, where loyalty to the outgoing administration translated to support for a different candidate than expected

In Hindsight

Elections produce some of the richest public datasets in the Philippines. COMELEC, for all its critics, does release granular vote data — and that's worth something. What I'd add next time is a historical comparison going back to 2004, which would let me track how regional voting blocs have shifted over two decades. I'd also love to bring in social media data to see if online sentiment maps to actual vote share. That's a much bigger project, though.

For now, I think the most important takeaway is that national numbers hide a lot. The Philippines doesn't vote as one country — it votes as dozens of distinct regions with their own political dynamics.