Urine Anion Gap Calculator

Classify metabolic acidosis as GI versus renal bicarbonate loss

Calculate the urine anion gap from urine sodium, potassium and chloride to distinguish renal tubular acidosis (positive gap) from diarrhoea-driven acidosis (negative gap). A nephrology diagnostic aid that runs in your browser. It runs free in your browser on Gera Tools, with nothing uploaded.

Last updated Source: Gera Tools

What is the urine anion gap formula?

The urine anion gap equals urine sodium plus urine potassium minus urine chloride, all in mmol per litre. It is an indirect marker of how much ammonium the kidney is excreting, because ammonium is excreted alongside chloride.

The urine anion gap is a simple bedside calculation that helps work out why a patient has a normal anion gap metabolic acidosis. Because the kidney’s main acid-handling response is to excrete ammonium, and ammonium leaves with chloride, the gap acts as an indirect window onto that response.

The diagnostic question it answers

When a patient has a hyperchloraemic, normal-anion-gap metabolic acidosis (NAGMA), the clinician must determine whether the kidneys are responding appropriately. There are two broad categories:

  1. Extrarenal bicarbonate loss (most often severe diarrhoea) — the gut is losing HCO₃⁻, and the kidneys are working hard to compensate by maximally excreting ammonium (NH₄⁺). This is a normal renal response to an external problem.
  2. Renal tubular acidosis (RTA) — the kidneys themselves are failing to excrete sufficient acid, either because distal tubular H⁺ secretion is defective (type 1 dRTA) or because aldosterone-driven ammoniagenesis is impaired (type 4, hyperkalaemic).

The urine anion gap distinguishes these two by using chloride as a proxy for ammonium, because NH₄⁺ is not routinely measured on urine electrolyte panels but its counterion (Cl⁻) is.

How it works

The calculation adds the two main urinary cations measured and subtracts the main measured anion:

UAG = U(Na+) + U(K+) - U(Cl-)     (all in mmol/L)

When the kidney excretes a lot of ammonium, urine chloride climbs to balance it, so chloride exceeds sodium plus potassium and the gap turns negative. When the kidney cannot make ammonium, chloride stays relatively low and the gap is positive.

Interpretation guide

UAG resultInterpretationLikely diagnosis
Clearly negative (e.g. −20 to −50)Kidney is excreting ammonium normallyExtrarenal loss: diarrhoea, proximal GI fistula
Near-zero (−10 to +10)Indeterminate — insufficient signalNeeds urine osmolar gap or further testing
Clearly positive (e.g. +20 to +60)Impaired ammonium excretionRenal tubular acidosis (type 1 or type 4)

When the urine anion gap is unreliable

The UAG is only valid within a hyperchloraemic, NAGMA. It becomes misleading in several situations:

  • Urine pH above 6.5 — at alkaline pH the renal tubule shifts handling patterns and the chloride-ammonium relationship breaks down.
  • Ketonuria — ketone anions in urine are unmeasured but obligate cations to balance them, which artificially suppresses the apparent chloride deficit.
  • Volume depletion — avid sodium retention lowers urine sodium, which can make the gap spuriously positive even with adequate ammonium excretion.
  • High urine protein or other unmeasured anions — same principle as ketones.

In these situations, the urine osmolar gap (measured minus calculated osmolality) is a more direct estimate of urinary ammonium and should be used instead.

Caveats

This tool is a calculation aid for educational and clinical planning purposes. Interpretation requires the full clinical picture — serum electrolytes, blood gas, clinical history, and volume status — not just the numerical result. All calculations run in your browser; nothing you enter is sent to a server.