A quarter of the total increase in emissions is attributable to the growth of emissions per capita, whereas three quarters are due to population growth. This evidence notwithstanding, demography in climate-economy models typically follows exogenous trends. We develop a climate-economy integrated model with endogenous fertility through a quality-quantity trade-off. The decentralization of the social optimum requires two complementary instruments, a carbon pricing policy and family planning interventions. Global population increases and reaches a peak, depending on the scenario, between 11.6 billion in the social optimum and 14.6 billion if only carbon prices are implemented. Fertility costs, i.e. the net present value of the climate-related costs per child, are in 2020 estimated to be about 22 thousand Euro in the social optimum and about 88 thousand Euro in the Second-Best with Fertility-Taxes scenario. Carbon pricing tends to have a rebound effect as it increases population growth leading to higher future emissions. Our results highlight the effects of fertility choices and global population on climate change, quantifying the cost of neglecting the interaction.