The relationship between hysterectomy and ovarian preservation and depression is controversial. This study aimed to determine the association of hysterectomy and ovarian preservation with depression using National Health and Nutrition Examination Survey. To assess the association between hysterectomy with or without ovariectomy and depression, we used 3 methods. Method 1: propensity score model (PSM) was established. Method 2 was logistics regression analysis of hysterectomy and depression before and after PSM. Method 3 was a logistics regression analysis of the relationship between hysterectomy and different depressive symptoms. At the same time, in order to evaluate the association between hysterectomy with or without oophorectomy and depression, we explored the effect of four different surgical procedures on depression using logistic regression equations. We enrolled 12,097 women, of whom 2763 underwent hysterectomy, 34.455% were positive for depression. After weighting, 33.825% of the total sample had a PHQ ≥ 5. Finally, a total of 2778 women were successfully matched by propensity score, and 35.537% of them were positive for depression. The OR for PHQ ≥ 5 was 1.236 after crude adjustment of covariates and 1.234 after exact adjustment. This suggests that Hysterectomy is strongly associated with positive depression. Positive depression (PHQ ≥ 5) was associated with little interest, feeling down and trouble concentrating. It was not associated with trouble sleeping, feeling tired, poor appetite, feeling bad, slow moving or speaking, and suicidal thoughts. Oophorectomy-alone is not associated with depression. Hysterectomy-alone is a risk factor for depression, but Hysterectomy combined with Oophorectomy has a stronger correlation with depression than Hysterectomy-alone. Women who have had a Hysterectomy are at higher risk of depression than women who have not had a Hysterectomy, and this risk may be exacerbated if the uterus and ovaries are removed. When clinically appropriate, surgeons should try to preserve the patient's ovaries.