According to the results of a prospective open cohort study, risk prediction algorithm called QDScore which includes both social deprivation and ethnicity can estimate the 10-year risk for diabetes. The aim of the study was to develop and validate the QDScore for estimating 10-year risk of acquiring diagnosed type 2 diabetes during a 10-year period, with use of routinely collected data from an ethnically and socioeconomically diverse population. The derivation cohort, obtained from 355 general practices in England and Wales, included 2,540,753 patients ranging from 25 to 79 years of age, were observed for 16,436,135 person-years. 78,081 had an incident diagnosis of type 2 diabetes. The validation cohort, obtained from 176 separate practices, included 1,232,832 patients (7,643,037 person-years) with 37,535 incident cases of type 2 diabetes. In the derivation cohort risk factors were estimated, and a risk equation in men and women was obtained with use of a Cox proportional hazards model. In the final model, predictive variables were self-assigned ethnicity, age, sex, body mass index, family history of diabetes, Townsend deprivation score, smoking status, treated hypertension, cardiovascular disease, and current use of corticosteroids. The primary endpoint of the study was incident diabetes, as recorded in general practice records. The validation cohort was used to find the measures of calibration and discrimination. Different ethnic groups had 4-fold to 5-fold variation in the risk for type 2 diabetes. The adjusted hazard ratio vs the white reference group was 4.07 for Bangladeshi women (95% confidence interval [CI], 3.24 - 5.11), 4.53 for Bangladeshi men (95% CI, 3.67 - 5.59), 2.15 for Pakistani women (95% CI, 1.84 - 2.52), and 2.54 for Pakistani men (95% CI, 2.20 - 2.93). Compared with Indian men, Pakistani and Bangladeshi men had significantly higher hazard ratios. Compared with the corresponding white reference group, the risk was increased in Black African men and Chinese women. The algorithm explained 51.53% (95% CI, 50.90 - 52.16) of the variation in women and 48.16% (95% CI, 47.52 - 48.80) of that in men, when tested in the validation dataset. The model was well calibrated, and the risk score showed good discrimination. D statistic was 2.11 (95% CI, 2.08 - 2.14) in women and 1.97 (95% CI, 1.95 - 2.00) in men. Limitations of this study include loss of some patients to follow-up; lack of repeated oral glucose tolerance tests throughout follow-up on all patients; potential sources of misclassification, bias, and confounding; main outcome being type 2 diabetes diagnosed by a clinician and recorded on the clinical computer system; and 25% of patients with missing values for either body mass index or smoking status.