The yellow mealworm beetle, Tenebrio molitor L. (Coleoptera: Tenebrionidae), has long been used as a key study organism in many fundamental researches, including biochemistry, physiology, and behavior. Lifespan and reproduction are two of the most important components of fitness in all insects, but it remains largely unexplored how these two traits are influenced by macronutrient intake in this beetle. In this study, we used the nutritional geometry framework to analyze the complex and interactive effects of dietary protein and carbohydrate intake on lifespan and reproductive performance in T. molitor beetle. Lifespan and the number of eggs laid throughout the lifetime were quantified from more than 2,000 individual beetles provided with one of 35 chemically defined diets representing a full combination of seven protein-to-carbohydrate ratios (P:C= 0:1, 1:5, 1:2, 1:1, 2:1, 5:1, or 1:0) and five protein plus carbohydrate concentrations (P+C=25.2, 33.6, 42, 50.4, or 58.8 %, dry mass). All measures of lifespan and egg production were expressed highly at high caloric intake, but they differed in the optimal P:C ratio where traits peaked. While lifespan was the longest at a moderately carbohydrate-biased P:C ratio of 1:1.36, the rate of egg production was maximized at a protein-biased P:C ratio of 1.75:1, suggesting a possible nutrient-mediated trade-off between lifespan and daily reproductive efforts in T. molitor beetles. Lifetime egg production was maximized at a P:C ratio of 1.31:1, which was still protein-biased but lower than that maximized egg production rate. Reproductive lifespan was the longest at a P:C ratio of 1:1.06. When given a food choice, T. molitor beetles preferred a P:C ratio of 1:1, which is closest to the ratio that enables T. molitor beetles to stay reproductively active as long as possible.