Inequalities in the opportunity to obtain a good education in low-income countries are widely understood to be related to household resources and schooling quality. Yet, to date, most researchers have investigated the contributions of these two factors separately. This paper considers them jointly, paying special attention to their covariation, which indicates whether schools exacerbate or compensate for existing household-based inequalities. The paper develops a new variance decomposition framework and applies it to data on more than one million children in three low-income East African countries. The empirical results show that although household factors account for a significant share of total test score variation, variation in school quality and positive sorting between households and schools are, together, no less important. The analysis also finds evidence of substantial geographical heterogeneity in schooling quality. The paper concludes that promoting equity in education in East Africa requires policies that go beyond raising average school quality and should attend to the distribution of school quality as well as assortative matching between households and schools.