Vitamin D deficiency and polymorphisms in the vitamin D receptor (VDR) gene have been linked to type 2 diabetes (T2DM) and diabetic nephropathy. This study aimed to evaluate the prevalence of vitamin D deficiency and VDR gene polymorphisms (ApaI rs7975232 and FokI rs2228570) in Egyptian patients with T2DM and to determine their associations with the development of diabetic nephropathy. A total of 75 patients with end-stage renal disease (ESRD), 75 patients with T2DM, 75 patients with diabetic nephropathy, and 30 normal controls were included in the study. Biochemical analysis was performed, including measurements of 25-hydroxy vitamin D [25(OH)D], fasting blood sugar (FBS), postprandial sugar (PPS), homeostatic model assessment of insulin resistance (HOMA-IR), fasting insulin, glycated hemoglobin (HbA1c), blood urea, serum creatinine, estimated glomerular filtration rate (eGFR), albumin-creatinine ratio, total calcium, phosphorus, and lipid profile. VDR gene polymorphisms were detected using the PCR-RFLP technique. The results showed significantly lower levels of vitamin D in patients with T2DM (31.9 ± 8.1 ng/ml) and diabetic nephropathy (10.8 ± 8.1 ng/ml) compared to control subjects (44.9 ± 20.7 ng/ml) (P < 0.001). Vitamin D insufficiency was more prevalent in patients with T2DM and diabetic nephropathy. There was a significant increase in the frequencies of the (ff) and (AA) genotypes and the (f) and (A) alleles in the T2DM group. In conclusion, our study found a high prevalence of vitamin D deficiency in Egyptian patients with T2DM and diabetic nephropathy. There were also significant differences in the distribution of FokI genotypes and alleles between patients with T2DM and controls, suggesting a potential risk factor for Egyptian patients with T2DM. However, the (a) allele of the ApaI genotype appeared to have a protective effect in Egyptian patients.