StatGardenREF. DESK
Calculators/Health/Urine anion gap
Health

Urine anion gap calculator

Urinary electrolyte gap that helps distinguish causes of a normal anion-gap metabolic acidosis.

Published 8 August 2026 · Updated 22 September 2026

What this calculator does

When a metabolic acidosis has a normal blood anion gap, the next question is whether the kidneys are failing to excrete acid or whether bicarbonate is being lost from the gut. The urine anion gap distinguishes the two.

It works as an indirect measure of ammonium, which the kidney excretes to remove acid but which is not measured directly. A negative gap means plenty of ammonium is being excreted, pointing away from the kidney as the cause.

The formula

FormulaUrine anion gap = (Urine Na + Urine K) − Urine Cl

Add urine sodium and potassium and subtract urine chloride. Because ammonium is excreted with chloride, a large chloride figure relative to the measured cations implies high ammonium.

TermMeaning
Urine anion gapUrine sodium plus potassium, less chloride.
AmmoniumThe kidney's main route for excreting acid, inferred rather than measured.
Negative gapSuggests high ammonium excretion, more typical of a gastrointestinal cause.

The inputs explained

FieldWhat to enter
Urine sodium (mEq/L)Urine sodium in mEq/L.
Urine potassium (mEq/L)Urine potassium in mEq/L.
Urine chloride (mEq/L)Urine chloride in mEq/L, which carries the inference about ammonium.

When to use it

Investigating a normal-gap acidosis

The urine gap is the standard next step after the blood gap comes back normal.

Distinguishing renal from GI bicarbonate loss

The two have quite different causes and the sign of the gap separates them.

Learning acid-base reasoning

Using chloride as a proxy for ammonium is a neat piece of clinical inference.

Worked examples

Every figure in the tables below is produced by this page’s own calculator at build time, so the numbers and the tool always agree. Select any row to load that scenario.

How does urine chloride flip the sign?

The same measured cations at three chloride levels.

Urine sodium 40 mEq/L, potassium 30 mEq/L
Urine chlorideUrine anion gapReading
40 mEq/L30.0 mEq/LPositive: suggests low urinary ammonium excretion, more typical of a renal cause of acidosis
60 mEq/L10.0 mEq/LPositive: suggests low urinary ammonium excretion, more typical of a renal cause of acidosis
100 mEq/L-30.0 mEq/LNegative: suggests high urinary ammonium excretion, more typical of a GI cause such as diarrhoea
At 40 mEq/L of chloride the gap is +30.0 and at 60 it is exactly +10.0, at the top of the usual range. At 100 the gap turns to −30.0, which points toward a gastrointestinal rather than renal cause.

Questions

Why does chloride indicate ammonium?

Because ammonium is excreted largely as ammonium chloride, so more ammonium means more chloride in the urine. Since ammonium itself is not measured on a routine panel, chloride stands in for it.

When is the gap unreliable?

When other unmeasured anions are present in the urine, which happens in several situations including some poisonings and with certain antibiotics. It also assumes reasonable urine output.

Is a positive gap always renal?

No. It suggests low ammonium excretion, which points toward a renal cause, but it does not identify which. Distinguishing between the types of renal tubular acidosis requires further testing.

How does this relate to the blood anion gap?

They answer different questions in sequence. The blood gap says whether unmeasured acid has accumulated; the urine gap is used when it has not, to ask where the bicarbonate went.

For the blood equivalent, see the anion gap calculator. For the delta comparison, see the delta ratio calculator.