This paper attempts to explain why education fails to facilitate upward mobility for migrant children in China. By comparing a public school and a private migrant school in Shanghai, two mechanisms are found to underpin the reproduction of the class system: the ceiling effect, which is at work in public schools, and the counter-school culture, which prevails in private migrant schools. Both mechanisms might be understood as adaptations to the external circumstances of – and institutional discrimination against – migrants rather than as resistance to the prevailing institutional systems. Thus, the functioning of these mechanisms further strengthens the inequality embodied in the system.