Friedman (1962) argued that a free market in which schools compete based upon their reputation would lead to an efficient supply of educational services. This paper explores this issue by building a tractable model in which rational individuals go to school and accumulate skill valued in a perfectly competitive labor market. To this it adds one ingredient: school reputation in the spirit of Holmstrom (1982). The first result is that if schools cannot select students based upon their ability, then a free market is indeed efficient and encourages entry by high productivity schools. However, if schools are allowed to select on ability, then competition leads to stratification by parental income, increased transmission of income inequality, and reduced student effort---in some cases lowering the accumulation of skill. The model accounts for several (sometimes puzzling) findings in the educational literature, and implies that national standardized testing can play a key role in enhancing learning.