Introduction
Skin cancer, primarily nonmelanoma skin cancer (NMSC) and melanoma, is the most common malignancy worldwide, predominantly affecting fair-skinned populations.1–4 Among Caucasians, it accounts for 35–45% of all tumors, compared to 4–5% in Hispanics, 2–4% in Asians, and 1–2% in Black populations.5 In the United States, approximately five million individuals receive treatment annually, with associated costs of $8.1 billion.6 NMSC, comprising basal cell carcinoma and squamous cell carcinoma, as well as melanoma, is associated with potentially fatal outcomes.7,8
Current screening relies on clinical inspection and dermoscopy but is limited by uneven access to specialized resources, high costs, and low public engagement.9 Early detection is critical for improving survival, yet precise risk stratification in large populations remains challenging. Biomarkers could help address this gap. Ultraviolet (UV) exposure, the primary environmental risk factor for skin cancer, induces inflammation, immunosuppression, and DNA damage.10,11 Serum 25-hydroxyvitamin D (25(OH)D), a biomarker of UV exposure, may influence tumorigenesis by regulating DNA repair and immune surveillance.12,13 While epidemiological studies have linked higher 25(OH)D levels to reduced risks of cancers such as colorectal, breast, and prostate cancer,14–18 its role in skin cancer remains controversial, potentially reflecting cumulative UV exposure rather than a protective effect.13 The active form, 1,25(OH)2D, promotes cell differentiation, inhibits proliferation, and induces apoptosis.17 Mendelian randomization (MR), which uses genetic instrumental variables, can minimize confounding and reverse causation compared to traditional observational studies.19 Numerous studies have explored the relationship between vitamin D and cancer, with some indicating a potential causal association between vitamin D levels and 14 types of cancer, as well as a causal link between circulating vitamin D levels and NMSC risk.20 However, epidemiological evidence on the association between serum 25(OH)D and skin cancer remains contradictory. Observational studies often struggle to distinguish the biological effects of serum 25(OH)D from the confounding influence of UV exposure, and the field of skin cancer research lacks large-scale genetic evidence. This study integrates data from the National Health and Nutrition Examination Survey (NHANES) (1999–2018) with MR analysis to evaluate the causal relationship between serum 25(OH)D levels and skin cancer risk, assessing its potential as a screening biomarker.
Materials and methods
Study population and data sources
NHANES, conducted by the National Center for Health Statistics, provides data on the health and nutritional status of the non-institutionalized civilian U.S. population.20 Annually, it surveys approximately 5,000 nationally representative individuals through in-person interviews and health examinations at mobile centers, using complex sampling methods to ensure representativeness.21 Further details are available at https://www.cdc.gov/nchs/nhanes/ .
We analyzed NHANES data from 1999–2018, spanning ten survey cycles with 101,316 participants. After excluding those under 18 years of age (n = 42,112), 59,204 participants remained. We further excluded individuals lacking serum 25(OH)D data (n = 26,824), cancer-related data (n = 1,585), or covariate data (n = 9,440). The final sample included 21,357 adults, of whom 631 had skin cancer (126 with melanoma, 338 with NMSC, and 167 with other skin cancers). Figure 1 details the screening process.
Skin cancer case definition
Skin cancer cases were identified based on a positive response to the question: “Have you ever been told you had cancer or malignancy?” Affirmative respondents were asked, “What kind of cancer?” Responses of “Melanoma,” “Skin (non-melanoma),” or “Skin (unknown type)” were classified as melanoma, NMSC, or other skin cancers, respectively. NHANES interviews are conducted by trained interviewers in participants’ homes using a Computer-Assisted Personal Interview system, with rigorous data quality assurance and control measures implemented.
Covariates
Covariates included age, sex (male, female), race/ethnicity (non-Hispanic White, non-Hispanic Black, Mexican American, Asian, other), education (<9th grade, high school graduate, some college/associate degree, college graduate or above), marital status (married, never married, widowed), body mass index (BMI; normal [BMI < 25 kg/m2], overweight [25 ≤ BMI < 30 kg/m2], obese [BMI ≥ 30 kg/m2]), poverty income ratio (PIR; low [PIR ≤ 1.39], medium [1.39 < PIR ≤ 3.49], high [>3.49]), smoking status (never, former, current), and alcohol consumption (never, former, current).
MR data sources
MR data were sourced from publicly available genome-wide association study (GWAS) databases. Exposure data for serum 25(OH)D were obtained from the IEU Open GWAS database (496,946 participants). NMSC data came from the UK Biobank (395,710 individuals: 23,694 cases and 372,016 controls), and melanoma data were also from the UK Biobank (375,767 individuals: 3,751 cases and 372,016 controls). There was no participant overlap between the exposure and outcome datasets.
Genetic instrumental variables for serum 25(OH)D
Single nucleotide polymorphisms (SNPs) associated with serum 25(OH)D were selected at P < 5 × 10−6. SNPs in linkage disequilibrium were excluded (r2 < 0.001, 10,000 kb window). SNPs significantly associated with 25(OH)D levels were extracted from the GWAS database (P < 5×10−8, r2 < 0.001, 10,000 kb window), yielding 117 SNPs. One palindromic SNP (rs7955128, with intermediate allele frequency) was excluded. The F-statistic for each SNP was calculated, with those having an F-statistic > 10 considered strong instrumental variables.22 This left 116 SNPs, of which eight were replaced with proxy SNPs (r2 > 0.8). To ensure transparency, SNP selection followed standard GWAS protocols, and all data are accessible through the IEU Open GWAS database.
Statistical analysis
The NHANES data analysis employed a complex sampling design and survey weights, adhering to established guidelines,23 with appropriate application of sampling weights, stratification variables, and primary sampling units to fully account for the complex survey design. The Kolmogorov-Smirnov test assessed the normality of variables. Normally distributed variables were reported as means (standard deviations), non-normally distributed variables as tertiles (33rd and 66th percentiles), and categorical variables as counts (percentages). Serum 25(OH)D levels were categorized into tertiles: Q1 (<46.6 nmol/L), Q2 (46.6–68.8 nmol/L), and Q3 (>68.8 nmol/L). Normally distributed continuous variables were compared using Student’s t-test, non-normally distributed variables with the Kruskal-Wallis test, and categorical variables with the chi-square test. Logistic regression was used to estimate odds ratios (ORs) and 95% confidence intervals (CIs) for the association between serum 25(OH)D and skin cancer. Restricted cubic splines were employed to assess non-linear relationships.
Multivariable logistic regression models included: Model 1 (adjusted for age, sex, race/ethnicity), Model 2 (further adjusted for marital status, education, and BMI), and Model 3 (additionally adjusted for PIR, smoking status, and alcohol consumption). The MR analysis primarily used inverse-variance weighting (IVW), supplemented by MR-Egger and weighted median methods for sensitivity analyses. Sensitivity analyses included the Cochran Q test to assess heterogeneity, the MR-Egger intercept test to evaluate directional pleiotropy, and funnel plots to examine bias. In stratified analyses, participants were grouped by age (<65 or ≥65 years), sex (male or female), and BMI (normal, overweight, or obese).
Results
Baseline characteristics
Table 1 summarizes the characteristics of 21,357 participants, including 20,726 controls and 631 skin cancer cases. The overall mean age was 47.45 ± 0.26 years, with controls averaging 46.77 ± 0.26 years and cases 63.10 ± 0.70 years. Mean serum 25(OH)D levels were 69.76 ± 0.66 nmol/L overall, 69.09 ± 0.66 nmol/L in controls, and 84.93 ± 1.84 nmol/L in cases, indicating significantly higher levels in the skin cancer group (P < 0.05). Skin cancer was significantly associated with age, 25(OH)D levels, sex, race/ethnicity, education, PIR, smoking, and alcohol consumption (P < 0.05), but not with marital status or BMI. Among cases, 56.58% were male, 94.29% were non-Hispanic White, and 34.39% had a bachelor’s degree or higher. Higher PIR (44.69%), married/cohabiting status (66.24%), former smoking (44.69%), and current alcohol consumption (70.84%) were more prevalent among cases, while BMI distribution was similar to that of controls.
Table 1Baseline characteristics of participants in NHANES (1999–2018)
Characteristic | Total (21,357) | Control (20,726) | Skin cancer (631) | P-value |
---|
Age (years) | 47.45 ± 0.26 | 46.77 ± 0.26 | 63.10 ± 0.70 | P < 0.001 |
Serum 25(OH)D (nmol/L) | 69.76 ± 0.66 | 69.09 ± 0.66 | 84.93 ± 1.84 | P < 0.001 |
Sex, n (%) | | | | 0.005 |
Male | 10,525 (49.28) | 10,168 (49.06) | 357 (56.58) | |
Female | 10,832 (50.72) | 10,558 (50.94) | 274 (43.42) | |
Race, n (%) | | | | 0.001 |
Mexican | 3,177 (14.88) | 3,168 (15.29) | 9 (1.43) | |
Hispanics | 2,184 (10.23) | 2,168 (10.46) | 16 (2.54) | |
Non-Hispanic White | 9,545 (44.69) | 8,950 (43.18) | 595 (94.29) | |
Non-Hispanic Black | 4,267 (19.98) | 4,262 (20.56) | 5 (0.79) | |
Others | 2,184 (10.23) | 2,178 (10.51) | 6 (0.95) | |
Education level, n (%) | | | | P < 0.001 |
Less than 9th grade | 2,091 (9.79) | 2,064 (9.96) | 27 (4.28) | |
9–11th grade | 3,004 (14.07) | 2,955 (14.26) | 49 (7.77) | |
High school grad/GED | 4,842 (22.67) | 4,711 (22.73) | 131 (20.76) | |
Some college or AA degree | 6,343 (29.70) | 6,136 (29.61) | 207 (32.81) | |
College graduate or above | 5,077 (23.77) | 4,860 (23.45) | 217 (34.39) | |
Family income of poverty ratio, n (%) | | | | P < 0.001 |
<1.39 | 7,528 (35.25) | 7,418 (35.79) | 110 (17.43) | |
1.39–3.49 | 7,313 (34.24) | 7,074 (34.13) | 239 (37.88) | |
≥3.5 | 6,516 (30.51) | 6,234 (30.08) | 282 (44.69) | |
Marital status, n (%) | | | | 0.840 |
Married/cohabiting | 12,739 (59.65) | 12,321 (59.45) | 418 (66.24) | |
Never married | 3,879 (18.16) | 3,850 (18.58) | 29 (4.60) | |
Widowed/divorced/separated | 4,739 (22.19) | 4,555 (21.98) | 184 (29.16) | |
BMI (Kg/m2), n (%) | | | | 0.793 |
Normal (<25) | 6,084 (28.49) | 5,895 (28.44) | 189 (29.95) | |
Overweight (≥25, <30) | 7,138 (33.42) | 6,905 (33.32) | 233 (36.93) | |
Obese (≥30) | 8,135 (38.09) | 7,926 (38.24) | 209 (33.12) | |
Smoking status, n (%) | | | | 0.002 |
Never smoker | 11,717 (54.86) | 11,447 (55.23) | 270 (42.79) | |
Former smoker | 5,244 (24.55) | 4,962 (23.94) | 282 (44.69) | |
Current smoker | 4,396 (20.58) | 4,317 (20.83) | 79 (12.52) | |
Drinking status, n (%) | | | | P < 0.001 |
Never drinker | 3,053 (14.30) | 2,995 (14.45) | 58 (9.19) | |
Former drinker | 3,830 (17.93) | 3,704 (17.87) | 126 (19.97) | |
Current drinker | 14,474 (67.77) | 14,027 (67.68) | 447 (70.84) | |
Association between serum 25(OH)D and skin cancer
Table 2 presents multivariable-adjusted ORs and 95% CIs for NMSC, melanoma, and other skin cancers across 25(OH)D tertiles. Risk increased significantly with higher 25(OH)D levels (Q1 to Q3), demonstrating a dose-response relationship. In Model 1 (adjusted for age, sex, race/ethnicity), Q2 showed no significant risk, but Q3 exhibited elevated risk for all skin cancer types. In Model 3 (adjusted for all covariates), Q3 ORs (95% CIs) were 2.94 (2.10–4.20, P < 0.001) for NMSC, 2.94 (1.73–5.28, P = 0.002) for melanoma, and 2.10 (1.36–3.36, P = 0.007) for other skin cancers.
Table 2Analysis of the association between serum 25-hydroxyvitamin D and skin cancer
Characteristic | Model 1 | Model 2 | Model 3 |
---|
Nonmelanoma skin cancer | | | |
Q1 | 1.00 | 1.00 | 1.00 |
Q2 | 1.61 (1.10,2.39) | 1.50 (1.02,2.23) | 1.46 (0.99,2.18) |
Q3 | 3.82 (2.76,5.44) | 3.16 (2.27,4,51) | 2.94 (2.10,4.20) |
P-value | P < 0.001 | P < 0.001 | P < 0.001 |
Melanoma | | | |
Q1 | 1.00 | 1.00 | 1.00 |
Q2 | 1.78 (0.99,3.35) | 1.70 (0.94,3.19) | 1.71 (0.94,3.22) |
Q3 | 3.43 (2.05,6.12) | 2.98 (1.76,5.35) | 2.94 (1.73,5.28) |
P-value | P < 0.001 | P < 0.001 | P < 0.001 |
Other skin cancer | | | |
Q1 | 1.00 | 1.00 | 1.00 |
Q2 | 1.60 (0.99,2.62) | 1.56 (0.97,2.56) | 1.56 (0.97,2.57) |
Q3 | 2.30 (1.50,2.64) | 2.14 (1.39,3.41) | 2.10 (1.36,3.36) |
P-value | P < 0.001 | P < 0.001 | P < 0.001 |
Figure 2 shows the restricted cubic spline analysis, adjusted for age, sex, race/ethnicity, marital status, education, BMI, PIR, smoking, and alcohol consumption. A significant non-linear association was observed between 25(OH)D and NMSC (P for non-linearity = 0.020), but not for melanoma or other skin cancers.
Causal associations from MR
As shown in Table 3, multiple MR methods were employed to assess the causal association between serum 25(OH)D levels and skin cancer. The IVW results indicated that elevated 25(OH)D levels were significantly associated with increased risks of NMSC (OR (95% CI) = 1.01 (1.00, 1.02), P = 0.002) and melanoma (OR (95% CI) = 1.00 (1.00, 1.01), P = 0.007. While MR-Egger and weighted median methods showed no significant associations, the high statistical power of IVW supports a causal relationship.
Table 3MR analysis of serum 25-hydroxyvitamin D and nonmelanoma skin cancer, as well as melanoma
Outcome | Method | OR (95% CI) | P |
---|
Nonmelanoma skin cancer | | | |
| MR Egger | 1.00 (0.99,1.01) | 0.820 |
| WM | 1.00 (1.00,1.01) | 0.454 |
| IVW | 1.01 (1.00,1.02) | 0.002 |
Melanoma | | | |
| MR Egger | 1.00 (1.00,1.01) | 0.219 |
| WM | 1.00 (1.00,1.00) | 0.735 |
| IVW | 1.00 (1.00,1.01) | 0.007 |
Subgroup and sensitivity analyses
These subgroup findings are visually represented in Figure 3, which illustrates the forest plots for NMSC, melanoma, and other skin cancers across different demographic and clinical characteristics.The subgroup analysis forest plot shows that serum 25(OH)D Q3 levels were significantly associated with increased NMSC risk in individuals aged ≥65 years (OR (95% CI) = 2.69 (1.40, 5.15), P < 0.001), males (OR (95% CI) = 1.73 (1.07, 2.80), P = 0.025), females (OR (95% CI) = 1.92 (1.16, 3.15), P = 0.011), and obese individuals (OR (95% CI) = 2.53 (1.00, 6.43), P = 0.016). For melanoma, the risk was elevated in individuals aged ≥65 years (OR (95% CI) = 3.09 (1.20, 7.99), P = 0.019) and males (OR (95% CI) = 3.09 (1.20, 7.99), P = 0.019). Other skin cancers showed no significant association (OR (95% CI) = 1.20 (0.77, 1.88), P = 0.408, P for interaction > 0.05).
As shown in Table 4, MR heterogeneity tests indicated the presence of heterogeneity for both serum 25(OH)D and NMSC and melanoma, suggesting potential differences in the effects of genetic instrumental variables. NMSC exhibited high heterogeneity (Q = 248.03, P < 0.001) and evidence of horizontal pleiotropy (P = 0.021). Melanoma showed lower heterogeneity (Q = 137.77, P = 0.050) with no horizontal pleiotropy (P = 0.513). As depicted in Figure 4, the funnel plot suggests that the results are robust and not significantly influenced by bias. Despite the heterogeneity and horizontal pleiotropy observed for NMSC, the MR analysis supports a causal association between serum 25(OH)D and both NMSC and melanoma.
Table 4Sensitivity analysis for the MR of serum 25-hydroxyvitamin D Levels on nonmelanoma skin cancer and melanoma
Outcome | Method | Cochrane Q | P | Pleiotropy (Intercept P-value) |
---|
Nonmelanoma skin cancer | | | | |
| MR Egger | 236.50 | <0.001 | 0.021 |
| IVW | 248.03 | <0.001 | |
Melanoma | | | | |
| MR Egger | 137.24 | 0.0462 | 0.513 |
| IVW | 137.77 | 0.050 | |
Discussion
This nationally representative study of U.S. adults found that higher serum 25(OH)D levels were significantly associated with increased skin cancer incidence, consistent with findings from a community-based cardiovascular study.24 MR analysis confirmed a causal link between 25(OH)D and melanoma, with sensitivity analyses supporting the robustness of these results, suggesting 25(OH)D as a potential biomarker for skin cancer screening.
Among the 631 skin cancer cases, males had a higher incidence than females, consistent with prior findings,25 possibly due to greater outdoor activity. Targeted campaigns promoting sunscreen use among males could help reduce these gender disparities. Non-Hispanic Whites comprised 94.68% of NMSC cases, 91.27% of melanoma cases, and 95.81% of other skin cancer cases, reflecting the higher susceptibility of fair skin.26 NMSC prevalence exceeds that of melanoma in White populations, driven by UV exposure risk in fair-skinned individuals.27 Prevention and screening are thus critical for high-risk groups, including males and non-Hispanic Whites.
Vitamin D is primarily synthesized via UV-induced conversion of 7-dehydrocholesterol to 25(OH)D in the skin, with minimal dietary contribution.28,29 Skin cancer risk factors include prolonged UV exposure, family history, chemical carcinogens, and immunosuppression. UV-induced thymine dimers cause DNA damage, accounting for over 80% of cases.30–32 Studies have found a negative correlation between time exposed to sunlight and vitamin D deficiency.33 Elevated 25(OH)D levels likely reflect cumulative UV exposure rather than direct oncogenesis. The vitamin D pathway in skin cancer is dualistic: 1,25(OH)2D promotes differentiation and inhibits proliferation via vitamin D receptor activation,13,18 but UV-induced inflammation may impair vitamin D receptor signaling, reducing its anti-cancer effects.11 High local 25(OH)D concentrations may also remodel the tumor microenvironment via non-genomic pathways such as calcium signaling, enhancing cancer cell survival.15 Unlike its protective role in colorectal cancer,17 this suggests a unique UV-driven immunosuppressive microenvironment in skin cancer. Risk for all skin cancer types increased across 25(OH)D tertiles, indicating a dose-response relationship consistent with a Danish study.34 A study has shown that increased vitamin D levels are another systemic characteristic in NMSC patients.35 The restricted cubic spline analysis demonstrated a non-linear association with NMSC. Contrary to findings linking older age to higher risk,36 subgroup analysis revealed an increased risk of NMSC among individuals under 65 years with high serum 25(OH)D levels (OR (95% CI) = 2.69 (1.40, 5.5)), which may be related to more active UV exposure patterns and differences in DNA repair capacity in younger populations. Among males with high serum 25(OH)D levels, melanoma risk was elevated (OR (95% CI) = 1.93 (1.07, 2.80)), and in obese individuals, risks for both NMSC and melanoma were also increased. However, subgroup and interaction analyses for other skin cancers showed no statistical significance, possibly due to small sample sizes or unclear self-reported data leading to insufficient statistical power. Future studies should increase the number of cases and clarify cancer classifications. This study supports including serum 25(OH)D monitoring in routine checkups for high-risk groups (non-Hispanic Whites, males, and individuals with frequent UV exposure), with testing recommended every two years, combined with dermoscopy to improve early detection rates. However, given that 25(OH)D levels may reflect UV exposure rather than directly causing cancer, vitamin D supplementation strategies should be formulated cautiously to avoid encouraging increased UV exposure. At the public health level, robust sun protection measures (such as sunscreen use and sun-protective clothing) should be promoted, while community programs should aim to optimize vitamin D supplementation to balance sun protection with vitamin D needs. Cost-effectiveness analyses indicate that 25(OH)D testing offers economic advantages compared to late-stage skin cancer treatment, particularly among outdoor workers, where promotion through health insurance incentives could be effective.
Limitations include reliance on self-reported skin cancer diagnoses, which introduces potential recall bias or misclassification. This study also lacked direct UV exposure data (such as duration or intensity), which is a significant limitation, as elevated 25(OH)D levels may reflect cumulative UV exposure rather than a direct carcinogenic effect. MR analysis showed evidence of heterogeneity and horizontal pleiotropy in NMSC (MR-Egger intercept P = 0.022), possibly due to unmeasured confounders such as skin pigmentation. The predominance of non-Hispanic White participants also necessitates validation in more diverse populations.
Conclusions
This study confirms a positive association between serum 25(OH)D levels and skin cancer risk, with causal evidence supporting its potential role as a screening biomarker. We recommend integrating biennial 25(OH)D monitoring with dermoscopy into routine examinations for high-risk groups (e.g., non-Hispanic Whites, males, and individuals with frequent UV exposure). Public health strategies should strengthen sun protection education, promote the use of physical barriers, and optimize vitamin D supplementation to balance the risks of UV exposure. Further validation in diverse racial and ethnic populations is needed.
Declarations
Ethical statement
Participants in the studies provided informed consent at enrollment. No additional local ethical approval was required due to the public availability and original nature of the data. This study adheres to the principles of the Declaration of Helsinki (as revised in 2024).
Data sharing statement
The data used in this study are publicly available on the National Health and Nutrition Examination Survey website.
Funding
This research received no external funding.
Conflict of interest
The authors declare no conflicts of interest.
Authors’ contributions
Research design (JM, JL), research performance, result analysis (JM, RD, PL), writing of the manuscript (JM), editing, and providing critical comments for the manuscript (JM, JL). All authors read and approved the final manuscript.