In all three subjects, Shanghai students demonstrated knowledge and skills equivalent to at least one additional year of schooling than their peers in countries like the United States, Germany and the United Kingdom.
The findings are part of the 2012 Program for International Student Assessment (or PISA) -- a leading survey of education systems conducted every three years by the Paris-based Organization for Economic Cooperation and Development (OECD), a grouping of the world's richest economies.
More than half a million students, aged 15 and 16, sat a two-hour exam last year as part of the study. The pupils came from 65 countries representing 80% of the global economy.
East Asian economies performed best overall, claiming seven of the top ten places across all three subjects.
In math, Shanghai had the highest score with 613 points -- the equivalent of nearly three years of schooling above the average for the 34 OECD member countries of 494, and six years above Peru which ranked last with a score of 368. The city also came top in 2009 rankings.
Singapore came second in mathematics with a score of 573, followed by Hong Kong, Taiwan, South Korea, and Macau.
But the math performance of most countries has not improved since the PISA tests were launched more than a decade ago. Around 60% of the 64 countries who participated in previous studies performed at the same level or worse in 2012, and nearly a third of all students scored in the lowest band for the subject.
The United States ranked 36th, performing below the OECD average in mathematics with 481 points, and a score indistinguishable from the average for reading and science.
The United Kingdom did slightly better, ranking 26th, equaling the average score for OECD countries in math and reading. The UK performed above average in science with a score of 514.