Metformin and sulfonylureas are two common drugs used to treat type II diabetes. Diabetes type II was linked to the development of keratinocyte carcinoma (KC), which includes basal cell carcinoma (BCC) and squamous cell carcinoma (SCC). The purpose of this study would look into the relationship between sulfonylurea use and the development of KC in people who had it before. The Veterans Affairs Keratinocyte Carcinoma Chemoprevention Trial, which was a randomized double-blind vehicle-control cream originally investigating the effect of 5-fluorouracil on KC development, was studied retrospectively. About 932 patients with a history of KC (98% male, 99% white, median age 70 years) were enrolled and followed for a median of 2.8 years. There were 153 metformin patients and 94 sulfonylurea patients. Survival analysis with Cox regression that controlled for body mass index and known predictors: number of prior BCCs and age (for BCC), number of prior SCCs (invasive and in situ), and number of actinic keratoses at baseline (for SCC). Sulfonylurea users had an HR of 0.67 (CI: 0.40–1.56; P=0.49) and 0.94 (CI: 0.63–1.40; P=0.77) for SCC and BCC, respectively. Metformin might be a little more effective than sulfonylureas in diabetic patients at high risk of KC.