Improving farmers’sense of happiness is an important indicator of achieving common prosperity,and the integration of urban and rural social security,which is an essential path toward this goal,ensures that farmers share the fruits of reform and development by narrowing the urban-rural gap. Based on the data of China General Social Survey (CGSS) from 2012 to 2021,the ordered Probit model and KHB method are used to explore the impact of urban and rural social security integration on farmers' sense of happiness and its mechanism of action.The study shows that the integration of urban and rural social security significantly improves farmers’sense of happiness,especially among CPC members and the elderly.Compared with the integration of urban and rural social welfare,the integration of social insurance and social assistance between urban and rural areas has a more significant effect on improving farmers’sense of happiness.Mechanism analysis indicates that the integration of urban and rural social security helps farmers transfer pension and medical risks and strengthen family identity,thereby improving farmers’sense of happiness.Marginal effect reveals that for every unit increase in the integration of urban and rural social security,the probability of farmers feeling “relatively happy” and “very happy” increases by 0.378 and 0.546 respectively. Based on these findings,it is recommended to further promote the deepening of urban and rural social security integration and increase the payment of social security for specific groups in rural areas.