Anion Gap Calculator
Na+ − (Cl− + HCO3−)
Understanding the Anion Gap
The anion gap is a calculated value derived from routine electrolyte measurements that serves as a powerful tool in the workup of acid-base disorders. Despite being built from numbers a laboratory reports every day, it provides insight that those numbers do not offer individually, helping to detect hidden acids in the blood and to narrow down the cause of a metabolic acidosis. For anyone interpreting blood gases and electrolytes, the anion gap is an indispensable second step.
Its usefulness comes from a simple piece of chemistry combined with clinical pattern recognition. Understanding what the gap represents, how to interpret a high or low value, and the crucial adjustment for albumin transforms it from a rote calculation into a genuinely diagnostic measure.
Why the Anion Gap Exists: Electroneutrality
The foundation of the anion gap is one of the most basic principles in chemistry: blood, like any solution, must be electrically neutral. The total positive charge carried by cations must equal the total negative charge carried by anions. There can be no net charge in the body’s fluids.
If that is true, then why is there a gap at all? The answer is that laboratories routinely measure only some of the ions present. Sodium is the main cation measured, while chloride and bicarbonate are the main anions measured. But the blood contains many other charged particles that are not part of a standard panel, including other cations such as potassium, calcium, and magnesium, and a larger pool of anions such as albumin, phosphate, sulfate, and various organic acids. Because the unmeasured anions outweigh the unmeasured cations, subtracting the measured anions from the measured cation leaves a positive number. That number, the anion gap, is essentially a window onto the unmeasured anions in the blood.
Note: The anion gap is not a real, physical gap in charge. The blood is always electrically neutral. The gap is an artifact of measuring only some ions, and it reflects the unmeasured anions that the routine panel does not capture.
The Formula and Its Components
The standard calculation subtracts the two principal measured anions from the principal measured cation:
Anion Gap = Na+ − (Cl− + HCO3−)
The sodium is the dominant cation in the blood and the only one included in the standard formula. The chloride and bicarbonate are the two dominant measured anions. Some versions of the formula also add potassium to the sodium, since potassium is a measured cation, but because potassium is present in relatively small and stable amounts, most clinicians use the simpler version that omits it. Whichever convention is used, it should be applied consistently, and the reference range adjusted accordingly, because including potassium shifts the expected normal values upward.
All three inputs come from a basic metabolic panel, which means the anion gap can be calculated on essentially every patient who has electrolytes drawn, at no additional cost and with no additional test. This accessibility is part of what makes it such a routine and valuable part of acid-base assessment.
What the Gap Actually Represents
Because the gap reflects the unmeasured anions, changes in it carry meaning. The single largest contributor to the normal anion gap is albumin, a negatively charged protein present in large quantity. Phosphate, sulfate, and small amounts of organic acids make up the rest. In health, these unmeasured anions produce a stable, modest gap.
When an acid is added to the blood, the gap changes in a characteristic way. Most acids dissociate into a hydrogen ion and an accompanying anion. The hydrogen ion is buffered by bicarbonate, consuming it and lowering the measured bicarbonate. The accompanying anion, however, is usually one of the unmeasured kind, so it adds to the pool of unmeasured anions and widens the gap. The result is that adding acid to the blood tends to lower the bicarbonate and raise the anion gap together. This is the central insight that makes the gap so useful: it can reveal the presence of an acid that the blood gas alone might not fully explain.
Normal Anion Gap Values
A normal anion gap is traditionally cited as roughly 8 to 12 mEq/L, though the exact range varies between laboratories and depends on the equipment used to measure the electrolytes. Modern analyzers using ion-selective electrodes tend to produce somewhat lower normal values than older methods, so some laboratories report a normal range that runs lower than the classic figures. Because of this variation, it is important to know the reference range of the specific laboratory providing the results, rather than applying a single universal cutoff.
What matters most clinically is not the precise normal value but the direction and degree of deviation from it, interpreted in the context of the patient. A gap at the upper edge of normal in a sick patient may still be meaningful, especially after correcting for albumin, while a modestly elevated gap may have a benign explanation. The number is a starting point for interpretation, not a verdict in itself.
Correcting for Albumin
One of the most important and frequently overlooked steps in using the anion gap is correcting it for the albumin level. Because albumin is the largest single contributor to the normal gap, a patient with a low albumin will have a lower baseline anion gap. This is enormously important in critically ill and hospitalized patients, in whom low albumin is extremely common.
The danger is that a low albumin can mask a significant acidosis. A patient might have an anion gap that appears normal, hiding the fact that an acid has been added, simply because their low albumin has pulled the baseline gap down. Correcting for albumin reveals the true picture. A common correction adds roughly 2.5 mEq/L to the measured gap for every 1 g/dL that the albumin falls below a normal value of about 4.0 g/dL:
Corrected Anion Gap = Measured Gap + 2.5 × (4.0 − Albumin in g/dL)
For example, a patient with a measured gap of 10 and an albumin of 2.0 has a corrected gap of about 15, which is clearly elevated even though the raw number looked normal. Failing to make this correction is one of the most common ways a high-gap acidosis is missed at the bedside.
Note: In any patient with a low albumin, the raw anion gap understates the truth. Always correct for albumin before concluding that the gap is normal, or a real acidosis may be overlooked.
The High Anion Gap: Added Acids
An elevated anion gap usually means that an acid has been added to the blood, and the accompanying unmeasured anion has widened the gap. When this occurs alongside a metabolic acidosis, the condition is called a high anion gap metabolic acidosis, one of the most important patterns in clinical medicine. Identifying it immediately narrows the differential diagnosis to a specific set of causes.
The classic mnemonic for the causes is MUDPILES, which stands for Methanol, Uremia, Diabetic ketoacidosis, Propylene glycol, Iron or Isoniazid, Lactic acidosis, Ethylene glycol, and Salicylates. A more modern mnemonic, GOLD MARK, captures a similar list with updated terminology: Glycols, Oxoproline, L-lactate, D-lactate, Methanol, Aspirin, Renal failure, and Ketoacidosis. Whichever aid is used, the underlying theme is the same: each of these conditions floods the blood with an acid whose anion is unmeasured, raising the gap. Several of them, such as toxic alcohol ingestions and severe ketoacidosis or lactic acidosis, are medical emergencies, so recognizing a high gap acidosis carries real urgency.
The Normal Anion Gap: Bicarbonate Loss
Not every metabolic acidosis raises the gap. When the acidosis is caused by a direct loss of bicarbonate rather than the addition of an acid, the gap stays normal. This happens because as bicarbonate is lost, the kidneys retain chloride to maintain electroneutrality, so the fall in bicarbonate is matched by a rise in chloride and the calculated gap does not change. For this reason, a normal anion gap metabolic acidosis is also called a hyperchloremic metabolic acidosis.
The two great categories of cause are loss of bicarbonate from the gastrointestinal tract and loss from the kidneys. Severe diarrhea is the classic gastrointestinal cause, dumping large amounts of bicarbonate from the gut. Renal tubular acidosis, in which the kidneys fail to handle acid or bicarbonate normally, is the classic renal cause. Other contributors include certain medications and conditions that impair bicarbonate handling. Distinguishing a normal gap acidosis from a high gap acidosis is one of the first and most useful forks in the diagnostic road, because the two point toward entirely different sets of conditions.
The Low Anion Gap
A low anion gap is much less common than a high one, and when it appears it deserves a moment of thought, because it has a limited set of explanations. By far the most frequent is hypoalbuminemia, since a fall in this major unmeasured anion lowers the gap directly, as discussed in the section on albumin correction.
Other causes are less common but worth knowing. A laboratory error or measurement artifact can produce a spuriously low value. An increase in unmeasured cations, which offsets the unmeasured anions, can lower the gap, as can certain abnormal proteins in the blood, such as those produced in some plasma cell disorders, which carry a positive charge. Some intoxications can also distort the measured electrolytes in ways that lower the calculated gap. While a low gap is rarely the headline finding, it occasionally provides an important clue, and an unexpectedly low value should prompt a check of the albumin and a consideration of these less common causes.
The Urine Anion Gap
When a normal anion gap acidosis has been identified, a related calculation can help pinpoint its cause. The urine anion gap is computed from the sodium, potassium, and chloride measured in the urine, and it serves as an indirect window onto how much ammonium the kidneys are excreting. Ammonium is the main way the kidneys eliminate acid, so the urine anion gap reflects whether the renal response to an acidosis is appropriate or impaired.
Urine Anion Gap = (Urine Na+ + Urine K+) − Urine Cl−
The interpretation hinges on the sign of the result. A strongly negative urine anion gap indicates that the kidneys are excreting large amounts of ammonium, which is the appropriate response to an acid load. This points away from the kidney as the source of the problem and toward an extrarenal cause, most commonly gastrointestinal bicarbonate loss such as diarrhea. A positive urine anion gap, by contrast, indicates that the kidneys are failing to excrete adequate ammonium, implicating a renal cause such as renal tubular acidosis.
A helpful memory aid is that a negative value tends to point to a gut cause, while a positive value points to a renal one. In this way the urine anion gap complements the serum anion gap, extending the diagnostic reasoning one step further: the serum gap separates high gap from normal gap acidosis, and for the normal gap cases, the urine gap then helps distinguish a gastrointestinal from a renal origin. It is a clear example of how a few additional measurements, interpreted with an understanding of the underlying physiology, can sharpen a diagnosis considerably.
Refining the Picture: The Delta Ratio
Once a high anion gap acidosis is identified, a further calculation can reveal whether a second acid-base disorder is hiding alongside it. The logic is that in a pure high gap acidosis, the rise in the anion gap above normal should roughly match the fall in bicarbonate below normal, because the acid that raised the gap also consumed the bicarbonate. Comparing these two changes, sometimes called the delta ratio or delta-delta, tests whether that one-to-one relationship holds.
When the rise in the gap closely matches the fall in bicarbonate, the picture is consistent with a single, pure high gap acidosis. When the bicarbonate has fallen more than the gap has risen, it suggests that a normal gap acidosis is also present, consuming additional bicarbonate without adding to the gap. When the bicarbonate has fallen less than the gap has risen, it suggests that a metabolic alkalosis or a chronically elevated bicarbonate is also in play, propping the bicarbonate up. This comparison is a sophisticated tool for uncovering the mixed disorders that a simple reading would miss, and it shows how much information can be extracted from a few electrolyte values.
Note: In a high gap acidosis, compare how much the gap has risen with how much the bicarbonate has fallen. A mismatch points to a second, coexisting acid-base disorder that deserves attention.
How the Anion Gap Is Used in Practice
The anion gap fits into acid-base assessment as a natural second step. The blood gas and electrolytes first reveal whether a metabolic acidosis is present, shown by a low bicarbonate and a low pH. The anion gap then sorts that acidosis into one of two broad families, the high gap or the normal gap, and each family carries its own list of causes and its own diagnostic path. This single fork dramatically focuses the investigation.
From there, the gap continues to guide the workup. A high gap prompts a search for the specific added acid, often with additional tests for lactate, ketones, kidney function, and possible ingestions. A normal gap directs attention toward the gastrointestinal and renal causes of bicarbonate loss. And the delta ratio, applied to a high gap acidosis, can uncover an additional hidden disorder. Throughout, the albumin correction ensures that none of this reasoning is built on a falsely reassuring number. Used this way, the anion gap is not a single data point but the hinge on which an entire diagnostic process turns.
Limitations and Cautions
The anion gap is reliable only when its limitations are respected. The most important, already emphasized, is the effect of albumin: an uncorrected gap in a patient with low albumin can badly mislead, and the correction is essential rather than optional.
The calculation is also sensitive to the accuracy of its three inputs. Because it is a small number derived by subtracting large numbers, an error in any single electrolyte measurement can meaningfully distort the gap. A surprising value is sometimes worth confirming with a repeat measurement rather than acted upon immediately. In addition, the normal range depends on the laboratory and the formula used, so the same numerical gap can be interpreted differently depending on the reference values that apply. Finally, the gap is a clue, not a diagnosis. It points toward categories of disease, but it must always be combined with the history, the examination, the rest of the laboratory data, and clinical judgment to arrive at an answer.
Common Mistakes to Avoid
A handful of recurring errors account for most of the trouble people have with the anion gap, and being aware of them prevents the majority of misreadings. The most frequent is failing to correct for albumin, which causes a high gap acidosis to be missed in exactly the hypoalbuminemic, critically ill patients in whom it matters most. Whenever the albumin is low, the correction is not optional.
A second common error is calculating the gap, finding it elevated, and stopping there, rather than going on to apply the delta ratio that can reveal a coexisting disorder. A high gap is the beginning of the reasoning, not the end. A third is treating a single laboratory’s reference range as universal, when the normal range genuinely varies with the analyzer and the formula; mixing a potassium-inclusive calculation with a potassium-exclusive reference range, for instance, will systematically mislead. A fourth is acting on a surprising gap without considering that a single electrolyte error can distort it, since the gap is a small number derived from larger ones. Avoiding these pitfalls comes down to a consistent habit: correct for albumin, check the delta ratio when the gap is high, know the local reference range, and confirm a value that does not fit the clinical picture.
Putting It Together: Worked Examples
A few examples show how the gap is calculated and interpreted.
- A patient has a sodium of 140, a chloride of 104, and a bicarbonate of 24. The anion gap is 140 minus 128, which is 12, a normal value consistent with no added unmeasured acid.
- A patient in diabetic ketoacidosis has a sodium of 138, a chloride of 100, and a bicarbonate of 10. The anion gap is 138 minus 110, which is 28, markedly elevated and consistent with a high anion gap metabolic acidosis from the accumulation of ketoacids.
- A patient with severe diarrhea has a sodium of 140, a chloride of 116, and a bicarbonate of 14. The anion gap is 140 minus 130, which is 10, a normal value despite a clear acidosis, the signature of a hyperchloremic, normal gap acidosis from bicarbonate loss.
- A critically ill patient has a sodium of 140, a chloride of 105, a bicarbonate of 19, and an albumin of just 2.0. The raw gap is 16, only mildly elevated, but correcting for the low albumin adds about 5, giving a corrected gap near 21, revealing a substantial high gap acidosis that the raw number understated.
Note: The last example is the one most worth remembering, because it captures how a low albumin can disguise a serious acidosis and why the correction matters so much in exactly the patients who are sickest.
A Note on Clinical Judgment
The anion gap is a calculated clue, and like any clue it is most valuable when read in context. It tells you whether unmeasured anions are present in unusual amounts, and in the setting of a metabolic acidosis it sorts the problem into categories that guide the next steps. But it does not name the diagnosis on its own, it depends on accurate electrolytes and a proper albumin correction, and it must be interpreted alongside the blood gas, the history, and the whole clinical picture.
Used thoughtfully, with attention to albumin and an eye for mixed disorders, the anion gap turns a routine electrolyte panel into a sharp diagnostic instrument that repeatedly proves its worth in acid-base medicine. Read it carefully, correct it when needed, and let it work as one well-understood part of a complete assessment.
Written by:
John Landry is a registered respiratory therapist from Memphis, TN, and has a bachelor's degree in kinesiology. He enjoys using evidence-based research to help others breathe easier and live a healthier life.
References
- Pandey DG, Sharma S. Biochemistry, Anion Gap. [Updated 2023 Jul 10]. In: StatPearls [Internet]. Treasure Island (FL): StatPearls Publishing; 2026.
