For healthcare professionals
Urine Anion Gap Calculator
The urine anion gap compares the main cations in urine (sodium and potassium) with the main anion (chloride). In a normal anion gap metabolic acidosis, it gives an indirect sign of how much ammonium the kidney is excreting, which helps separate gastrointestinal bicarbonate loss from a kidney cause. This tool is written for clinicians and is not a diagnosis.
Urine electrolytes
Use sodium, potassium and chloride from the same spot urine sample. Nothing you enter leaves this page.
What you will see
The urine anion gap with the working, and what a negative or positive value means in a normal anion gap metabolic acidosis.
Educational only, not medical advice. Not a diagnosis. Decisions belong to the treating team.
Source
The formula and its reading as printed in the review by Alamilla-Sanchez M and colleagues, Pathophysiology 2025 (section 3.6), and the limit on unmeasured anions from Brunner R and colleagues, Critical Care 2015. Both are open access (CC BY 4.0). The tests check the formula, the sign at exactly zero and that a small non-zero value is never shown as zero.
Validated in
The reading applies to people with a normal anion gap (hyperchloremic) metabolic acidosis. Alamilla-Sanchez 2025 is a narrative review; Brunner 2015 studied adults in an intensive care unit in Austria. Neither validates a cut-off for an outcome.
Limits
The urine anion gap is an indirect estimate of urine ammonium, not a measurement. It is invalidated by increased excretion of unmeasured anions, so in critically ill patients the urine osmolal gap is preferred (Brunner 2015). Chronic respiratory alkalosis can make it positive without a kidney acidification defect (Alamilla-Sanchez 2025). The review gives a normal range of 20 to 100 and writes 'negative (<20)' for gastrointestinal loss; the tool reads only the sign, as its text describes, and gives no reading at exactly zero.
The formula
Urine anion gap = urine sodium + urine potassium - urine chloride (all in mmol/L) (Alamilla-Sanchez 2025).
Worked example: urine sodium 40, potassium 30 and chloride 100 mmol/L give 40 + 30 - 100 = -30 mmol/L, a negative gap.
Reading the result
Normally, the sodium and potassium absorbed from the diet exceed the chloride, so the urine anion gap is positive; the review gives a normal range of 20 to 100 (Alamilla-Sanchez 2025). In a normal anion gap metabolic acidosis:
- Negative: with gastrointestinal losses such as acute diarrhea, the gap becomes negative, because ammonium is excreted with chloride (as ammonium chloride) to keep the urine electrically neutral (Alamilla-Sanchez 2025).
- Positive: when the capacity to excrete ammonium is reduced, as in distal renal tubular acidosis, the gap reflects the diet and stays positive (Alamilla-Sanchez 2025).
Chronic respiratory alkalosis reduces ammonium excretion and can also make the gap positive (Alamilla-Sanchez 2025). The urine osmolal gap, unlike the urine anion gap, is not altered by large amounts of unmeasured anions in the urine (Alamilla-Sanchez 2025) (Brunner 2015).
Related tools
First check the serum gap with the anion gap calculator. When unmeasured urine anions may be present, the urine osmolal gap calculator gives the alternative estimate of urine ammonium. With a high potassium, see the TTKG calculator. In a high anion gap acidosis, the delta ratio calculator looks for a mixed disorder. Other bedside scores are listed under For healthcare professionals.
Sources
- Alamilla-Sanchez M, Alcala Salgado MA, Ulloa Galvan VM, Yanez Salguero V, Yama Estrella MB, Morales Lopez EF, et al. Understanding renal tubular function: key mechanisms, clinical relevance, and comprehensive urine assessment. Pathophysiology. 2025;32(3):33. doi:10.3390/pathophysiology32030033. PMID 40700075. Open access (CC BY 4.0). Section 3.6 (urine anion gap formula and reading). pmc.ncbi.nlm.nih.gov/articles/PMC12285995/
- Brunner R, Drolz A, Scherzer TM, Staufer K, Fuhrmann V, Zauner C, et al. Renal tubular acidosis is highly prevalent in critically ill patients. Crit Care. 2015;19(1):148. doi:10.1186/s13054-015-0890-0. PMID 25888397. Open access (CC BY 4.0). Background (urine osmolal gap, unlike the urine anion gap, is not invalidated by unmeasured anions). pmc.ncbi.nlm.nih.gov/articles/PMC4404695/
Written and maintained by the uncovermyrisk.com editorial team. We do not have a medical reviewer; every claim links to its primary source above. Last reviewed: 2026-11-02. Spotted an error? See About.