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 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 suggests it fosters 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 improved.