Urine Anion Gap Calculator (UAG)
The urine anion gap (UAG) helps clinicians differentiate the cause of non-anion-gap metabolic acidosis. Enter the urine sodium, potassium, and chloride concentrations and the calculator applies the formula UAG = Na + K - Cl, then interprets whether the kidneys are excreting ammonium normally or not. Useful for distinguishing renal tubular acidosis from gastrointestinal bicarbonate loss.
Formula
Worked example
A patient has urine Na+ 50, K+ 30, and Cl- 70 mEq/L. UAG = 50 + 30 - 70 = +10 mEq/L, which falls within the normal range. If the same patient had urine Cl- 120 mEq/L, UAG = 50 + 30 - 120 = -40 mEq/L, suggesting high ammonium excretion and an extrarenal cause such as diarrhea.
What is the urine anion gap?
The urine anion gap (UAG) is a calculated estimate of unmeasured urinary anions minus unmeasured urinary cations. Because the major unmeasured urine cation is ammonium (NH4+), the UAG serves as a surrogate for urine ammonium concentration. Ammonium is produced by the kidneys as part of their acid-excretion function: when the body is acidotic, healthy kidneys ramp up ammonium synthesis and secretion to excrete more acid. A high ammonium level makes urine chloride rise relative to sodium plus potassium, driving the UAG negative. A positive or normal UAG in the setting of metabolic acidosis suggests the kidneys are not excreting ammonium normally.
Clinical use: differentiating causes of non-anion-gap metabolic acidosis
Non-anion-gap metabolic acidosis (also called hyperchloremic metabolic acidosis) has two broad categories of cause: renal and extrarenal. In extrarenal causes such as diarrhea or intestinal fistulas, bicarbonate is lost through the gut rather than the kidneys. The kidneys respond normally by excreting large amounts of ammonium, which pushes urine chloride up and makes the UAG strongly negative (below -10 mEq/L). In renal causes such as distal renal tubular acidosis (type 1 RTA) or hypoaldosteronism, the kidney cannot excrete ammonium properly, so urine ammonium stays low. This leads to a positive or near-zero UAG (above +20 mEq/L). The UAG therefore helps point the clinician toward the right workup without requiring direct measurement of urine ammonium, which is not routinely available in many labs.
Limitations and caveats
The UAG is most reliable when urine sodium is above 25 mEq/L. When urine sodium is very low, sodium reabsorption in the collecting duct may limit chloride co-transport, causing a falsely positive (or less negative) UAG. The test is also less useful in the presence of other unmeasured urinary anions: ketoacids in diabetic ketoacidosis, hippurate in toluene ingestion, and d-lactate can all elevate the apparent UAG without reflecting impaired ammonium excretion. In these situations the urine osmol gap is a better measure of ammonium excretion. For most common clinical scenarios, the UAG is a quick and practical first-line calculation. Always interpret results alongside serum bicarbonate, blood pH, serum potassium, urine pH, and clinical context.
Renal tubular acidosis subtypes
Type 1 (distal) RTA is the most common form associated with a high UAG. The distal collecting duct fails to secrete hydrogen ions, so the urine pH cannot fall below 5.5 and ammonium excretion is impaired. It typically causes hypokalemia and nephrocalcinosis. Type 2 (proximal) RTA arises from bicarbonate wasting in the proximal tubule; the UAG may be positive when plasma bicarbonate is low, but can normalise as the bicarbonate threshold is re-established. Type 4 RTA results from hypoaldosteronism (from Addison disease, diabetes, or certain medications) and causes hyperkalemia with a positive UAG. Knowing the UAG pattern alongside serum potassium and urine pH helps distinguish these subtypes.
Urine Anion Gap interpretation
| UAG (mEq/L) | Interpretation | Likely cause | Urinary NH4+ |
|---|---|---|---|
| Below -10 | Negative (extrarenal) | Diarrhea, GI bicarbonate loss | High |
| -10 to +20 | Normal range | No acidosis, or mixed picture | Normal |
| Above +20 | Positive (renal) | Renal tubular acidosis, hypoaldosteronism | Low |
Reference ranges used to interpret the UAG in the context of non-anion-gap metabolic acidosis.
Frequently asked questions
What is a normal urine anion gap?
In healthy adults the UAG is typically between -10 and +20 mEq/L. The "normal" value is actually slightly positive because the body maintains a small baseline excess of unmeasured anions over unmeasured cations in urine. In the absence of acid-base disturbances, values in this range are expected.
Why is a negative UAG associated with diarrhea?
Diarrhea causes bicarbonate loss through the gut, triggering metabolic acidosis. In response, the kidneys increase ammonium synthesis and excretion. Ammonium is a positively charged cation that is excreted alongside chloride. This raises urine chloride significantly relative to the measured cations (sodium + potassium), making the calculated UAG strongly negative. A UAG below -10 mEq/L in a patient with metabolic acidosis strongly suggests this kind of gastrointestinal bicarbonate loss.
Should I use a spot urine or a 24-hour collection?
Spot urine samples are most commonly used in clinical practice and are what most published interpretive thresholds are based on. A 24-hour urine collection can be used for more detailed assessment of daily electrolyte excretion, but the UAG formula and its clinical cutoffs (-10 to +20 mEq/L) are typically applied to spot samples expressed in mEq/L.
What is the difference between urine anion gap and urine osmol gap?
Both estimate urine ammonium, but by different approaches. The UAG uses electrolytes (Na, K, Cl) and is simpler to calculate. The urine osmol gap subtracts the measured osmolality from a calculated osmolality and is more reliable when unmeasured anions are present (ketoacids, d-lactate, hippurate), which can falsely elevate the UAG. In those situations, use the osmol gap; in straightforward non-anion-gap acidosis, the UAG works well.
Can the UAG be used when the patient has hyperkalemia?
Yes. In type 4 RTA from hypoaldosteronism, the UAG is typically positive with concurrent hyperkalemia. This pattern, a high UAG plus elevated serum potassium and mild acidosis, points toward aldosterone deficiency or resistance (Addison disease, diabetic hypoaldosteronism, or certain medications like ACE inhibitors, ARBs, and potassium-sparing diuretics).