This study is the first to investigate quantitative effects of plant community composition and diversity on N 2 fixation in legumes. N 2 fixation in three perennial Trifolium species grown in field plots with varied number of neighbouring species was evaluated with the 15 N natural abundance method (two field sites, several growing seasons, no N addition) and the isotope dilution method (one site, one growing season, 5 g N m -2 ). The proportion of plant N derived from N 2 fixation, pNdfa, was generally high, but the N addition decreased pNdfa, especially in species-poor communities. Also following N addition, the presence of grasses in species-rich communities increased pNdfa in T. hybridum and T. repens L., while legume abundance had the opposite effect. In T. repens, competition for light from grasses appeared to limit growth and thereby the amount of N 2 fixed at the plant level, expressed as mg N 2 fixed per sown seed. We conclude that the occurrence of diversity effects seems to be largely context dependent, with soil N availability being a major determinant, and that species composition and functional traits are more important than species richness regarding how neighbouring plant species influence N 2 fixation in legumes.