Urine Anion Gap (UAG) Calculator
Calculate the urine anion gap from urine sodium, potassium, and chloride to estimate ammonium excretion and distinguish GI from renal causes of a normal-anion-gap metabolic acidosis.
How the urine anion gap works
The urine anion gap (UAG) is a bedside surrogate for the kidney's excretion of ammonium (NH₄⁺), the principal route by which the body eliminates acid. Ammonium is difficult to measure directly on a routine urine panel, but because electroneutrality must hold in urine just as it does in serum, the gap between the measured urinary cations (Na⁺ + K⁺) and the measured urinary anion (Cl⁻) tracks the unmeasured cation NH₄⁺. The urine anion gap formula is simply UAG = Urine Na⁺ + Urine K⁺ − Urine Cl⁻. When NH₄⁺ excretion is high (the kidney responding appropriately to an acid load), chloride is excreted alongside it and the UAG turns negative. When the kidney fails to excrete NH₄⁺, chloride does not accompany it and the UAG stays positive.
Worked example
A patient with a chronic diarrheal illness has a normal NAGMA picture and urine electrolytes showing Na⁺ 40, K⁺ 35, Cl⁻ 110 mEq/L. The UAG is 40 + 35 − 110 = −35 mEq/L — negative, indicating an appropriate renal ammonium response and pointing to a GI cause (diarrhea) for the acidosis. Contrast this with a patient in distal renal tubular acidosis: urine Na⁺ 45, K⁺ 30, Cl⁻ 60 → UAG = 45 + 30 − 60 = +15 mEq/L, an indeterminate-to-positive result that flags impaired NH₄⁺ excretion and a renal cause.
What the result means
The UAG is used almost exclusively in the workup of a NAGMA guide — a metabolic acidosis in which the serum anion gap is normal. Once you have established that the acidosis is hyperchloremic (normal anion gap), the UAG answers the next question: is the kidney doing its job? The table below summarizes the three interpretive bands.
| Urine anion gap | Interpretation | Clinical implication |
|---|---|---|
| ≤ −20 | Negative — extra-renal (GI) cause | The kidney is appropriately excreting NH₄⁺. The acid load is coming from outside the kidney — most commonly diarrhea, fistulae, or ileal conduit. |
| −20 to +20 | Indeterminate | Volume depletion, mixed disorders, or low urine sodium (< 25 mEq/L) making the UAG unreliable. Consider the urine osmolar gap instead. |
| ≥ +20 | Positive — renal cause | Impaired renal ammonium excretion — distal (type 1) or proximal (type 2) renal tubular acidosis, or renal failure. |
The calculation assumes the kidney is actually delivering solute to the urine. In volume depletion, distal Na⁺ delivery falls (U-Na⁺ < 25 mEq/L), NH₄⁺ excretion is limited by the lack of distal sodium to exchange for, and the UAG may read falsely positive even when the kidney is "trying" to excrete ammonium. In that setting, the urine osmolar gap (a more direct NH₄⁺ estimate) is preferred. Also note: a UAG cannot be interpreted in the presence of ketoacidosis or toluene intoxication, where unmeasured urinary anions (ketones, hippurate) accompany NH₄⁺ and drive the UAG positive despite an appropriate renal response.
This calculator runs entirely in your browser — no values are transmitted or stored. Reference logic is reviewed against StatPearls and LITFL. Results are informational only and should always be interpreted in full clinical context by a qualified clinician.