Background: An unhealthy lifestyle has been linked to declined semen quality; however, most previous studies have focused only on a single lifestyle factor, and the combined effect of an unhealthy lifestyle on semen quality remains unclear. Methods: We conducted a longitudinal study with repeated semen measurements among 3785 sperm donation volunteers at the Human Sperm Bank of Guangdong Province from 2020 to 2023. An unhealthy lifestyle score was used to assess participants' unhealthy lifestyle levels and comprised six indicators, including body mass index (BMI), cigarette smoking, alcohol consumption, physical activity, sleep quality, and diet diversity. A higher score indicated a more unhealthy lifestyle. Semen analysis was conducted according to the 5(th) edition of the World Health Organization laboratory manual for the examination and processing of human semen. Linear mixed models and linear regression models were used to evaluate the association between lifestyle and semen quality. Results: Each 1-point increase in the unhealthy lifestyle score was significantly associated with a reduction of 0.1 mL (95% CI: 0.04, 0.1; adjusted p = 0.003) in semen volume, 6.5 & times; 10(6) (2.1, 10.9; adjusted p = 0.016) in total sperm number, 3.9 & times; 10(6) (1.1, 6.8; adjusted p = 0.016) in total motile sperm number, and 3.8 & times; 10(6) (1.0, 6.6; adjusted p = 0.016) in total progressive sperm number. Stratified analyses showed significantly poorer semen quality among individuals aged <25 years and those with high perceived stress levels. Conclusions: We provide evidence that an unhealthy lifestyle is associated with lower semen quality. Adopting a fully healthy lifestyle has positive implications for semen quality and male reproductive health.