Democratic incumbent President Barack Obama received 51.97% of the vote, beating Republican challenger Mitt Romney's 46.59%.[5] Also on the ballot were physician Jill Stein of the Green Party and former New MexicoGovernorGary Johnson of the Libertarian Party, who received 0.37% and 0.87%, respectively.[5]Other candidates could run as write-in candidates, which received a total 0.2% of the vote. The state had been considered likely, but not certain, to go to Obama.[6] While the state had voted for a Democrat since 1992, it remained competitive, especially after Bush's loss of only 2.5% in 2004. Its competitiveness was attributable to the stark contrast between the state's diverse, urban voters in areas such as Philadelphia and Pittsburgh; and rural, blue-collar voters in the rest of the state. However, massive margins in the urban regions of the state and victories in the Philadelphia suburbs, Lehigh Valley, Scranton, and Erie delivered a considerable victory for the president. Regardless, Romney improved on John McCain's 10.32% loss in the state in 2008, and flipped five counties that voted for Obama four years prior.[7]
Five counties that voted for Obama in 2008 voted for Romney in 2012. This included Cambria County, which made Obama the first Democrat to win the presidency without carrying the county since Woodrow Wilson in 1916. Chester County, a Philadelphia suburb, also voted for Romney, though it would flip back into the Democratic column in 2016[8] and remain there in 2020.[9] Obama became the first Democrat to win the White House without carrying Elk County since Franklin D. Roosevelt in 1940, and the first to do so without carrying Carbon County since John F. Kennedy in 1960. As of the 2024 presidential election, this is the last time that Chester County voted for the Republican candidate, that Luzerne County voted for the Democratic candidate, and that Pennsylvania voted more Democratic than the nation as a whole.[10]