Abstract The impacts of climate change on health are a critical public health issue, but the association between extreme temperatures and birth outcomes remains poorly understood. This paper links over 1 million birth records from Dongguan, China, between 2004 and 2013, to meteorological data. We investigate the relationship between extreme temperatures and birth outcomes and explore the heterogeneity among different demographic and socioeconomic factors, including maternal migrant status, education level, and mode of delivery. We find that one percentage increase in the number of days exposed to extreme heat during pregnancy is associated with a reduction in birth weight of 2.31 g and a 2% increase in odds of low birth weight (LBW), while exposure to extreme cold temperatures is associated with a reduction in birth weight (0.66 g) and an increase in the risk of LBW (1%). The association between extreme high temperatures and adverse birth outcomes is stronger for groups with disadvantaged social status. Specifically, the migrant group (for extreme heat exposure, local residents, −0.37 g; intraprovincial migrants, −2.75 g; out-of-province migrants, −2.49 g), the less-educated group (for extreme heat exposure, middle school or below, −2.47 g; high school or above, −1.66 g), and the group with vaginal birth [for extreme heat exposure, cesarean sections (C-sections), −1.56 g; vaginal birth, −2.62 g] are more sensitive to extreme weather conditions. Our study provides further evidence about the association of extreme temperatures with birth outcomes and for vulnerable groups of pregnant women.