Purpose To compare serum vitamin D (25(OH)D) levels according to the presence of diabetic macular edema (DME) in Diabetes Mellitus (DM) patients with different retinopathy conditions. Methods The files of all DM patients presenting for examination at the ophthalmology clinic between October 2018 and March 2020 were retrospectively examined. Data was collected from the files and included a comprehensive ophthalmological examination, laboratory results from fasting blood tests, and the internal medicine outpatient clinic examination. Patients were divided into two groups according to the presence of DME, they were divided into three groups in terms of retinopathy and DME, and in terms of retinopathy severity and presence of DME, they were divided into five groups. Result Ninety one (51.1%) of the age-sex matched participants were female and 87 (48.9%) were male. There was a statistically significant difference in vitamin D levels between the group with DME and the group without DME (p <= 0.001). In the comparison made according to the presence of retinopathy and DME; a significant difference was found between the DME group and the group with retinopathy but no DME (p <= 0.001). When the severity of retinopathy and the presence of DME were evaluated, a significant difference was found between the proliferative diabetic retinopathy (PDR) group with DME and the PDR group without DME in terms of vitamin D levels (p = 0.004). Conclusion Our study shows that the presence of DME is associated with lower serum 25(OH)D levels.