In recent years, the prevalence and mortality rates of diabetes have been rising continuously, posing a significant threat to public health and placing a heavy burden on the population. This study was conducted to describe and analyze the burden of diabetes in China from 1990 to 2021 and its attributable risk factors. Utilizing data from the Global Burden of Disease Study 2021, we analyzed the incidence, prevalence, and disability-adjusted life years (DALYs) of type 1 diabetes (T1DM) and type 2 diabetes (T2DM) in China from 1990 to 2021. We extracted sex- and age-specific data on diabetes, focusing on DALYs, years lived with disability, and years of life lost. Bayesian meta-regression and spatiotemporal Gaussian process regression were used to estimate disease parameters. Age-standardized rates (ASRs) and estimated annual percentage changes (EAPC) were calculated using direct standardization and log-linear regression. The population-attributable fractions were also determined for each risk factor. In 2021, the absolute number of incident diabetes mellitus (DM) cases was estimated at 4003543.82, including 32 000 T1DM and 3971486.24 T2DM cases. The ASRs were 244.57 for DM, 2.67 for T1DM, and 241.9 for T2DM (per 100 000 population). The absolute number of prevalent DM cases was 117288553.93, including 1442775.09 T1DM and 115845778.84 T2DM cases. The ASRs were 6142.29 for DM, 86.78 for T1DM, and 6055.51 for T2DM (per 100 000 population). In 2021, there were 178475.73 deaths caused by DM, with an ASR of mortality of 8.98 per 100 000 population. The DALYs due to DM in 2021 were 11713613.86, with an ASR of 585.43 per 100 000 population and an EAPC of 0.57. This increase can be attributed to several factors, including high body mass index, air pollution, and dietary habits. The burden of diabetes is considerable, with high prevalence and incidence rates, highlighting the urgent need for public health interventions. Addressing factors like high fasting plasma glucose, body mass index, air pollution, and dietary risks through effective interventions is critical.