Classes with 30 or more children increased by 36% between 2012 and 2016, from 1,687 to 2,287.
The number of children being taught in classes of 30 or more rose by more than 19,000 from 52,445 to 71,309 in the same period.
The figures have been rising steadily year on year during that time.
The Scottish Liberal Democrats, who carried out the analysis, blamed the increase on SNP “mismanagement” and said the rising class sizes makes the key Scottish Government priority of closing the gap in attainment between affluent pupils and their less well off classmates harder to attain.
The party’s education spokesman Tavish Scott said: “We already know that the average class size is at its highest in years. Now these new figures reveal that the number of children being taught in super-size classes has soared.
“Almost 20,000 more children are being taught in classes of 30 or above compared to 2012. There are 143 more super-size classes in Glasgow and approaching 100 additional large classes in Edinburgh.
“Smaller classes do help pupils learn and help teachers contact with children who need extra help. So increasing class sizes make it harder to close the attainment gap.
“The impact of a decade of mismanagement by the SNP is clear. Tens of thousands of children are being taught in super-size classes. Thousands of teachers and support staff have been lost to schools and to Scottish education.
“Pupils returning to school this week have been met by hundreds of teaching vacancies.”
He said his party would invest an extra £500 million in education and would commission an independent review of teachers’ terms and conditions.
A Scottish Government spokesman said: “In 2010, we legislated to reduce the maximum class size in Primary 1 to 25, its lowest ever level.
“We are reforming the education system to close the poverty-related attainment gap and target resources at the children, schools and communities which most need them.
“We are investing £88 million this year so every school has access to the right number of teachers, and securing places for all probationers who want them.
“Our investment has enabled councils to maintain the pupil-teacher ratio and halted a period of steady decline in teacher recruitment, resulting in 253 more teachers last year - the first substantial increase since 2007.”