ImportanceWomen with epilepsy are recommended high doses of folic acid before and during pregnancy owing to risk of congenital anomalies associated with antiseizure medications. Whether prenatal exposure to high-dose folic acid is associated with increases in the risk of childhood cancer is unknown.ObjectiveTo assess whether high-dose folic acid supplementation in mothers with epilepsy is associated with childhood cancer.Design, Setting, and ParticipantsObservational cohort study conducted with nationwide registers in Denmark, Norway, and Sweden from 1997 to 2017. Analyses were performed during January 10, 2022, to January 31, 2022. Mother-child pairs were identified in medical birth registers and linked with information from patient, prescription, and cancer registers, as well as with sociodemographic information from statistical agencies, and were categorized by maternal diagnosis of epilepsy. The study population consisted of 3 379 171 children after exclusion of 126 711 children because of stillbirth or missing or erroneous values on important covariates.ExposuresMaternal prescription fills for high-dose folic acid tablets (≥1 mg daily) between 90 days before pregnancy start and birth.Main Outcomes and MeasuresFirst onset of childhood cancer at younger than 20 years. Cox proportional hazards models were used to calculate adjusted hazard ratios with corresponding 95% CIs, adjusted for potential confounders. Cumulative incidence at aged 20 years was used as a measure of absolute risk.ResultsThe median age at the end of follow-up in the study population of 3 379 171 children was 7.3 years (IQR, 3.5-10.9 years). Among the 27 784 children (51.4% male) born to mothers with epilepsy, 5934 (21.4%) were exposed to high-dose folic acid (mean dose, 4.3 mg), with 18 exposed cancer cases compared with 29 unexposed, producing an adjusted hazard ratio of 2.7 (95% CI, 1.2-6.3), absolute risk if exposed of 1.4% (95% CI, 0.5%-3.6%), and absolute risk if unexposed of 0.6% (95% CI, 0.3%-1.1%). In children of mothers without epilepsy, 46 646 (1.4%) were exposed to high-dose folic acid (mean dose, 2.9 mg), with 69 exposed and 4927 unexposed cancer cases and an adjusted hazard ratio of 1.1 (95% CI, 0.9-1.4; absolute risk, 0.4% [95% CI, 0.3%-0.5%]). There was no association between children born to mothers with epilepsy who were prenatally exposed to antiseizure medications, but not high-dose folic acid, and an increased risk of cancer (absolute risk, 0.6%; 95% CI, 0.2%-1.3%).Conclusions and RelevancePrenatal exposure to high-dose folic acid was associated with increased risk of cancer in children of mothers with epilepsy.