There is growing evidence of a possible correlation between depression and overactive bladder (OAB). However, few studies have classified depression according to its severity. Whether there is an association between different levels of depression and OAB symptoms remains unclear. Participants with complete information about depression, OAB, and covariates in the National Health and Nutrition Examination Survey (NHANES) 2005-2018 were included in this study. Depression symptoms were assessed by the Patient Health Questionnaire-9. OAB symptoms were evaluated by the Overactive Bladder Symptom Score. Weighted multivariate logistic regression models were applied to analyze the relationship between depression and OAB. A total of 30 359 participants were included in this study, consisting of 6245 OAB patients and 24 114 non-OAB participants. The multivariate logistic regression suggested depression independently correlated with OAB (odds ratio [OR] = 2.764, 95% confidence interval [CI] = 2.429-3.146, p < 0.001). Further, mild (OR = 2.355, 95% CI = 2.111-2.627, p < 0.001), moderate (OR = 3.262, 95% CI = 2.770-3.841, p < 0.001), and moderately severe to severe depression (OR = 3.927, 95% CI = 3.246-4.752, p < 0.001) were all associated with OAB. Additionally, depression was also correlated with urgency urinary incontinence (OR = 2.249, 95% CI = 1.986-2.548, p < 0.001) and nocturia (OR = 2.166, 95% CI = 1.919-2.446, p < 0.001). This study indicated different levels of depression, even mild depression, were independent risk factors for OAB. Given the frequent coexistence and potential interactions between depression and OAB, clinicians should be aware of the importance of assessing both physical and psychological symptoms in these patients. Early diagnosis and holistic treatment may improve the treatment outcomes, particularly for those suffering from both conditions.