The urine anion gap is a quick screening calculation from a random or spot urine sample — urine sodium plus urine potassium minus urine chloride — used to help localize the cause of a non-anion-gap metabolic acidosis. This calculator computes the gap and classifies the result as negative, near zero, or positive.

How the urine anion gap works

The urine anion gap is calculated as UAG = UNa + UK − UCl, using electrolyte values from a random or spot urine sample, all in mEq/L. It is an indirect proxy for urinary ammonium (NH4+) excretion — ammonium is not measured directly on a routine urine panel, but it is excreted paired with chloride. A relatively high urine chloride (compared to sodium plus potassium) drives the calculated gap negative and implies high ammonium chloride excretion, meaning the kidney is responding appropriately to the acidosis.

A positive urine anion gap means urine chloride is relatively low, implying impaired ammonium excretion — a renal cause such as renal tubular acidosis (RTA). A negative urine anion gap points to an extrarenal, typically gastrointestinal, cause such as diarrhea-driven bicarbonate loss.

Inputs and what they mean

Urine sodium (UNa) and urine potassium (UK) are the measured urine cations, both in mEq/L. Urine chloride (UCl) is the measured urine anion and the value most directly tied to ammonium excretion.

All three values should come from the same urine sample — typically a random or spot collection rather than a timed collection, since the urine anion gap is a ratio-style screening estimate rather than an absolute excretion rate.

Limits and edge cases

The urine anion gap is a screening tool, not a diagnosis, and it is only meaningful once a non-anion-gap (normal serum-AG) metabolic acidosis has already been confirmed — see the vs Serum AG tab for how the two tests differ. Values close to zero don't reliably discriminate a renal from a GI cause. The urine anion gap can also be unreliable in patients with a high urine pH (bicarbonaturia), ketonuria, or unmeasured urine anions (e.g. from toluene exposure) — in those settings the urine osmotic gap is a more direct estimate of ammonium excretion.