Serum electrolytes · Formula review July 2026

Anion Gap Calculator

Calculate the serum anion gap from sodium, chloride and bicarbonate or total CO₂. Add albumin for a corrected result, include potassium when your lab uses that formula, and compare the answer with your own laboratory limit.

Quick formula: Anion gap = Na⁺ − (Cl⁻ + HCO₃⁻). For sodium 140, chloride 104 and bicarbonate 24 mEq/L, the anion gap is 12 mEq/L.
Na⁺
Measured Cation
AG
Calculated Gap
Cl⁻
Measured Anion

For adult education and arithmetic support. This tool does not diagnose metabolic acidosis, diabetic ketoacidosis, kidney failure, poisoning or any other condition. Use laboratory values from the same sample and interpret them with pH, symptoms, history and the reporting laboratory’s range.

Serum anion gap calculation

Enter Electrolyte Results

Calculated locally
Required serum values
Add albumin, potassium or lab limit Optional

Use all electrolytes from one serum chemistry panel. For these monovalent ions, the numerical values in mEq/L and mmol/L are the same.

Try an example:

What Is the Anion Gap?

The anion gap is a calculated difference between commonly measured charged particles in serum. Sodium is the main measured positive ion in the standard formula. Chloride and bicarbonate are the measured negative ions. The result represents ions that are not included in that short equation, especially albumin and, during some illnesses, organic acids.

Clinicians use the calculation when evaluating acid-base problems, especially suspected metabolic acidosis. A raised gap can suggest that unmeasured anions have accumulated, but the number does not reveal which substance is present and cannot establish a diagnosis by itself.

The result belongs with its laboratory report. Modern analyzers can produce different reference intervals. Compare this calculation with the range printed beside the lab’s own anion gap, not one universal online cutoff.

Anion Gap Calculation Formula

The most common serum anion gap calculation leaves out potassium:

AG = Na⁺ − (Cl⁻ + HCO₃⁻)

Enter sodium, chloride and bicarbonate from the same blood draw. If the chemistry panel labels the last value as total CO₂, that number is commonly used as an estimate of serum bicarbonate for this calculation.

Worked example: Na 140, Cl 104, HCO₃ 24
  1. 1

    Add chloride and bicarbonate: 104 + 24 = 128

  2. 2

    Subtract that sum from sodium: 140 − 128 = 12

  3. 3

    Report the answer with the lab range: AG = 12 mEq/L

The arithmetic is exact for the entered values. Clinical meaning is not automatic. Sampling, assay method, albumin, kidney function, lactate, ketones, medicines and the person’s condition can all change interpretation.

How to Calculate Anion Gap from a BMP or CMP

  1. 1

    Use one chemistry panel

    Find sodium, chloride and bicarbonate or total CO₂ from the same basic or comprehensive metabolic panel.

  2. 2

    Check the units and formula

    Confirm that the reporting laboratory calculates its gap without potassium, as most do.

  3. 3

    Add albumin when available

    Low albumin can make an important gap look smaller, so an albumin-corrected value may add useful context.

  4. 4

    Use the lab’s upper limit

    Enter the upper end printed on the report. The result panel compares against that value without calling it a diagnosis.

  5. 5

    Interpret the whole acid-base picture

    Review pH, bicarbonate, lactate, ketones, kidney tests, medicines, symptoms and trends as appropriate.

If you need a complete pH, PaCO₂, bicarbonate and compensation review, use the ABG Calculator. That page answers a broader acid-base question; this page focuses on the serum anion gap calculation.

Anion Gap Calculation with CO₂

On a serum chemistry panel, “CO₂” usually means total carbon dioxide. Most of that total is bicarbonate, so laboratories commonly use total CO₂ in the anion gap equation. It is not the same measurement as the partial pressure of carbon dioxide, PaCO₂, on a blood gas.

Chemistry panel

Total CO₂

Measured in serum and commonly used as the bicarbonate term in the gap formula.

Na − (Cl + CO₂)
Blood gas

Calculated HCO₃⁻

Derived from measured pH and PaCO₂. Keep the sample type and method with the value.

Acid-base assessment

An isolated low total CO₂ does not prove metabolic acidosis. Clinical acid-base assessment may require pH and PaCO₂ as well as serum electrolytes.

Albumin-Corrected Anion Gap

Albumin is the largest unmeasured anion in normal plasma. When serum albumin is low, the measured gap also falls. That can hide an increase in other unmeasured anions. A widely used Figge-style correction is:

Corrected AG = measured AG + 2.5 × (4.0 − albumin in g/dL)

For a measured gap of 12 mEq/L and albumin of 2.0 g/dL, the correction adds 5: 12 + 2.5 × (4 − 2) = 17 mEq/L. The formula is an estimate, not a direct measurement of the missing ions.

Do not compare a corrected result blindly with every published range. Use the laboratory method, local reference interval and clinical context. Albumin correction is most important when hypoalbuminemia is present.

Albumin also affects interpretation of total calcium. The Corrected Calcium Calculator explains that separate calculation.

Anion Gap With and Without Potassium

Potassium is often omitted because its serum concentration is much smaller than sodium. Some teaching formulas and laboratories include it:

AG with K⁺ = (Na⁺ + K⁺) − (Cl⁻ + HCO₃⁻)

Adding potassium makes the numerical result higher. It also changes the expected reference interval. Do not compare a potassium-inclusive result with a range designed for the standard potassium-free equation. The calculator shows both values separately when potassium is entered.

High, Normal and Low Anion Gap Results

Above the lab rangeRaised gap

May reflect extra unmeasured anions. Examples include lactate, ketoacids, retained acids in kidney failure and some toxic metabolites. Targeted tests are needed.

