One of the more common patterns of offspring size variation is that mothers tend to produce larger offspring at lower temperatures. Whether such variation is adaptive remains unclear. Determining whether optimal offspring size differs between thermal environments provides a direct way of assessing the adaptive significance of temperature-driven variation in egg size. Here, we examined the relationship between offspring size and performance at three temperatures for several important fitness components in the zebra fish, Danio rerio. The effects of egg size on performance were highly variable among life-history stages (i.e. pre- and post-hatching) and dependent on the thermal environment; offspring size positively affected performance at some temperatures but negatively affected performance at others. When we used these data to generate a simple optimality model, the model predicted that mothers should produce the largest size offspring at the lowest temperature, offspring of intermediate size at the highest temperature and the smallest offspring at the intermediate temperature. An experimental test of these predictions showed that the rank order of observed offspring sizes produced by mothers matched our predictions. Our results suggest that mothers adaptively manipulate the size of their offspring in response to thermally driven changes in offspring performance and highlight the utility of optimality approaches for understanding offspring size variation.