Core component of nucleosome. Nucleosomes wrap and compact DNA into chromatin, limiting DNA accessibility to the cellular machineries which require DNA as a template. Histones thereby play a central role in transcription regulation, DNA repair, DNA replication and chromosomal stability. DNA accessibility is regulated via a complex set of post-translational modifications of histones, also called histone code, and nucleosome remodeling. Has broad antibacterial activity. May contribute to the formation of the functional antimicrobial barrier of the colonic epithelium, and to the bactericidal activity of amniotic fluid (By similarity). The nucleosome is a histone octamer containing two molecules each of H2A, H2B, H3 and H4 assembled in one H3-H4 heterotetramer and two H2A-H2B heterodimers. The octamer wraps approximately 147 bp of DNA. Monoubiquitination at Lys-35 (H2BK34Ub) by the MSL1/MSL2 dimer is required for histone H3 'Lys-4' (H3K4me) and 'Lys-79' (H3K79me) methylation and transcription activation at specific gene loci, such as HOXA9 and MEIS1 loci. Similarly, monoubiquitination at Lys-121 (H2BK120Ub) by the RNF20/40 complex gives a specific tag for epigenetic transcriptional activation and is also prerequisite for histone H3 'Lys-4' and 'Lys-79' methylation. It also functions cooperatively with the FACT dimer to stimulate elongation by RNA polymerase II. H2BK120Ub also acts as a regulator of mRNA splicing: deubiquitination by USP49 is required for efficient cotranscriptional splicing of a large set of exons (By similarity). Phosphorylated on Ser-15 (H2BS14ph) by STK4/MST1 during apoptosis; which facilitates apoptotic chromatin condensation. Also phosphorylated on Ser-15 in response to DNA double strand breaks (DSBs), and in correlation with somatic hypermutation and immunoglobulin class-switch recombination. Phosphorylation at Ser-37 (H2BS36ph) by AMPK in response to stress promotes transcription (By similarity). Crotonylation (Kcr) is specifically present in male germ cells and marks testis-specific genes in post-meiotic cells, including X-linked genes that escape sex chromosome inactivation in haploid cells. Crotonylation marks active promoters and enhancers and confers resistance to transcriptional repressors. It is also associated with post-meiotically activated genes on autosomes (By similarity). GlcNAcylation at Ser-113 promotes monoubiquitination of Lys-121. It fluctuates in response to extracellular glucose, and associates with transcribed genes (By similarity). Lactylated in macrophages by EP300/P300 by using lactoyl-CoA directly derived from endogenous or exogenous lactate, leading to stimulates gene transcription. Belongs to the histone H2B family.