The acceleration of population aging and the continuous development of the social endowment system have an important impact on fertility.Based on the provincial panel data from 2005 to 2021,this paper analyzes the effect and mechanism of population aging and endowment insurance on fertility.The results show that endowment insurance and population aging inhibit the increase of fertility levels to a certain extent,with a more significant inhibition effect of endowment insurance.The interaction between endowment insurance and population aging has a certain positive effect on fertility rates.According to the heterogeneity analysis,the suppression effect of endowment insurance on fertility is higher in the eastern and western regions than in the central region,while the moderating effect of population aging is most significant in the western region.In the long run,we should effectively combine fertility with endowment insurance,improve the basic endowment insurance system,develop large-scale endowment,avoid the crowding-out effect of elderly care on fertility resources,and promote the long-term balanced development of population and social security.