Urine Anion Gap Calculator

Calculate the Urine Anion Gap (UAG) to help differentiate renal from extra-renal causes of non-anion-gap metabolic acidosis. The UAG serves as an indirect estimate of urinary ammonium (NH4+) excretion.

URINE ANION GAP
--
< -50-200+20> +40
UAG Value
--
Interpretation
--
Likely Cause Category
--
Urinary NH4+ Estimate
--

What is the Urine Anion Gap?

The Urine Anion Gap (UAG) is a clinical tool used to indirectly assess the kidney's ability to excrete ammonium (NH4+) in the urine. It is most commonly used to differentiate between renal and extra-renal causes of non-anion-gap metabolic acidosis (NAGMA).

Ammonium is the primary buffer for acid excretion in the urine. In metabolic acidosis, the kidneys should increase ammonium excretion to compensate. NH4+ is excreted with chloride (Cl) as the accompanying anion. Since ammonium is not routinely measured in urine, the UAG provides an indirect estimate: a more negative UAG suggests higher urinary ammonium (appropriate renal response), while a positive UAG suggests low urinary ammonium (renal impairment in acid excretion).

UAG Formula

UAG = (Urine Na+ + Urine K+) − Urine Cl

The measured cations (Na+ and K+) and the measured anion (Cl) are the major electrolytes in urine. The "gap" represents unmeasured ions. In the setting of acidosis, the major unmeasured cation is ammonium (NH4+), which is excreted with Cl. When NH4+ excretion is high, Cl rises disproportionately, making the UAG negative.

Interpretation Guide

UAG ValueInterpretationUrinary NH4+Likely Cause
Positive (0 to +20 mEq/L)Low urinary ammonium excretionLowRenal cause: Type 1 (distal) RTA or Type 4 RTA
Negative (-20 to -50 mEq/L)Appropriate increase in urinary ammoniumHighExtra-renal cause: diarrhea, GI losses, ureteral diversion
Very Negative (< -50 mEq/L)Markedly elevated urinary ammoniumVery HighSevere extra-renal loss (e.g., cholera, severe diarrhea)

UAG Interpretation Diagram

Urine Anion Gap: Clinical Decision Algorithm Non-Anion-Gap Metabolic Acidosis Calculate UAG Negative UAG High NH4+ (appropriate response) Extra-Renal Cause Diarrhea, GI bicarbonate loss, ureteral diversion, external drainage Positive UAG Low NH4+ (impaired renal excretion) Renal Cause Type 1 (distal) RTA, Type 4 RTA (hypoaldosteronism)

Non-Anion-Gap Metabolic Acidosis

Non-anion-gap metabolic acidosis (NAGMA), also known as hyperchloremic metabolic acidosis, occurs when bicarbonate (HCO3) is lost from the body or the kidneys fail to regenerate bicarbonate. The serum anion gap remains normal (8–12 mEq/L) because chloride rises to replace lost bicarbonate, maintaining electroneutrality.

Common causes of NAGMA include:

  • GI bicarbonate loss: Diarrhea (most common), pancreatic fistula, ureterosigmoidostomy, cholestyramine use
  • Renal tubular acidosis (RTA): Types 1, 2, and 4
  • Dilutional acidosis: Excessive normal saline administration
  • Carbonic anhydrase inhibitors: Acetazolamide, topiramate
  • Early uremic acidosis: Before the anion gap rises
  • Ureteral diversion: Ileal conduit or ureterosigmoidostomy

The UAG helps distinguish between GI losses (negative UAG) and renal causes (positive UAG) of NAGMA.

Renal Tubular Acidosis Types

