The most effective secondary schools have between 600 and 900 pupils, according to a large-scale American study.
The University of Michigan research project has revealed that children in medium-sized schools achieve higher scores in reading and maths tests than pupils in schools with under 300 on roll.
"Students learn less in small schools," Valerie Lee, associate professor in the university's school of education, told last week's annual conference of the American Educational Research Association. "In large high schools, especially those enrolling more than 2,100, they learn considerably less."
She and Julia Smith, an assistant professor at the University of Rochester, looked at the learning gains of 9,912 teenagers between the eighth and twelfth grades (ages 13 and 17). The pupils were attending 789 public, Roman Catholic and elite private high schools. They found that school size had a greater effect on maths performance than on reading.
"It is also evident that size matters more for some students than others, " Professor Lee said. "In schools enrolling large numbers of minority and low-income students, learning falls off sharply as the schools become larger or smaller than the ideal."
Lee and Smith, who used a sophisticated statistical technique called hierarchical linear modelling to examine the effects of pupil rolls, admitted that they were surprised to find that disadvantaged pupils also did better in medium-sized schools.
The finding will disappoint education administrators in inner-city areas of New York and Philadelphia which have established many small high schools in the hope of combating disadvantage. In other parts of the US, however, ethnic minority teenagers are more likely to attend large schools.
"Schools with many minority students and those with many students from lower socio-economic status families (often the same school) should be especially anxious to reduce the size of the units in which their students learn," Professor Lee said. Establishing schools within schools would be one way of achieving this goal without spending huge sums on reorganisation schemes, the researchers suggest.
Thirteen-year-olds do slightly better in science and history if taught in smaller classes, a second US study suggests.
Previous research in the US and Britain has generally found that changes in class size have little effect on secondary pupil achievement - particularly in the middle range of 20-30 pupils. Some studies have even shown that as class size increased pupils performed better on tests, not worse.
However, Karen Akerhielm, a researcher from the Carnegie Centre at Princeton, believes that the almost universal policy of putting less able pupils into smaller teaching groups has distorted the findings of many earlier studies. She also told the AERA conference that too many research findings had been based on schools' pupil-teacher ratios rather than actual class sizes.
Akerhielm took both of these factors into account when examining the English, maths, science and history scores of 24,000 13-year-olds in more than 1, 000 schools and found that smaller classes did have a positive effect on their performance.
The overall gains in English and maths were relatively insignificant but the improvement in science and history was more marked. Akerhielm also discovered that smaller classes affected different groups of pupils in different ways. Non-white students did better in smaller English classes while white students' scores improved in smaller maths and history classes.
Akerhielm did, however, emphasise that the class-size effects were small compared to family background factors. "The increased benefits of decreasing class size may not exceed the associated costs," she concluded. "Further research is, however, needed to more accurately gauge the magnitude of effect and to determine which types of students benefit most from smaller class size."