Renal dysfunction can lead to insulin resistance and increase the incidence of type 2 diabetes mellitus (T2DM). The blood urea nitrogen to creatinine ratio (NCR) is a frequently used indicator to assess renal dysfunction and differentiate between prerenal and intrinsic renal injury. However, the association between NCR and T2DM in the Chinese population remains unclear. Hence, this study aimed to investigate the association between NCR and the incidence of T2DM in the Chinese population. The relationship between NCR and T2DM was examined using the Cox proportional hazards model and curve fitting techniques. In addition, a comprehensive set of sensitivity and subgroup analyses were performed. All results were presented as hazard ratios (HRs) and 95% confidence intervals (CIs). Between 2010 and 2016, 189,416 Chinese people were recruited from the Rich Healthcare Group for this retrospective cohort study. Of the participants, 3755 (19.8%) were diagnosed with T2DM during the follow-up period. After full adjustment, the Cox proportional hazards model revealed a positive connection between NCR and the incidence of T2DM (HR = 1.03, 95% CI: 1.02–1.04, P < .001). Compared with individuals with lower NCR Q1 (≤13.536), the multivariate HR for NCR and T2DM in Q2 (13.536–16.256), Q3 (16.256–19.638), Q4 (>19.638) were 1.08 (0.98–1.19), 1.16 (1.05–1.28), 1.39 (1.26–1.53). The higher NCR groups (≥20) had a higher ratio of T2DM (HR = 1.28, 95% CI: 1.18–1.38, P < .001) than the lowest NCR group (<20). These findings were validated using sensitivity and subgroup analyses. In conclusion, this study found a positive and independent association between NCR and the incidence of T2DM after adjusting for confounding variables.