Anion Gap Calculator
What this anion gap calculator does
The anion gap is a quick arithmetic check that compares the major measured cations and anions in a basic chemistry panel. In everyday clinical use, it helps answer a focused question: is there a larger-than-expected difference between the measured positive ions and measured negative ions, suggesting the presence of unmeasured acids or other unmeasured ions? That question matters most when you are evaluating metabolic acidosis, trending a patient over time, or making sense of a bicarbonate value that appears low.
This calculator turns that bedside arithmetic into a clean, repeatable workflow. You enter sodium, chloride, and bicarbonate from the same blood sample, and you can optionally add potassium if that is how your local laboratory or teaching source reports the formula. The result is the calculated anion gap in mEq/L. The number itself is simple; the value comes from pairing it with the right reference range and the right clinical context.
It is also important to be precise about conventions. Many modern laboratories report the anion gap without potassium, while some textbooks and institutions still teach or display a potassium-inclusive version. This page supports both approaches without changing the form: if you leave potassium at 0, the output matches the common formula that excludes potassium. If you enter potassium, the calculator uses it in the arithmetic, and the interpretation should shift to the higher potassium-inclusive reference range.
How to enter the lab values
Use values from the same chemistry panel and the same point in time. Mixing a sodium from one draw with a chloride or bicarbonate from another can produce a misleading gap that reflects timing differences rather than physiology. All fields on this page use milliequivalents per liter, usually written as mEq/L.
For a quick, reliable workflow, think of the inputs in plain language. Sodium is the major measured cation. Chloride and bicarbonate are the major measured anions used in the formula. Potassium is optional here because some laboratories include it and others do not. The safest habit is to match whatever convention your laboratory uses when it prints its own anion gap reference range.
- Sodium: usually the largest positive term in the equation and the main driver on the cation side.
- Potassium: optional. If your local practice excludes potassium, leave it at 0 and interpret the result against the non-potassium range.
- Chloride: a measured anion that lowers the calculated gap as it rises.
- Bicarbonate: another measured anion. Lower bicarbonate often accompanies acidosis, but the anion gap determines whether the acidosis is gap-elevated or not.
Because this is a derived value, small transcription mistakes matter. A single misplaced digit in chloride or bicarbonate can shift the gap by a clinically important amount. If a result looks surprising, double-check that the units are correct and that the values really came from the same sample.
Formulas used on this page
Two related formulas are common in practice. The most frequently used modern version excludes potassium:
- Without potassium: AG = Na+ − Cl− − HCO3−
- With potassium: AG = Na+ + K+ − Cl− − HCO3−
The potassium-inclusive MathML form below is preserved exactly because it matches one standard way of presenting the equation:
On this page, the calculator performs AG = Na + K − Cl − HCO3. That means the default potassium value of 0 is not a trick or a placeholder mistake. It is the simplest way to let one form cover both formula conventions while keeping the arithmetic transparent.
General notation behind the calculator
Although the anion gap formula itself is straightforward subtraction, it still fits the broader pattern used by many calculators: a result is a function of several measured inputs. The preserved MathML below shows that general notation. Here, the inputs happen to be the electrolyte values from the chemistry panel.
The next preserved block is a more general weighted-sum form. It is not the clinical formula for the anion gap, but it explains a useful calculator habit: identify which terms add to the result and which subtract from it. In anion gap terms, sodium and optional potassium are on one side, while chloride and bicarbonate are on the other.
That general lens is helpful when you sanity-check an answer. If chloride rises while everything else stays constant, the gap should fall. If bicarbonate falls while sodium and chloride stay fixed, the gap should rise. When the result moves in the opposite direction from what the formula predicts, the first thing to question is the data entry rather than the math.
Worked example
Suppose an adult patient has sodium 140 mEq/L, potassium 4.0 mEq/L, chloride 100 mEq/L, and bicarbonate 24 mEq/L. Using the non-potassium formula, the calculation is 140 − 100 − 24 = 16 mEq/L. Using the potassium-inclusive formula, the calculation is 140 + 4 − 100 − 24 = 20 mEq/L.
Notice what changed and what did not. The patient did not change. Only the convention changed. When potassium is included, the absolute anion gap is higher by roughly the potassium value, which is why the reference range also needs to be higher. A reader who compares a potassium-inclusive result with a potassium-exclusive reference interval can easily misclassify a perfectly ordinary value.
This is one reason the calculator should be interpreted as part of a pattern rather than as an isolated number. If a patient has a gap at the upper end of normal, the next step is not to jump to a diagnosis. Instead, look at the trend, the bicarbonate, the pH if available, the lactate, ketones, kidney function, and the clinical story. A rising gap over time often matters more than a single borderline value.
How to interpret the result
The anion gap does not diagnose a specific disorder by itself. It is best understood as a clue about whether unmeasured anions may be contributing to acid-base status. A higher-than-expected gap raises concern for high anion gap metabolic acidosis, while a normal gap in the setting of acidosis points you toward causes such as bicarbonate loss or chloride gain. A low or negative gap is unusual and should prompt a careful look at albumin level, paraproteins, laboratory method, and possible data error.
In broad adult terms, and only as a teaching shorthand, these interpretations are common:
- Within reference range: no obvious excess of unmeasured anions by this calculation, though mixed disorders and non-gap acidosis can still be present.
- Mildly elevated: possible early or modest accumulation of unmeasured acids; trends and clinical correlation matter.
- Markedly elevated: more concerning for high anion gap metabolic acidosis such as lactic acidosis, ketoacidosis, renal failure, or certain toxic ingestions.
- Low or negative: uncommon; think about hypoalbuminemia, paraproteinemia, increased unmeasured cations, or error before over-interpreting the number.
Albumin deserves special mention because it is a major unmeasured anion. Low albumin can lower the measured anion gap substantially and may mask a clinically important high gap. This calculator does not apply an albumin correction, so a normal-looking result in a hypoalbuminemic patient may be falsely reassuring.
Typical reference ranges and units
All inputs on this page are in mEq/L, and the result is reported in mEq/L. Exact ranges vary by instrument, assay, and laboratory policy, but the following table gives useful teaching benchmarks for adults with normal albumin and standard methods.
| Measurement | Typical adult range | Why it matters here |
|---|---|---|
| Sodium (Na+) | About 135-145 mEq/L | Main positive term in the formula. |
| Potassium (K+) | About 3.5-5.0 mEq/L | Optional positive term; including it raises the numeric AG. |
| Chloride (Cl−) | About 98-106 mEq/L | Higher chloride lowers the calculated AG. |
| Bicarbonate (HCO3−) | About 22-28 mEq/L | Lower bicarbonate raises the AG when other terms stay fixed. |
| Anion gap without potassium | Roughly 8-16 mEq/L | Common modern laboratory convention. |
| Anion gap with potassium | Roughly 12-20 mEq/L | Use only with potassium-inclusive reporting. |
These ranges are intentionally approximate. Always defer to the reference interval attached to the patient’s actual laboratory report, especially if the result is near the boundary between normal and abnormal.
Clinical context: high, normal, and low gap patterns
An elevated gap suggests additional unmeasured anions in the blood. The classic teaching list includes lactic acidosis, ketoacidosis, kidney failure with retained acids, and some toxic alcohol or salicylate exposures. The anion gap does not tell you which of those is present, but it tells you that the chemistry panel is not fully explained by the measured chloride and bicarbonate alone.
By contrast, a patient can absolutely have metabolic acidosis with a normal anion gap. That is often called hyperchloremic or non-gap metabolic acidosis. Common examples include gastrointestinal bicarbonate loss, renal tubular acidosis, or large amounts of chloride-rich intravenous fluid. In those situations the bicarbonate falls, but chloride rises enough to keep the gap from widening.
Low gap results are less common and often generate confusion. Hypoalbuminemia is a frequent reason, because a lower concentration of that unmeasured anion reduces the measured gap. Less common explanations include paraproteinemias, severe increases in unmeasured cations such as lithium, or laboratory interference. When you see a low or negative gap that does not fit the story, confirm the data before drawing conclusions.
Assumptions, limitations, and safety information
This calculator is intentionally narrow. It performs the arithmetic accurately, but it does not know whether the numbers were drawn at the same time, whether the sample was hemolyzed, whether albumin is low, whether the patient is a child, or whether the patient has a mixed acid-base disorder. Those are clinical interpretation steps that belong to the user, not the calculator.
- Laboratory variation: different analyzers and local policies produce different reference intervals.
- No albumin correction: this page does not adjust the gap for hypoalbuminemia.
- No diagnosis engine: a high or low result is a clue, not a final answer.
- Single time point only: trends over time are often more informative than one isolated value.
- Same-sample assumption: the calculator assumes the entered electrolytes belong together.
Medical disclaimer: This tool is for education and clinician decision support only. It does not provide medical advice, diagnosis, or treatment, and it should not be used by patients to guide care. For urgent or patient-specific decisions, rely on qualified clinical judgment, institutional protocols, and the reporting laboratory’s reference data.
Authorship and source context
The discussion on this page reflects standard acid-base teaching used in internal medicine, emergency medicine, nephrology, and critical care. For deeper interpretation, users should consult full acid-base references, local chemistry methods, and specialty resources that address albumin correction, delta gap reasoning, and mixed disorders in more detail.
Mini-game: Anion Gap Triage
This optional canvas mini-game turns the calculator concept into a fast lab-triage challenge. Each case card shows electrolyte values and tells you whether potassium counts. Your job is to route the panel into Low, Normal, or High before it reaches the analyzer. It is separate from the calculator result above, but it is a memorable way to practice the formula and the two common reference-range conventions under a little time pressure.
Tip: Low means below the normal band, normal means inside it, and high means above it. Later waves add potassium-inclusive cards and borderline cutoff cases.
