In invertebrates, reproductive output and lifespan are profoundly impacted by dietary macronutrient balance, with these traits achieving their maxima on different diet compositions, giving the appearance of a resource-based tradeoff between reproduction and longevity. For the first time in a mammal, to our knowledge, we evaluate the effects of dietary protein (P), carbohydrate (C), fat (F), and energy (E) on lifespan and reproductive function in aging male and female mice. We show that, as in invertebrates, the balance of macronutrients has marked and largely opposing effects on reproductive and longevity outcomes. Mice were provided ad libitum access to one of 25 diets differing in P, C, F, and E content, with reproductive outcomes assessed at 15 months. An optimal balance of macronutrients exists for reproductive function, which, for most measures, differs from the diets that optimize lifespan, and this response differs with sex. Maximal longevity was achieved on diets containing a P:C ratio of 1:13 in males and 1:11 for females. Diets that optimized testes mass and epididymal sperm counts (indicators of gamete production) contained a higher P:C ratio (1:1) than those that maximized lifespan. In females, uterine mass (an indicator of estrogenic activity) was also greatest on high P:C diets (1:1) whereas ovarian follicle number was greatest on P:C 3:1 associated with high-F intakes. By contrast, estrous cycling was more likely in mice on lower P:C (1:8), and the number of corpora lutea, indicative of recent ovulations, was greatest on P:C similar to those supporting greatest longevity (1:11).