H1 linker histones are the most abundant chromatin-binding proteins1. In vitro studies indicate that their association with chromatin determines nucleosome spacing and enables arrays of nucleosomes to fold into more compact chromatin structures. However, the in vivo roles of H1 are poorly understood2. Here we show that the local density of H1 controls the balance of repressive and active chromatin domains by promoting genomic compaction. We generated a conditional triple-H1-knockout mouse strain and depleted H1 in haematopoietic cells. H1 depletion in T cells leads to de-repression of T cell activation genes, a process that mimics normal T cell activation. Comparison of chromatin structure in normal and H1-depleted CD8+ T cells reveals that H1-mediated chromatin compaction occurs primarily in regions of the genome containing higher than average levels of H1: the chromosome conformation capture (Hi-C) B compartment and regions of the Hi-C A compartment marked by PRC2. Reduction of H1 stoichiometry leads to decreased H3K27 methylation, increased H3K36 methylation, B-to-A-compartment shifting and an increase in interaction frequency between compartments. In vitro, H1 promotes PRC2-mediated H3K27 methylation and inhibits NSD2-mediated H3K36 methylation. Mechanistically, H1 mediates these opposite effects by promoting physical compaction of the chromatin substrate. Our results establish H1 as a critical regulator of gene silencing through localized control of chromatin compaction, 3D genome organization and the epigenetic landscape.