Skip to content

How-to guide

How to Calculate Anion Gap: Formula, Steps & Examples

Learn how to calculate Anion Gap — the formula explained step by step, with worked examples and a free calculator to check your answer.

By Dr. Neha Sharma, MBBS, MD (Nutrition) · Updated Jun 2026 · 2 min read

Calculating your anion gap is straightforward once you know the Anion Gap formula and what each input means. This guide explains the method in plain language, walks through a manual calculation, and gives worked examples you can follow — then you can do it instantly with the Anion Gap Calculator.

What is Anion Gap?

The Anion Gap calculation tells you your anion gap from a few simple inputs. The figure you are solving for here is the anion gap.

The Anion Gap formula

The core formula is:

Anion gap = Sodium (Na⁺) - (Chloride (Cl⁻) + Bicarbonate (HCO₃⁻))

Here is what each input means:

  • Sodium (Na⁺) — a value measured in mEq/L. Example: 140 mEq/L.
  • Chloride (Cl⁻) — a value measured in mEq/L. Example: 104 mEq/L.
  • Bicarbonate (HCO₃⁻) — a value measured in mEq/L. Example: 24 mEq/L.

How to calculate it step by step

  • Write down the sodium (na⁺) (for example, 140 mEq/L).
  • Write down the chloride (cl⁻) (for example, 104 mEq/L).
  • Write down the bicarbonate (hco₃⁻) (for example, 24 mEq/L).
  • Apply the formula above to get your anion gap.
  • Double-check the result with the Anion Gap Calculator.

Worked examples

Example 1

Input / OutputValue
Sodium (Na⁺)140 mEq/L
Chloride (Cl⁻)104 mEq/L
Bicarbonate (HCO₃⁻)24 mEq/L
Anion gap12.0

With sodium (na⁺) of 140 mEq/L, chloride (cl⁻) of 104 mEq/L and bicarbonate (hco₃⁻) of 24 mEq/L, the anion gap works out to 12.0.

Example 2

With sodium (na⁺) of 280 mEq/L, chloride (cl⁻) of 104 mEq/L and bicarbonate (hco₃⁻) of 24 mEq/L, the anion gap works out to 152.0.

ResultValue
Anion gap152.0

Example 3

With sodium (na⁺) of 70 mEq/L, chloride (cl⁻) of 104 mEq/L and bicarbonate (hco₃⁻) of 24 mEq/L, the anion gap works out to -58.0.

ResultValue
Anion gap-58.0

Tips for an accurate result

  • Keep your units consistent — mixing, say, months with years or grams with kilograms is the most common source of error.
  • Round only at the very end. Rounding inputs early can shift the final answer noticeably.
  • Re-run the numbers whenever an input changes, rather than estimating from an old result.
  • These figures are general estimates, not medical advice — check with a qualified professional before acting on them.

Prefer not to do the maths by hand? — the Anion Gap Calculator does it instantly, for free, with the formula and a worked example built in.

Continue exploring health calculators with these tools: BMI Calculator, Corrected Calcium Calculator, QTc Calculator (Bazett), Maintenance Fluid Calculator (4-2-1 Rule), Parkland Formula Calculator (Burn Fluid).

Calculators in this guide

Frequently asked questions

The formula is: Anion gap = Sodium (Na⁺) - (Chloride (Cl⁻) + Bicarbonate (HCO₃⁻)). With sodium (na⁺) of 140 mEq/L, chloride (cl⁻) of 104 mEq/L and bicarbonate (hco₃⁻) of 24 mEq/L, the anion gap works out to 12.0.

Gather each input, apply the formula step by step keeping your units consistent, and round only at the end. You can verify your answer instantly with the Anion Gap Calculator.

It uses the standard formula with exact arithmetic, so the result is correct for the inputs you enter. Bear in mind that real-world outcomes can still differ when underlying assumptions change.

Dr. Neha Sharma · MBBS, MD (Nutrition)

Dr. Neha Sharma is a physician specialising in nutrition and preventive health, with over a decade of clinical experience helping patients understand body metrics and healthy lifestyle targets.