Type 2 diabetic patients have increased cancer risk. We developed and validated an all-site cancer risk score in a prospective cohort of 7374 Chinese type 2 diabetic patients free of known history of cancer at enrolment, using split-half validation. Spline Cox model was used to detect common risk factors of cancer and to guide linear transformation of non-linear risk factors. After a median follow-up period of 5.45 years, 365 patients (4.95%) developed cancer. Body mass index (BMI; <24.0 or > or =27.6 kg/m2), triglyceride (> or =0.81 to <1.41 mmol/l), high-density lipoprotein cholesterol (<0.9 or > or =1.8 mmol/l), total cholesterol (<4.3 mmol/l) and white blood cell (WBC) count (<5.8x10(9) count per litre) were associated with increased cancer risks and exhibited non-linear relationships. We further linear transformed these terms for selection using backward Cox regression (P<0.05 for stay) in the training dataset. In the test dataset, calibration was checked using Hosmer-Lemeshow test and discrimination checked using area under receiver operating characteristic curve. In addition to age and current smoking, only linear-transformed total cholesterol and WBC count were selected. The risk score was 0.0488xage (years)-0.5810xtotal cholesterol (mmol/l, coded to 4.3 if >4.3)-0.3596xWBC count (10(9) counts/l, 5.8 if >5.8)+0.6390xcurrent smoking status (1 if yes). The 5-year probability of cancer was 1-0.9590(EXP(0.9382x(RISK SCORE+1.5903))). The predicted cancer probability was not significantly different from the observed cancer probability during the 5-year follow-up. The adjusted area under receiver operating characteristic curve was 0.712. In conclusion, BMI, lipids and WBC count have predicting values for cancer.