What the Anion Gap Is and How It Is Calculated
The anion gap is not something measured directly by a laboratory instrument; it is a value calculated from three routinely measured electrolytes that appear on nearly every basic metabolic panel. In plain terms, the anion gap equals the serum sodium concentration minus the sum of the serum chloride concentration and the serum bicarbonate concentration. Sodium represents the dominant positively charged ion, or cation, in the blood, while chloride and bicarbonate together represent the two most abundant negatively charged ions, or anions, that are routinely measured. By subtracting the sum of those two anions from sodium, clinicians produce a number that reflects the portion of the blood's negative charge that is not accounted for by chloride and bicarbonate alone. This calculation takes only seconds once the three values are in hand, and because sodium, chloride, and bicarbonate are already part of standard bloodwork, the anion gap can be generated automatically for essentially every patient without ordering any additional test. Despite its simplicity, this single subtraction carries real diagnostic weight. When a patient presents with a low blood pH and a low bicarbonate level consistent with metabolic acidosis, calculating the anion gap is typically the very next step, because it immediately begins to sort the underlying cause into one of two broad diagnostic pathways, each pointing toward a different set of conditions and a different subsequent workup.
Why the Anion Gap Is Never Actually Zero
A natural question arises from basic chemistry: blood must always be electrically neutral, meaning the total concentration of positive charges exactly equals the total concentration of negative charges. If that is true, why does the anion gap formula not simply produce a value of zero? The answer is that the calculation only includes the electrolytes that happen to be measured routinely, while blood actually contains many other charged particles that are left out of the equation entirely. These unmeasured anions include negatively charged proteins, most notably albumin, along with phosphate, sulfate, and a variety of organic acids that circulate at low but nonzero concentrations even in healthy people. Because these unmeasured anions are real contributors to the blood's negative charge but are absent from the sodium-minus-chloride-and-bicarbonate calculation, the formula systematically produces a positive number rather than zero. This is why a normal anion gap is generally considered to fall somewhere around 8 to 12 milliequivalents per liter, rather than at zero as a naive charge-balance argument might suggest. Albumin in particular is responsible for a large share of this baseline gap, which is why clinicians sometimes adjust the calculated anion gap upward in patients with low albumin levels, since a falling albumin concentration can mask a true elevation in unmeasured acids by artificially lowering the measured gap. Understanding this baseline is essential, because the entire diagnostic power of the anion gap comes from tracking how far it deviates from this expected normal range.
High Anion Gap Acidosis: An Accumulating Unmeasured Acid
When the anion gap rises well above its normal baseline in a patient with metabolic acidosis, the most likely explanation is that some additional acid has accumulated in the bloodstream. When this acid dissociates, it releases hydrogen ions that consume bicarbonate, and it releases an anion that is not part of the routine chloride and bicarbonate measurements, which drives the calculated gap upward even as total serum sodium stays relatively unchanged. Generations of clinicians have relied on the mnemonic MUDPILES to remember the major causes: methanol, uremia (kidney failure allowing accumulation of unmeasured anions), diabetic ketoacidosis, propylene glycol or paraldehyde, isoniazid or iron toxicity, lactic acidosis, ethylene glycol, and salicylate or aspirin overdose. In diabetic ketoacidosis, insulin deficiency forces the body to burn fat for fuel, generating ketoacids such as beta-hydroxybutyrate and acetoacetate that flood the bloodstream. In lactic acidosis, inadequate delivery of oxygen to tissues, whether from shock, severe infection, or cardiac arrest, forces cells to rely on anaerobic metabolism, which produces lactic acid faster than the body can clear it. Toxic alcohol ingestions and aspirin overdose generate their own distinctive organic acids through toxic metabolites or disrupted metabolism. In every one of these situations the underlying mechanism is the same: an acid is being produced or ingested faster than the body can eliminate it, and the anion portion of that acid is simply not part of the routine laboratory panel, so it shows up indirectly as a widened anion gap rather than being detected directly.
Normal Anion Gap Acidosis: Losing Bicarbonate Directly
The second broad category is metabolic acidosis with a normal anion gap, sometimes called hyperchloremic acidosis because of a telltale companion finding on the same blood panel. Here the mechanism is fundamentally different from the high anion gap category: rather than an unmeasured acid accumulating, the body is directly losing bicarbonate, its primary buffer against acidity, without any corresponding buildup of an unmeasured anion. As bicarbonate is lost, the body's regulatory systems retain chloride to preserve overall electrical neutrality, so serum chloride rises to roughly compensate for the falling bicarbonate, leaving the calculated anion gap essentially unchanged even as the patient becomes progressively more acidotic. Severe diarrhea is among the most common causes, since gastrointestinal secretions below the stomach are rich in bicarbonate, and substantial losses through the gut can outpace the body's ability to regenerate it. Certain kidney tubule disorders, broadly grouped as renal tubular acidosis, impair the kidney's ability to either reabsorb filtered bicarbonate or excrete acid appropriately, producing a similar pattern of bicarbonate loss with a rising chloride level. Because the diagnostic pathway for a normal anion gap acidosis is so different from that of a high anion gap acidosis, correctly recognizing which category a patient falls into immediately redirects the workup, away from tests for toxins, ketones, and lactate, and toward a careful review of gastrointestinal losses, kidney function, and urinary acid handling.
A Worked Example: Calculating the Anion Gap
Consider a patient whose basic metabolic panel returns the following values: a serum sodium of 138 milliequivalents per liter, a serum chloride of 100 milliequivalents per liter, and a serum bicarbonate of 12 milliequivalents per liter. Following the formula, the anion gap equals the serum sodium minus the sum of the serum chloride and the serum bicarbonate. Adding the chloride and bicarbonate together gives 112 milliequivalents per liter, and subtracting that sum from the sodium of 138 gives an anion gap of 26 milliequivalents per liter. Because the expected normal range is roughly 8 to 12 milliequivalents per liter, this result is markedly elevated, immediately signaling a high anion gap metabolic acidosis rather than a normal anion gap process. Combined with a low bicarbonate confirming that acidosis is indeed present, this pattern would prompt the clinician to think first of the MUDPILES causes and to send confirmatory tests such as a fingerstick or serum ketone measurement, a lactate level, and a review of the patient's medications and possible toxic ingestions, alongside kidney function tests to evaluate for uremia. Contrast this with a second hypothetical patient whose sodium is 138, whose chloride is 112, and whose bicarbonate is 12: here the anion gap would equal 138 minus the sum of 112 and 12, or 138 minus 124, which comes out to 14, close enough to the normal range that this second patient's acidosis, despite an identical bicarbonate level, would point instead toward bicarbonate loss from diarrhea or a renal tubular problem rather than an accumulating unmeasured acid.
Frequently asked questions
What is the formula for the anion gap?
The anion gap equals the serum sodium concentration minus the sum of the serum chloride concentration and the serum bicarbonate concentration. All three values come from a routine basic metabolic panel, so the anion gap can be calculated without ordering any additional test.
Why isn't the anion gap zero if blood is electrically neutral?
Blood truly is electrically neutral overall, but the anion gap formula only accounts for the routinely measured electrolytes. It leaves out unmeasured anions such as albumin, phosphate, sulfate, and various organic acids, which is why a normal anion gap is typically around 8 to 12 milliequivalents per liter rather than zero.
What does the MUDPILES mnemonic stand for?
MUDPILES is a memory aid for causes of high anion gap metabolic acidosis: methanol, uremia, diabetic ketoacidosis, propylene glycol or paraldehyde, isoniazid or iron, lactic acidosis, ethylene glycol, and salicylate or aspirin overdose. Each of these conditions generates or accumulates an unmeasured acid in the blood.
Why is a normal anion gap acidosis also called hyperchloremic acidosis?
In this pattern, bicarbonate is lost directly from the body, such as through severe diarrhea or certain kidney tubule disorders, and the body retains chloride to maintain electrical neutrality as bicarbonate falls. The resulting rise in serum chloride is why this pattern is often called hyperchloremic acidosis.
Why does low albumin affect the anion gap calculation?
Albumin is a major contributor to the normal baseline anion gap because it is a negatively charged unmeasured protein. When albumin levels fall, as in malnutrition or critical illness, the calculated anion gap can appear falsely low or normal even when an unmeasured acid has genuinely accumulated, so clinicians often adjust the anion gap upward to account for a low albumin level.
Try it live
Everything above runs in your browser — open The Anion Gap: A Clinical Detective Tool for Diagnosing Metabolic Acidosis and change the parameters while it is running. Nothing is installed, nothing is uploaded, the whole model lives in one tab.
▶ Open The Anion Gap: A Clinical Detective Tool for Diagnosing Metabolic Acidosis simulation