Human capital shapes income, inequality, and growth. In the public sphere, human-capital formation depends largely on the selection and retention of teachers. To understand how to improve selection and retention, I use a discrete-choice experiment to estimate teacher preferences for compensation structure, working conditions, and contracts. High-performing teachers have stronger preferences for schools offering performance pay, which implies it promotes positive selection. Under a variety of school objectives, schools appear to underpay in salary and performance pay while overpaying in retirement. The results suggest significant efficiency gains from restructuring compensation: teacher welfare and student achievement can be simultaneously much improved.