Abstract Erectile dysfunction (ED) is a common male sexual disorder. Vitamin D (VD) deficiency is frequent in ED patients and has been associated with greater disease severity, but its role in predicting treatment response remains unclear. In this prospective cohort study, 202 ED patients were initially enrolled, and after excluding 30 ineligible cases, 172 were included in the final analysis at Chengdu University of TCM Affiliated Hospital (September 2023–August 2024).