Methylation at the 5' position of cytosine in DNA has important roles in genome function and is dynamically reprogrammed during early embryonic and germ cell development. The mammalian genome also contains 5-hydroxymethylcytosine (5hmC), which seems to be generated by oxidation of 5-methylcytosine (5mC) by the TET family of enzymes that are highly expressed in embryonic stem (ES) cells. Here we use antibodies against 5hmC and 5mC together with high throughput sequencing to determine genome-wide patterns of methylation and hydroxymethylation in mouse wild-type and mutant ES cells and differentiating embryoid bodies. We find that 5hmC is mostly associated with euchromatin and that whereas 5mC is under-represented at gene promoters and CpG islands, 5hmC is enriched and is associated with increased transcriptional levels. Most, if not all, 5hmC in the genome depends on pre-existing 5mC and the balance between these two modifications is different between genomic regions. Knockdown of Tet1 and Tet2 causes downregulation of a group of genes that includes pluripotency-related genes (including Esrrb, Prdm14, Dppa3, Klf2, Tcl1 and Zfp42) and a concomitant increase in methylation of their promoters, together with an increased propensity of ES cells for extraembryonic lineage differentiation. Declining levels of TETs during differentiation are associated with decreased hydroxymethylation levels at the promoters of ES cell-specific genes together with increased methylation and gene silencing. We propose that the balance between hydroxymethylation and methylation in the genome is inextricably linked with the balance between pluripotency and lineage commitment.