BackgroundVitamin D supplementation is associated with a lower incidence of diabetic nephropathy (DN); however, whether this association is causative is uncertain.MethodsWe used two-sample Mendelian randomization to examine the causal influence of vitamin D on diabetic nephropathy in 7,751 individuals with type I diabetes-related nephropathy (T1DN) and 9,933 individuals with type II diabetes-related nephropathy (T2DN). Meanwhile, we repeated some previous studies on the influence of KIM-1 (kidney injury molecule 1) and body mass index (BMI) on DN. Additionally, to test the validity of the instruments variable for vitamin D, we conducted two negative controls Mendelian randomization (MR) on breast and prostate cancer, and a positive control MR on multiple sclerosis.ResultsResults of the MR analysis showed that there was no causal association between 25(OH)D with the early/later stage of T1DN (early: OR = 0.903, 95%CI: 0.229 to 3.555; later: OR = 1.213, 95%CI: 0.367 to 4.010) and T2DN (early: OR = 0.588, 95%CI: 0.182 to 1.904; later: OR = 0.904, 95%CI: 0.376 to 2.173), nor with the kidney function of patients with diabetes mellitus: eGFRcyea (creatinine-based estimated GFR) (Beta = 0.007, 95%CI: -0.355 to 0.369)) or UACR (urinary albumin creatinine ratio) (Beta = 0.186, 95%CI: -0.961 to 1.333)).ConclusionsWe found no evidence that Vitamin D was causally associated with DN or kidney function in diabetic patients.Supplementary InformationThe online version contains supplementary material available at 10.1186/s12882-023-03186-2.