Abstract Objectives This study aims to analyze various factors influencing suicidal ideation among young (19-39 years) and middle-aged (40-64 years) adults using nationwide longitudinal data in South Korea, which has the highest suicide rate among OECD countries for more than 20 years. Methods An analysis was conducted using the WAVE II data (2016-2017) from a nationwide longitudinal study on the mental health of suicide survivors (LoSS). The sample included 2,002 participants (1,290 young adults, 712 middle-aged adults) recruited through stratified proportional quota sampling. Multiple regression analysis was performed to identify factors influencing suicidal ideation in each age group. Results In young adults, being female, having a high school education or lower, being unmarried/divorced/widowed, and having higher levels of depression were positively associated with suicidal ideation. Higher levels of social support and better subjective physical health were negatively associated with suicidal ideation. In middle-aged adults, being unemployed, living alone, drinking alcohol more than once a week, and having higher levels of depression were positively associated with suicidal ideation, while higher levels of social support were negatively associated with suicidal ideation. Conclusions Factors influencing suicidal ideation differ between young and middle-aged adults. Age-specific suicide prevention strategies considering these factors are needed to promote social health and stability in South Korea. Key messages • Different factors influence suicidal ideation in young and middle-aged adults in South Korea. • Age-specific suicide prevention strategies are necessary to effectively address suicidal ideation and promote social health and stability in South Korea.