One explanation advanced for the persistent gender pay differences in labor markets is that women avoid salary negotiations. By using a natural field experiment that randomizes nearly 2,500 job seekers into jobs that vary important details of the labor contract, we are able to observe both the extent of salary negotiations and the nature of sorting. We find that when there is no explicit statement that wages are negotiable, men are more likely to negotiate for a higher wage, whereas women are more likely to signal their willingness to work for a lower wage. However, when we explicitly mention the possibility that wages are negotiable, these differences disappear completely. In terms of sorting, we find that men, in contrast to women, prefer job environments where the rules of wage determination are ambiguous. This leads to the gender gap being much more pronounced in jobs that leave negotiation of wage ambiguous.