The main research question of this article is concerned with the combined estimation of the effects of educational systems, school composition, track level, and country of origin on the educational achievement of 15-year-old migrant students. The authors focus specifically on the effects of socioeconomic and ethnic background on achievement scores and the extent to which these effects are affected by characteristics of the school, track, or educational system in which these students are enrolled. In doing so, they examine the ‘sorting’ mechanisms of schools and tracks in highly stratified, moderately stratified, and comprehensive education systems. They use data from the 2006 programme for international student assessment (pisa) wave. Compared with previous research in this area, the article's main contribution is in explicitly including the tracks-within-school level as a separate unit of analysis, which leads to less biased results concerning the effects of educational system characteristics. The results highlight the importance of including factors of track level and school composition in the debate surrounding educational inequality of opportunity for students in different education contexts. The findings clearly indicate that analyses of the effects of educational system characteristics are flawed if the analysis only uses a country level and a student level and ignores the tracks-within-school-level characteristics. From a policy perspective, the most important finding is that educational systems are neither uniformly ‘good’ nor uniformly ‘bad’, but they can result in different consequences for different migrant groups. Some migrant groups are better off in comprehensive systems, while others are better off in moderately stratified systems.