Within the lab rangeContext still matters

A normal-range gap does not rule out an acid-base disorder. Hyperchloremic metabolic acidosis can occur without a raised gap.

Very low or negativeConfirm the result

Testing error is a common cause. Low albumin and less common conditions or interferences may also contribute.

Historically, many references used about 8–12 mEq/L without potassium. Some modern assays use a lower interval. This is why the calculator asks for the upper limit from the actual laboratory rather than imposing a universal “normal anion gap.”

Kidney disease can affect acid handling and the anion gap. For adult renal filtration estimates, see the GFR Calculator; eGFR and anion gap answer different questions.

Delta Gap and Delta Ratio

When a high anion gap metabolic acidosis is already suspected, clinicians may compare the rise in anion gap with the fall in bicarbonate. This can suggest a mixed metabolic process. Our calculator only displays the ratio when the selected gap is above the entered upper limit and bicarbonate is below 24 mEq/L.

Delta ratio = (AG − upper normal AG) ÷ (24 − HCO₃⁻)
Below 1

May suggest an additional normal-gap metabolic acidosis.

1 to 2

Often fits a predominantly high-gap metabolic acidosis pattern.

Above 2

May suggest concurrent metabolic alkalosis or a higher starting bicarbonate.

These bands are teaching guides, not diagnoses. The ratio is unstable when bicarbonate is near 24, depends on the chosen normal gap, and is not meant to be interpreted when high-gap acidosis is absent.

Anion Gap in DKA and Metabolic Acidosis

Many people with diabetic ketoacidosis have a high anion gap metabolic acidosis, but the gap alone is not a DKA test. Current consensus guidance gives direct blood beta-hydroxybutyrate measurement an important role. Glucose, pH or bicarbonate, ketones, symptoms and the clinical setting must be considered together.

Other high-gap patterns may occur with lactic acidosis, kidney failure and some poisonings. A serum gap cannot identify the cause, estimate toxin concentration or decide treatment. Normal-gap metabolic acidosis may occur with bicarbonate loss or impaired renal acid excretion.

Get urgent medical help for deep or rapid breathing, repeated vomiting, severe weakness, confusion, unusual sleepiness, suspected poisoning, or high glucose with ketones and illness. Do not delay care to repeat an online calculation.

Serum Anion Gap vs Urine Anion Gap

This calculator

Serum anion gap

Uses serum sodium, chloride and bicarbonate to support evaluation of metabolic acidosis.

Na − (Cl + HCO₃)
Separate calculation

Urine anion gap

Uses urine electrolytes as an indirect clue to ammonium excretion in selected normal-gap acidosis evaluations.

Urine Na + K − Cl

These calculations use different specimens and answer different questions. A urine anion gap calculator should not be substituted for this serum formula, and this page intentionally does not combine the two.

Important Limits and Common Errors

  • Mixing samples: sodium, chloride and bicarbonate must come from the same collection time.
  • Using PaCO₂: partial pressure of CO₂ is not the bicarbonate term in this equation.
  • Ignoring the lab range: analyzer methods change the expected interval.
  • Forgetting albumin: hypoalbuminemia can make a raised gap appear less obvious.
  • Mixing formulas: a result that includes potassium needs a potassium-inclusive reference interval.
  • Overusing the delta ratio: it should not be interpreted when the gap is not elevated or bicarbonate is not low.
  • Treating the gap as a diagnosis: the calculation cannot identify lactate, ketones, toxins or the cause of an abnormal result.

Anion Gap Calculator FAQs

How do you calculate anion gap?

Use values from the same serum sample: sodium minus the sum of chloride and bicarbonate. Written as a formula, AG = Na − (Cl + HCO₃). Most laboratories leave potassium out.

Can CO₂ be used to calculate anion gap?

Total CO₂ on a serum chemistry panel is commonly used as the bicarbonate estimate in the formula. Do not substitute PaCO₂ from a blood gas. Keep the sample source and laboratory method with the result.

What is the corrected anion gap formula for albumin?

A common formula is corrected AG = measured AG + 2.5 × (4.0 − albumin in g/dL). It is an approximation and is especially useful when albumin is low.

Should potassium be included in the anion gap?

Usually it is omitted, but some laboratories include it. Either equation can be calculated, but each needs its matching reference range.

Is the urine anion gap the same calculation?

No. The serum gap uses serum sodium, chloride and bicarbonate. The urine gap uses urine sodium plus potassium minus chloride and helps with a different clinical question.

Evidence and Editorial Notes

The formulas, safeguards and interpretation limits were checked against clinical reviews, a primary albumin-correction study and current diabetes consensus guidance.

  1. Kharsa A, et al. Anion Gap and Non-Anion Gap Metabolic Acidosis. StatPearls. Updated 2025.
  2. Figge J, et al. Anion gap and hypoalbuminemia. Critical Care Medicine. 1998.
  3. Haber LA, et al. Evaluating a low anion gap: A practical approach. Cleveland Clinic Journal of Medicine. 2023.
  4. Umpierrez GE, et al. Hyperglycemic Crises in Adults With Diabetes: A Consensus Report. Diabetes Care. 2024.
  5. NCBI Clinical Methods: Serum Total Carbon Dioxide.

Last formula and source review: July 26, 2026. Calculations run in your browser. The values entered in this form are not sent to our server.

Editorial review

Dr. Heart (Health Observer)

Dr. Heart reviews the formulas, sources, intended uses and limits presented across Heart Score Calculator. Each tool is checked against published references and explained in clear language. Dr. Heart is an editorial persona, not a substitute for a licensed clinician.

Read the editorial profile →