Research shows that voters often use gender stereotypes to evaluate candidates, which should help women in some electoral contexts and hurt them in others. Yet, most research examines a single context at a time—usually US national elections, where partisanship is strong—and employs surveys and experiments, raising concerns that citizens’ responses may not reflect how they actually vote. By analyzing returns from thousands of nonpartisan local elections, we test whether patterns of women's win rates relative to men's match expectations for how the electoral effects of gender stereotyping should vary by context. We find women have greater advantages over men in city council than mayoral races, still greater advantages in school board races, and decreasing advantages in more conservative constituencies. Thus, women fare better in stereotype-congruent contexts and worse in incongruent contexts. These effects are most pronounced during on-cycle elections, when voters tend to know less about local candidates.