A previous study showed that the length of the foreskin plays a role in the risk of sexually transmitted infections and chronic prostatitis, which can lead to poor quality of sexual life. Here, the association between foreskin length and sexual dysfunction was evaluated. A total of 5700 participants were recruited from the andrology clinic at The First Affiliated Hospital of University of Science and Technology of China (Hefei, China). Clinical characteristics, including foreskin length, were collected, and sexual function was assessed by the International Index of Erectile Function-5 (IIEF-5) and Premature Ejaculation Diagnostic Tool (PEDT) questionnaires. Men with sexual dysfunction were more likely to have redundant foreskin than men without sexual dysfunction. Among the 2721 erectile dysfunction (ED) patients and 1064 premature ejaculation (PE) patients, 301 (11.1%) ED patients and 135 (12.7%) PE patients had redundant foreskin, respectively. Men in the PE group were more likely to have redundant foreskin than men in the non-PE group (P = 0.004). Logistic regression analyses revealed that the presence of redundant foreskin was associated with increased odds of moderate/severe ED (adjusted odds ratio [aOR] = 1.31, adjusted P = 0.04), moderate PE (aOR = 1.38, adjusted P = 0.02), and probable PE (aOR = 1.37, adjusted P = 0.03) after adjusting for confounding variables. Our study revealed a positive correlation between the presence of redundant foreskin and the risk of sexual dysfunction, especially in PE patients. Assessment of the length of the foreskin during routine clinical diagnosis may provide information for patients with sexual dysfunction.