Multifunctional protein with various roles in different cellular compartments. May act in a redox sensitive manner. In the nucleus is an abundant chromatin-associated non-histone protein involved in transcription, chromatin remodeling and V(D)J recombination and probably other processes. Binds DNA with a preference to non-canonical DNA structures such as single-stranded DNA. Can bent DNA and enhance DNA flexibility by looping thus providing a mechanism to promote activities on various gene promoters by enhancing transcription factor binding and/or bringing distant regulatory sequences into close proximity (By similarity). Involved in V(D)J recombination by acting as a cofactor of the RAG complex: acts by stimulating cleavage and RAG protein binding at the 23 bp spacer of conserved recombination signal sequences (RSS) (PubMed:9184213). Proposed to be involved in the innate immune response to nucleic acids by acting as a cytoplasmic promiscuous immunogenic DNA/RNA sensor which cooperates with subsequent discriminative sensing by specific pattern recognition receptors (PubMed:19890330). In the extracellular compartment acts as a chemokine. Promotes proliferation and migration of endothelial cells implicating AGER/RAGE (By similarity). Has antimicrobial activity in gastrointestinal epithelial tissues (By similarity). Involved in inflammatory response to antigenic stimulus coupled with pro-inflammatory activity (PubMed:25306442). May play a role in germ cell differentiation (PubMed:11262228). Involved in modulation of neurogenesis probably by regulation of neural stem proliferation (PubMed:24391977). Involved in articular cartilage surface maintenance implicating LEF1 and the Wnt/beta-catenin pathway (PubMed:19805379). Interacts with POU2F2, POU2F1 and POU3F1 (PubMed:7720710). Component of the RAG complex composed of core components RAG1 and RAG2, and associated component HMGB1 or HMGB2 (PubMed:9184213). Component of the SET complex, composed of at least ANP32A, APEX1, HMGB2, NME1, SET and TREX1. Directly interacts with SET (By similarity). Interacts with LEF1 (PubMed:19805379). Widely expressed in embryo. In adult mainly expressed in lymphoid organs and testes (PubMed:11262228). Expressed in primary spermatocytes. Expressed in the superficial zone of articular cartilage (PubMed:19805379). Both, HMG box 1 and HMG box 2, show antimicrobial activity. Reduction/oxidation of cysteine residues Cys-23, Cys-45 and Cys-106 and a possible intramolecular disulfide bond involving Cys-23 and Cys-45 give rise to different redox forms with specific functional activities in various cellular compartments: 1- fully reduced HMGB2 (HMGB2C23hC45hC106h), 2- disulfide HMGB2 (HMGB2C23-C45C106h) and 3- sulfonyl HMGB2 (HMGB2C23soC45soC106so). Viable, with severe reduction of sperm production in males. Belongs to the HMGB family.