This study examines the effect of teachers’ unions on the gender pay gap among teachers under various legal environments, using nationally representative district–teacher matched data. To identify union effects, I employ propensity score matching, considering both contractual status and teacher union density in each district as a treatment. I find that teachers’ unions significantly reduce the gender pay gap, and the union effects vary by legal environment. I also find that unions reduce teacher attrition for female teachers, but not for male teachers, thereby decreasing the gender pay gap by helping female teachers accumulate experience.