TheO-GlcNAc transferase OGT interacts robustly with all three mammalian TET methylcytosine dioxygenases. We show here that deletion of theOgtgene in mouse embryonic stem cells (mESC) results in a widespread increase in the TET product 5-hydroxymethylcytosine (5hmC) in both euchromatic and heterochromatic compartments, with concomitant reduction of the TET substrate 5-methylcytosine (5mC) at the same genomic regions. mESC engineered to abolish the TET1-OGT interaction likewise displayed a genome-wide decrease of 5mC. DNA hypomethylation in OGT-deficient cells was accompanied by de-repression of transposable elements (TEs) predominantly located in heterochromatin, and this increase in TE expression was sometimes accompanied by increasedcis-expression of genes and exons located 3’ of the expressed TE. Thus, the TET-OGT interaction prevents DNA demethylation and TE expression in heterochromatin by restraining TET activity genome-wide. We suggest that OGT protects the genome against DNA hypomethylation and impaired heterochromatin integrity, preventing the aberrant increase in TE expression observed in cancer, autoimmune-inflammatory diseases, cellular senescence and ageing.