Why do firms offer nonwage compensation instead of the equivalent amount in financial compensation? We argue that firms use nonwage benefits, specifically female-friendly benefits, such as maternity leave, to increase gender diversity by efficiently attracting women. Using Glassdoor data, we show that firms offer higher-quality maternity leave benefits in labor markets in which female talent is relatively scarce. This result also holds more generally when examining all female-friendly nonwage benefits and is not present when looking at gender-neutral benefits. Moreover, using staggered adoption of state laws, we show that voluntary provision of these benefits can increase firm value.