Evolutionary theory suggests that some animal species may experience shifts in their offspring sex ratio in response to maternal health and environmental conditions, and in some unfavorable conditions, females may be less likely to bear sons. Experimental data in both animals and humans indicate that maternal inflammation may disproportionately impact the viability of male conceptuses; however, it is unknown whether other factors associated with both pregnancy and inflammation, such as vitamin D status, are associated with the offspring sex ratio. Here, we show that among 1,228 women attempting pregnancy, preconception 25-hydroxyvitamin D concentrations are positively associated with the live birth of a male infant, with notably stronger associations among women with elevated high sensitivity C-reactive protein, a marker of systemic low-grade inflammation. Our findings suggest that vitamin D may mitigate maternal inflammation that would otherwise be detrimental to the implantation or survival of male conceptuses in utero.