Anion Gap Calculator
Electrolytes hide more information than their individual reference ranges suggest. The anion gap calculator subtracts the routinely measured anions from measured cations to estimate whether unmeasured ions are contributing to an acid-base disturbance. This page is written around the calculator’s exact behavior, including the optional potassium term and albumin correction.
What the anion gap measures
Blood plasma remains electrically neutral, but routine chemistry panels measure only a handful of charged particles. Sodium is the main measured cation. Chloride and bicarbonate are the main measured anions used in the common gap calculation. The difference between them is not a literal empty space; it represents unmeasured anions and cations, including albumin, phosphate, sulfate, organic acids, calcium, magnesium, and potassium when it is not explicitly included.
Clinically, the anion gap is often discussed during metabolic acidosis evaluation. A higher gap may point toward accumulation of unmeasured acids, while a normal gap with low bicarbonate can suggest bicarbonate loss or impaired renal acid excretion. The number is only one piece. Pair it with pH and PaCO2 from an acid base calculator, oxygenation context from the A-a gradient calculator, kidney function, lactate, ketones, medication history, and timing of the sample.
Exact formulas in the calculation
By default, the calculator uses sodium, chloride, and bicarbonate in mEq/L:
If the potassium switch is on, potassium is added to the measured cation side:
If albumin correction is on, the calculator uses 4.0 g/dL as normal albumin:
The result is displayed to one decimal place. The default reference range is 3 to 11 mEq/L. With potassium included, the range changes to 5 to 16 mEq/L. A low flag appears below 3 without potassium or below 5 with potassium. A high flag appears above 11 without potassium or above 16 with potassium.
Example: calculating an anion gap
Take sodium 140 mEq/L, chloride 102 mEq/L, and bicarbonate 24 mEq/L, with potassium off. The calculation is:
The sum inside the parentheses is 126, so the gap is 14.0 mEq/L. Because 14.0 is greater than the default upper reference value of 11, the calculator labels it high. If albumin correction is also turned on and albumin is 3.0 g/dL, the correction adds 2.5 times 1.0, or 2.5. The corrected anion gap is 16.5 mEq/L. Important calculate detail: the displayed interpretation is still based on the uncorrected 14.0 result, not on the corrected value.
With potassium on and potassium 4.0 mEq/L, the same electrolytes produce 18.0 mEq/L:
That is compared with the potassium-included range of 5 to 16 mEq/L, so it is also labeled high.
Interpretation and reference ranges
Reference ranges differ by analyzer, laboratory method, and whether potassium is included. Modern ion-selective electrode methods often produce lower anion gap ranges than older textbook values. This calculator uses its own embedded thresholds: 3 to 11 mEq/L without potassium and 5 to 16 mEq/L with potassium. Use the range printed by the laboratory whenever it differs from the calculator.
Albumin matters because it is a major negatively charged plasma protein. Low albumin can lower the uncorrected gap and potentially obscure a clinically important increase in unmeasured anions. The correction used here, adding 2.5 mEq/L for each 1 g/dL albumin below 4.0, is a commonly cited adjustment. The albumin globulin ratio calculator can help review protein relationships, but it does not replace measured serum albumin for this correction.
Limitations, disclaimer, and common mistakes
This calculator is educational only and is not medical advice. It does not diagnose metabolic acidosis, diabetic ketoacidosis, lactic acidosis, poisoning, kidney failure, or any other condition. Clinicians interpret the gap with symptoms, medications, pH, PaCO2, lactate, ketones, renal function, and serial results.
Common mistakes include mixing electrolyte values from different blood draws, using total CO2 from one panel and chloride from another, forgetting that bicarbonate and total CO2 are not always identical in every context, and comparing a potassium-included result with a potassium-excluded reference range. Another mistake is treating a normal gap as reassuring when albumin is low. If you are planning nutrition or weight changes rather than interpreting acute labs, tools such as the BMR calculator belong to a different category and should not be used to interpret acid-base disorders.
Sources
- NCBI Bookshelf, Biochemistry, Anion Gap — overview of formulas, interpretation, and clinical context.
- Figge J, Jabor A, Kazda A, Fencl V., Anion gap and hypoalbuminemia — albumin correction relationship used in clinical acid-base interpretation.
- NCBI Bookshelf, Physiology, Acid Base Balance — background on acid-base physiology and compensation.