Background: It is well known that an immunosuppressed status such as cancer is a risk factor for herpes zoster (HZ), but little is known about whether HZ affects cancer development. Objectives: This study aimed to investigate the association between HZ and subsequent cancer risk by cancer type. Methods: We conducted a nationwide retrospective cohort study using the Korean National Health Insurance claims database. The study enrolled 1,568,818 patients: 784,409 diagnosed with HZ between 2010 and 2015 were included in the HZ group, and 784,409 matched controls without HZ were included in the non-HZ group, with 1:1 exact matching for age, sex, and index year. Hazard ratios (HRs) were calculated for the risk of cancers based on anatomical site according to the HZ status using the Cox proportional hazards regression models. Results: During a mean follow-up period of 6 years, 22,235 and 22,316 patients in the HZ group and the non-HZ group, respectively, developed cancer (incidence rate: 7.6 vs. 7.7 per 1,000 person-years). After adjusting for age, sex, and comorbidities, the overall risk of cancers was slightly decreased in the HZ group compared with the non-HZ group (HR, 0.999; 95% confidence interval [CI], 0.98–1.02). In post hoc analyses on organ site, the HZ group had significantly increased risk of hematologic malignancies, including multiple myeloma (HR, 1.63; 95% CI, 1.37–1.95), leukemia (HR, 1.20; 95% CI, 1.03–1.39), and lymphoma (HR, 1.15; 95% CI, 1.02–1.30) compared with the non-HZ group. Conversely, the risk of cancers in the liver (HR, 0.87; 95% CI, 0.82–0.93) and larynx (HR, 0.73; 95% CI, 0.58–0.92) were significantly decreased in the HZ group compared with the non-HZ group. Conclusions: Although the risk of developing some hematological cancers increased in patients with HZ, solid cancers including liver and laryngeal cancers showed a negative association with HZ.