This paper looks at the effects of air pollution on migration in China using changes in the average strength of thermal inversions over five-year periods as a source of exogenous variation for medium-run air pollution levels. Our findings suggest that air pollution is responsible for large changes in inflows and outflows of migration in China. Specifically, we find that a 10 percent increase in air pollution, holding everything else constant, is capable of reducing population through net out migration by about 2.8 percent in a given county. We find that these inflows are primarily driven by well-educated people at the beginning of their professional careers, leading to substantial changes in the sociodemographic composition of the population and labor force of Chinese counties. We also find a strong gender asymmetry in the response of mid-age adults that suggests families are splitting across counties to protect vulnerable members of the household. Our results are robust to different specifications, including a spatial lag model that accounts for localized migration spillovers and spatially correlated pollution shocks.