The function of TDG (thymine DNA glycosylase, Ensembl gene identifier ENSG00000139372) is as follows. DNA glycosylase that plays a key role in active DNA demethylation: specifically recognizes and binds 5-formylcytosine (5fC) and 5-carboxylcytosine (5caC) in the context of CpG sites and mediates their excision through base-excision repair (BER) to install an unmethylated cytosine. Cannot remove 5-hydroxymethylcytosine (5hmC). According to an alternative model, involved in DNA demethylation by mediating DNA glycolase activity toward 5-hydroxymethyluracil (5hmU) produced by deamination of 5hmC. Also involved in DNA repair by acting as a thymine-DNA glycosylase that mediates correction of G/T mispairs to G/C pairs: in the DNA of higher eukaryotes, hydrolytic deamination of 5-methylcytosine to thymine leads to the formation of G/T mismatches. Its role in the repair of canonical base damage is however minor compared to its role in DNA demethylation. It is capable of hydrolyzing the carbon-nitrogen bond between the sugar-phosphate backbone of the DNA and a mispaired thymine. In addition to the G/T, it can remove thymine also from C/T and T/T mispairs in the order G/T >> C/T > T/T. It has no detectable activity on apyrimidinic sites and does not catalyze the removal of thymine from A/T pairs or from single- stranded DNA. It can also remove uracil and 5-bromouracil from mispairs with guanine. {ECO:0000269|PubMed:21862836, ECO:0000269|PubMed:22327402, ECO:0000269|PubMed:22573813, ECO:0000269|PubMed:22962365, ECO:0000269|PubMed:8127859, ECO:0000269|PubMed:8407958, ECO:0000269|PubMed:8662714}.