A betaine () in chemistry is any neutral chemical compound with a positively charged cationic functional group that bears no hydrogen atom, such as a quaternary ammonium or phosphonium cation (generally: onium ions), and with a negatively charged functional group, such as a carboxylate group that may not be adjacent to the cationic site. Historically, the term was reserved for trimethylglycine (TMG), which is involved in methylation reactions and detoxification of homocysteine. This is a modified amino acid consisting of glycine with three methyl groups serving as methyl donor for various metabolic pathways.