Low-socioeconomic status (SES), minority, and male students perform worse than their high-SES, non-minority, and female peers on standardized tests. This paper investigates how within-school differences in school quality contribute to these educational achievement gaps by SES, ethnicity, and sex. Using individual-level data on the universe of public-school students in California, I estimate school quality using a value added methodology that accounts for the fact that students sort to schools on observable characteristics. I run three separate analyses, in which I allow each school to provide a distinct value added to their low-/high-SES, minority/non-minority, and male/female students. I find that there is within-school heterogeneity in value added by SES, ethnicity, and sex, as on average schools provide less value added to their low-SES, minority, and male students. Thus within-school heterogeneity in quality is one factor that contributes to differential outcomes for disadvantaged students