Background: Previous studies on the association between diet quality and ovarian cancer (OC) survival are limited and inconsistent. We evaluated the relationship between pre- and post-diagnosis diet quality based on the Healthy Eating Index-2020 (HEI-2020), as well as their changes and OC survival. Methods: This prospective cohort study involved 1082 patients with OC aged 18-79 years, enrolled between 2015 and 2022. Detailed dietary intake before and after diagnosis was recorded using a validated food frequency questionnaire. Deaths were ascertained until February 16th, 2023 via medical records and active follow-up. Cox proportional hazards regression models were used to estimate hazard ratios (HRs) and 95% confidence intervals (CI). Results: We included 549 OC cases with a median follow-up of 44.9 months, representing 206 total deaths. Higher HEI scores were associated with better OS (pre-diagnosis: HRT3 vs. T1 0.66, 95%CI: 0.46-0.93, HR1-SD 0.84, 95%CI: 0.73-0.96; post-diagnosis: HRT3 vs. T1 0.68, 95%CI: 0.49-0.96, HR1-SD 0.80, 95%CI: 0.69-0.92). Compared to the stable group, the group with decreased HEI scores (>3%) from pre- to post-diagnosis had worse OS (HR 1.93, 95%CI: 1.26-2.97). Conclusion: High pre- and post-diagnosis diet quality was associated with improved OC survival, whereas deterioration in diet quality after diagnosis was associated with decreased OC survival.