Clinical vitamin B12 deficiency can result in megaloblastic anemia, which results from the inhibition of DNA synthesis by trapping folate cofactors in the form of 5-methyltetrahydrofolate (5-methylTHF) and subsequent inhibition of de novo thymidylate (dTMP) biosynthesis. In the cytosol, vitamin B12 functions in the remethylation of homocysteine to methionine, which regenerates THF from 5-methylTHF. In the nucleus, THF is required for de novo dTMP biosynthesis, but it is not understood how 5-methylTHF accumulation in the cytosol impairs nuclear dTMP biosynthesis. The impact of vitamin B12 depletion on nuclear de novo dTMP biosynthesis was investigated in methionine synthase-null human fibroblast and nitrous oxide-treated HeLa cell models. The nucleus was the most sensitive cellular compartment to 5-methylTHF accumulation, with levels increasing greater than fourfold. Vitamin B12 depletion decreased de novo dTMP biosynthesis capacity by 5–35%, whereas de novo purine synthesis, which occurs in the cytosol, was not affected. Phosphorylated histone H2AX (γH2AX), a marker of DNA double-strand breaks, was increased in vitamin B12 depletion, and this effect was exacerbated by folate depletion. These studies also revealed that 5-formylTHF, a slow, tight-binding inhibitor of serine hydroxymethyltransferase (SHMT), was enriched in nuclei, accounting for 35% of folate cofactors, explaining previous observations that nuclear SHMT is not a robust source of one-carbons for de novo dTMP biosynthesis. These findings indicate that a nuclear 5-methylTHF trap occurs in vitamin B12 depletion, which suppresses de novo dTMP biosynthesis and causes DNA damage, accounting for the pathophysiology of megaloblastic anemia observed in vitamin B12 and folate deficiency.