Anion gap = [Na+] - [Cl-] - [HCO3-] or alternative formula: AG = [Na+] + [K+] - [Cl-] - [HCO3-].
The anion gap can be used to help identify the cause of metabolic acidosis.