Biodiversity loss from plant communities is often acknowledged to affect primary production but little is known about effects on herbivores. We conducted a meta-analysis of a worldwide data set of 119 studies to compare herbivory in single-species and mixed forests. This showed a significant reduction of herbivory in more diverse forests but this varied with the host specificity of insects. In diverse forests, herbivory by oligophagous species was virtually always reduced, whereas the response of polyphagous species was variable. Further analyses revealed that the composition of tree mixtures may be more important than species richness per se because diversity effects on herbivory were greater when mixed forests comprised taxonomically more distant tree species, and when the proportion of non-host trees was greater than that of host trees. These findings provide new support for the role of biodiversity in ecosystem functioning across trophic levels.