The effectiveness of 5-fluorouracil compared with that of imiquimod for preventing keratinocyte carcinoma is unknown. To compare the effectiveness of 5-fluorouracil and that of imiquimod in preventing keratinocyte carcinoma in a real-world practice setting. We identified 5700 subjects who filled prescriptions for 5-fluorouracil or imiquimod for treatment of actinic keratosis in 2007. An intention-to-treat analysis controlling for potential confounding variables was used to calculate 2- and 5-year cumulative risk differences for subsequent keratinocyte carcinoma overall and in field-treated areas. 5-Fluorouracil was associated with a statistically significant decreased risk of any keratinocyte carcinoma compared with imiquimod (adjusted hazard ratio [aHR], 0.86; 95% confidence interval [CI], 0.76-0.97), but there were no significant differences in risk by tumor subtype (for squamous cell carcinoma: aHR, 0.89; 95% CI, 0.74-1.07; for basal cell carcinoma: aHR, 0.87; 95% CI, 0.74-1.03) or site-specific keratinocyte carcinoma (aHR, 0.96; 95% CI, 0.81-1.14). There were no significant differences in 2- or 5-year cumulative risk of keratinocyte carcinoma among those treated with 5-fluorouracil versus with imiquimod. Generalizability to other practice settings may be limited. Whereas 5-fluorouracil was more effective in reducing keratinocyte carcinoma risk overall, we found no differences in the short- or long-term risk of subsequent site-specific keratinocyte carcinoma in a real-world practice setting.