Home › Medical & Clinical › Anion Gap Calculator
Anion Gap Calculator
Computes the serum anion gap from sodium, chloride and bicarbonate, optionally including potassium, and the albumin-corrected gap (Figge) for hypoalbuminaemia.
When to use
You have a basic metabolic panel and want the anion gap to classify a metabolic acidosis or check for unmeasured anions.
Do not use when: Electrolytes come from different samples or times, or you need a full acid-base interpretation (pH, pCO2, delta ratio), which this calculator does not perform.
Formula
anion_gap = sodium − (chloride + bicarbonate); with potassium: sodium + potassium − (chloride + bicarbonate); albumin-corrected gap = anion_gap + 2.5 × (4.0 − albumin_g_dl)
Reference ranges depend on the analyser (traditional 8–16 mEq/L; ion-selective electrodes often give 3–11), so compare with the local laboratory range; each 1 g/dL fall in albumin lowers the expected gap by about 2.5 mEq/L (Figge 1998). Results are informational only and not a substitute for clinical judgement or medical advice.
Inputs
| Parameter | Type | Unit | Required | Description |
|---|---|---|---|---|
sodium_mmol_l | number | mmol/L | yes | Serum sodium (mmol/L = mEq/L). Range: ≥ 100, ≤ 200 |
chloride_mmol_l | number | mmol/L | yes | Serum chloride. Range: ≥ 50, ≤ 160 |
bicarbonate_mmol_l | number | mmol/L | yes | Serum bicarbonate (total CO2). Range: ≥ 1, ≤ 60 |
potassium_mmol_l | number | mmol/L | no | Optional serum potassium; adds the gap variant that includes K. Range: ≥ 1, ≤ 12 |
albumin_g_dl | number | g/dL | no | Optional serum albumin in g/dL (g/L ÷ 10); enables the albumin-corrected gap. Range: > 0, ≤ 7 |
Outputs
| Output | Type | Unit | Description |
|---|---|---|---|
anion_gap | number | mEq/L | Na − (Cl + HCO3). |
anion_gap_with_potassium | number | mEq/L | Na + K − (Cl + HCO3); only when potassium is given (reference range about 4 mEq/L higher). |
albumin_corrected_anion_gap | number | mEq/L | Gap + 2.5 × (4 − albumin g/dL); only when albumin is given. |
interpretation | string | Low / normal / elevated against the traditional 8–16 mEq/L range (corrected gap when albumin is given). |
Example
Na 140, Cl 104, HCO3 24, K 4.0, albumin 3.0: {"sodium_mmol_l":140,"chloride_mmol_l":104,"bicarbonate_mmol_l":24,"potassium_mmol_l":4,"albumin_g_dl":3} → {"anion_gap":12,"anion_gap_with_potassium":16,"albumin_corrected_anion_gap":14.5,"interpretation":"Normal (8–16 mEq/L, albumin-corrected)"}
Na 135, Cl 100, HCO3 10: {"sodium_mmol_l":135,"chloride_mmol_l":100,"bicarbonate_mmol_l":10} → {"anion_gap":25,"interpretation":"Elevated (>16 mEq/L): pattern of a high anion gap metabolic acidosis"}
GET https://tttkmbb.com/api/v1/calculate/anion-gap?sodium_mmol_l=140&chloride_mmol_l=104&bicarbonate_mmol_l=24&potassium_mmol_l=4&albumin_g_dl=3
Machine access
- API:
GET https://tttkmbb.com/api/v1/calculate/anion-gap(query parameters) orPOSTwith a JSON body{"inputs": {...}} - Schema: https://tttkmbb.com/api/v1/calculators/anion-gap · Markdown: https://tttkmbb.com/medical/anion-gap.md · JSON definition: https://tttkmbb.com/medical/anion-gap.json
- MCP: server
https://tttkmbb.com/mcp, toolrun_calculator with calculator_id="anion-gap" - OpenAPI operationId:
calculate_anion_gap - Freshness:
static. Authentication: none. Rate limit: fair use (see rate limits).
Sources
FAQ
Should potassium be included?
Most laboratories and textbooks omit potassium (normal about 8–16 mEq/L); including it raises the value by roughly 4 mEq/L, so use the matching reference range (about 12–20).
Why correct for albumin?
Albumin is the main unmeasured anion; in hypoalbuminaemia a 'normal' gap can hide an excess of other anions such as lactate or ketoacids.
Related calculators
- Corrected Sodium Calculator — Correct sodium for hyperglycaemia before interpreting electrolytes.
- Corrected Calcium Calculator — Another albumin-dependent correction.