FeatureType 1 (Distal)Type 2 (Proximal)Type 4 (Hyperkalemic)
DefectImpaired distal H+ secretionImpaired proximal HCO3 reabsorptionAldosterone deficiency/resistance
Serum K+Low/NormalLow/NormalHigh
Urine pH> 5.5 (cannot acidify)< 5.5 (once threshold reached)< 5.5
UAGPositivePositive (or variable)Positive
Serum HCO3< 10 mEq/L (severe)12–20 mEq/L (milder)15–20 mEq/L (mild)
NephrocalcinosisCommonUncommonUncommon
Common CausesSjögren's, SLE, amphotericin BFanconi syndrome, acetazolamide, myelomaDiabetes (hyporeninemic), ACEi/ARBs, NSAIDs, TMP-SMX

Urine Osmolar Gap Comparison

The Urine Osmolar Gap (UOG) is an alternative method for estimating urinary ammonium excretion and is considered more reliable than the UAG in certain situations:

UOG = Measured Urine Osm − Calculated Urine Osm
Calculated Urine Osm = 2 × (Na+ + K+) + (Urea / 2.8) + (Glucose / 18)
Estimated NH4+ ≈ UOG / 2
ParameterUrine Anion GapUrine Osmolar Gap
What it estimatesNH4+ excretion (indirect)NH4+ excretion (indirect, more accurate)
Inputs neededUrine Na, K, Cl onlyUrine Na, K, urea, glucose + measured osmolality
LimitationsUnreliable with ketonuria, lithium, large amounts of other unmeasured anionsUnreliable with ethanol, methanol, ethylene glycol in urine
Result suggesting high NH4+Negative UAG (< 0)UOG > 400 mOsm/kg (estimated NH4+ > 200)

The UOG is preferred over the UAG when there is significant ketonuria (as in DKA) or when the UAG result is ambiguous, because beta-hydroxybutyrate and acetoacetate are unmeasured anions that can falsely elevate the UAG.

Worked Example

A patient with diarrhea has the following urine electrolytes: Na+ = 40 mEq/L, K+ = 30 mEq/L, Cl = 110 mEq/L.

UAG = (40 + 30) − 110 = 70 − 110 = −40 mEq/L

A UAG of −40 is negative, suggesting appropriately high urinary ammonium excretion. This is consistent with an extra-renal cause of the metabolic acidosis, supporting the clinical diagnosis of diarrhea-related bicarbonate loss. The kidneys are responding normally by increasing ammonium excretion.

Contrasting Example: Distal RTA

A patient with suspected distal RTA has: Na+ = 60 mEq/L, K+ = 25 mEq/L, Cl = 50 mEq/L.

UAG = (60 + 25) − 50 = 85 − 50 = +35 mEq/L

A positive UAG of +35 suggests low urinary ammonium excretion, pointing to a renal cause of the acidosis. Combined with the clinical picture, this is consistent with Type 1 (distal) renal tubular acidosis.

Frequently Asked Questions

When should I use the UAG?

Use the UAG when a patient has a non-anion-gap metabolic acidosis (NAGMA) and you need to determine whether the cause is renal or extra-renal. It is most useful when the etiology is not clinically obvious.

Is a UAG of zero significant?

A UAG near zero is indeterminate and may not reliably distinguish between renal and extra-renal causes. In this situation, consider measuring the urine osmolar gap for a more accurate estimate of urinary ammonium, or correlate with clinical context.

Can the UAG be used in diabetic ketoacidosis (DKA)?

The UAG is unreliable in DKA because ketone bodies (beta-hydroxybutyrate and acetoacetate) are unmeasured anions excreted in the urine, which can make the UAG falsely positive or less negative. In patients with ketonuria, use the urine osmolar gap instead.

What is the difference between serum anion gap and urine anion gap?

The serum anion gap [Na+ - (Cl + HCO3)] identifies the type of metabolic acidosis (anion-gap vs. non-anion-gap). The urine anion gap is used specifically within non-anion-gap metabolic acidosis to determine whether the cause is renal or extra-renal.

Does the UAG work in patients with renal failure?

In advanced renal failure (CKD stages 4–5), the kidneys have globally impaired function and reduced ammonia production regardless of the underlying cause. The UAG may be positive in these patients even without classic RTA. Clinical interpretation should account for the patient's overall renal function.