Think boys get better grades in math and science than their female counterparts? Think again.

A new study of academic performance in more than 30 countries and spanning nearly a century shows girls do better than boys in math and science as well as other subjects.

“Although gender differences follow essentially stereotypical patterns on achievement tests in which boys typically score higher on math and science, females have the advantage on school grades regardless of the material,” said lead study author Daniel Voyer, PhD, of the University of New Brunswick, Fredericton, Canada in a statement.

“School marks reflect learning in the larger social context of the classroom and require effort and persistence over long periods of time, whereas standardized tests assess basic or specialized academic abilities and aptitudes at one point in time without social influences,” he added.

Voyer’s data, which spanned from 1914 to 2011, showed that the grade gap between girls and boys was widest for language courses and most narrow with math and science, according to the study published in that American Psychological Association’s journal Psychological Bulletin.

The study also showed that the better grades among girls in math and science was not evident until middle school. The gap grew from elementary to middle school and then narrowed between high school and college.

“The fact that females generally perform better than their male counterparts throughout what is essentially mandatory schooling in most countries seems to be a well-kept secret, considering how little attention it has received as a global phenomenon,” said co-author Susan Voyer, MASc, also of the University of New Brunswick in a statement.

Daniel Voyer echoed these sentiments.

“Test scores have been used to perpetuate this notion for a long time, even though recent research shows that gender differences have essentially disappeared on them, at least in math,” he said in an email. “It is hard to get rid of a stereotype.”

Some possible reasons for girls performing better could be that because parents assume boys will be better at math and science, they may encourage girls to try harder. This, the researchers say, could explain why girls get better grades in all courses.

The authors also said learning style differences between girls and boys could also explain the gap. Previous research, they said, shows that girls “tend to study in order to understand the materials, whereas boys emphasize performance, which indicates a focus on the final grades."

“Mastery of the subject matter generally produces better marks than performance emphasis, so this could account in part for males’ lower marks than females,” the authors wrote.

Earlier this week, the National Center for Education Statistics released data showing that in the U.S. girls had a higher high school graduation rate, 84 percent, than boys who had a rate of 77 percent.

Daniel Voyer hopes the research will spark more research.

“It might get people to look outside the classroom for solutions to the underachievement in boys,” he said. “Our view is that there are multiple factors involved, making this a societal issue.

He added that educational decision makers need to change their views about stereotypes of boys and girls.

“With enough publicity about relevant findings, we might convince the public that they need to treat their boys and girls equitably,” he said.