We analyze the allocation of students who differ in their ability to two sc
hool types. We assume that there are peer effects (students learn more the
better their classmates) and that the expected income after school also dep
ends on the average productivity of peers. We derive the allocation under f
ree school choice and decentralized determination of the academic level; we
show that, compared to the social optimum, the level is suboptimal and too
many students attend the better school type. A social planner can improve
on the allocation under free school choice by prescribing a higher academic
level.