Inflammatory bowel disease is associated with an increased risk of skin cancer. The aims of this study were to determine whether IBD susceptibility variants are also associated with skin cancer susceptibility and if such risk is augmented by use of immune-suppressive therapy. The discovery cohort included participants in the UK Biobank. The validation cohort included participants in the Michigan Genomics Initiative. The primary outcome of interest was skin cancer, subgrouped into nonmelanoma skin cancers (NMSC) and melanoma skin cancers (MSC). Multivariable logistic regression with matched controls (3 controls:1 case) was performed to identify genomic predictors of skin malignancy in the discovery cohort. Variants with P <.05 were tested for replication in the validation cohort. Validated Single nucleotide polymorphisms were then evaluated for effect modification by immune-suppressive medications. The discovery cohort included 10,247 cases of NMSC and 1883 cases of MSC. The validation cohort included 7334 cases of NMSC and 3304 cases of MSC. Twenty-nine variants were associated with risk of NMSC in the discovery cohort, of which 5 replicated in the validation cohort (increased risk, rs7773324-A [DUSP22; IRF4], rs2476601-G [PTPN22], rs1847472-C [BACH2], rs72810983-A [CPEB4]; decreased risk, rs6088765-G [PROCR; MMP24]). Twelve variants were associated with risk of MSC in the discovery cohort, of which 4 were replicated in the validation cohort (increased risk, rs61839660-T [IL2RA]; decreased risk, rs17391694-C [GIPC2; MGC27382], rs6088765-G [PROCR; MMP24], and rs1728785-C [ZFP90]). No effect modification was observed. The results of this study highlight shared genetic susceptibility across IBD and skin cancer, with increased risk of NMSC in those who carry risk variants in IRF4, PTPN22, CPEB4, and BACH2 and increased risk of MSC in those who carry a risk variant in IL2RA.