Anion Gap Calculator

What this anion gap calculator tells you

Anion gap values help you compare the major measured cations and anions in a serum chemistry panel and ask whether something unmeasured is widening the space between them. In practice, that makes the calculator useful when you are checking a low bicarbonate, looking for a high anion gap metabolic acidosis pattern, or following a patient’s acid-base status over time.

This anion gap calculator turns the standard bedside arithmetic into a repeatable calculation. Enter sodium, chloride, and bicarbonate from the same sample, then add potassium only if your lab or teaching source includes it in the formula. The result is reported in mEq/L, but the number only becomes meaningful when you match it to the convention your laboratory actually uses.

Conventions matter because the anion gap is not one universal number. Many laboratories and newer teaching references use the potassium-free version, while some institutions still present the potassium-inclusive version. This page supports both approaches: if potassium stays at 0, the result follows the common potassium-free calculation; if you enter potassium, the result shifts upward by that amount and should be compared with the higher potassium-inclusive reference band.

How to enter serum electrolytes for an anion gap

For an anion gap calculation, use sodium, chloride, bicarbonate, and optional potassium from the same draw and the same chemistry panel. Mixing values from different times can create a gap that reflects timing differences, not acid-base physiology.

All inputs on this page use milliequivalents per liter, or mEq/L. That unit is common for chemistry panels, and it keeps the calculation easy to compare with the reference intervals that laboratories print beside the result.

When you enter the values, it helps to think about the direction each electrolyte pushes the answer. Sodium and potassium increase the gap. Chloride and bicarbonate decrease it. That is why a small transcription error in chloride or bicarbonate can change the interpretation much more than people expect.

  • Sodium: the main measured cation in the anion gap equation and usually the largest positive term.
  • Potassium: optional in this calculator. Leave it at 0 if you want the potassium-free convention.
  • Chloride: a measured anion that lowers the gap as it rises.
  • Bicarbonate: another measured anion that lowers the gap; lower bicarbonate often appears in metabolic acidosis.

Because the anion gap is derived from a handful of lab numbers, it is worth checking the details before you rely on the output. Confirm the units, confirm the sample is the same one, and confirm that the potassium field matches the convention on the source report.

Anion gap formulas used on this page

This anion gap calculator follows the two common clinical conventions. The first leaves potassium out of the equation; the second includes it because some labs and textbooks still prefer that form.

  • Without potassium: AG = Na+ − Cl − HCO3
  • With potassium: AG = Na+ + K+ − Cl − HCO3

The MathML below matches the potassium-inclusive clinical equation, which is the one this calculator uses when potassium is entered. It is shown here because the calculator’s logic is fixed to the electrolyte subtraction formula rather than to a generic placeholder.

AG = Na+ + K+ Cl HCO3

On this page, a potassium value of 0 is simply the way to reproduce the potassium-free version without changing the form or the surrounding workflow. That lets one calculator serve both traditions while keeping the arithmetic visible and easy to verify.

Why this page does not use a generic math template

The anion gap is a fixed subtraction formula, not a reusable scoring model. That is why this page does not need a generic R = f(x1...xn) block or a weighted-sum template to explain the result. The useful question is not how many variables there are, but which measured electrolytes raise the gap and which ones lower it.

For the anion gap, sodium and optional potassium move the value upward, while chloride and bicarbonate move it downward. That simple structure makes the calculation easy to sanity-check: if chloride rises while everything else stays constant, the gap should fall; if bicarbonate falls, the gap should rise. If the number seems to move the wrong way, re-check the inputs before assuming the math is wrong.

Anion gap worked example using serum electrolytes

Suppose an adult chemistry panel shows sodium 140 mEq/L, potassium 4.0 mEq/L, chloride 100 mEq/L, and bicarbonate 24 mEq/L. Using the potassium-free convention, the anion gap is 140 − 100 − 24 = 16 mEq/L. Using the potassium-inclusive convention, the anion gap is 140 + 4 − 100 − 24 = 20 mEq/L.

That example shows why the potassium choice matters. The patient is the same, the electrolyte values are the same, but the reported anion gap changes because the formula changes. A potassium-inclusive result should always be interpreted against a potassium-inclusive reference interval, and a potassium-free result should be matched with the lower potassium-free band.

In a real clinical setting, the example is only a starting point. A value near the upper end of the expected range may be worth trending, especially if bicarbonate is falling or if the clinical picture suggests lactic acidosis, ketoacidosis, kidney failure, or another cause of a widened anion gap. One isolated number is rarely the whole story.

How to interpret an anion gap result

An anion gap result is best interpreted as a clue about acid-base balance rather than as a diagnosis on its own. A higher-than-expected gap suggests that unmeasured anions may be contributing to the chemistry pattern, while a normal gap with acidosis points toward bicarbonate loss, chloride gain, or another non-gap process.

In broad teaching terms, clinicians often think about the result this way:

  • Within reference range: there is no obvious increase in unmeasured anions from this calculation, although mixed disorders can still exist.
  • Mildly elevated: the gap may be starting to widen; compare it with the clinical picture and any prior values.
  • Markedly elevated: the pattern is more concerning for high anion gap metabolic acidosis, including lactate, ketones, renal failure, or certain toxic ingestions.
  • Low or negative: uncommon enough to deserve a second look at albumin, paraproteins, unmeasured cations, and possible reporting or transcription error.

Albumin deserves special attention because it is a major unmeasured anion. When albumin is low, the measured anion gap can look lower than it really is, and a clinically important widened gap may be partially hidden. This calculator does not apply an albumin correction, so a normal-looking value in a hypoalbuminemic patient should be interpreted cautiously.

Typical reference ranges and units

Anion gap values on this page are reported in mEq/L, and the normal interval depends on whether potassium is included and on how the laboratory calibrates its chemistry analyzer.

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 anion gap result is most useful when you place it beside the acid-base pattern rather than reading it in isolation. 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 does tell 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 anion gap 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 anion gap teaching on this page reflects standard acid-base reasoning 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.

Enter serum electrolyte values from the same sample. All fields use mEq/L. Potassium is optional and defaults to 0 so the form can also reproduce the common potassium-excluded formula.

Enter your lab values to compute the gap.

Formula used by this calculator: AG = Na + K − Cl − HCO3. Leave potassium at 0 if you want the common potassium-excluded version, then interpret the result against the matching reference range.

Mini-game: Anion Gap Triage

This optional anion gap mini-game turns serum electrolyte patterns into a fast lab-triage drill. Each card shows sodium, potassium, chloride, and bicarbonate from a mock chemistry panel, and you decide whether the result is Low, Normal, or High before it reaches the analyzer. It is separate from the calculator above, but it helps you practice the potassium-free and potassium-inclusive conventions under a little time pressure.

Score0
Time75s
Streak0
Wave1/3
Progress0 cleared
Stability3

Anion Gap Triage

Sort each incoming electrolyte panel into Low, Normal, or High before it reaches the analyzer.

  • Controls: tap or click a glowing bin, or press 1, 2, or 3 on the keyboard.
  • Formula: AG = Na + K − Cl − HCO3. If a case says K off, use the common formula without potassium.
  • Ranges: Normal is about 8-16 without K and about 12-20 with K.
  • Win the run: chain correct triage decisions, survive 75 seconds, and build a streak before the analyzer loses stability.

Best score: 0

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.

Optional practice only. The game does not change the calculator result.

Embed this calculator

Copy and paste the HTML below to add the Anion Gap Calculator | Serum AG With or Without Potassium to your website.