This calculator is for general information and education. It is not medical advice and does not replace the judgment of a doctor, nurse or pharmacist who knows the full clinical picture.
Why look at urine electrolytes?
In a normal anion gap (hyperchloremic) metabolic acidosis, the two main causes are bicarbonate loss from the gut, as in diarrhea, and a failure of the kidney to excrete acid, as in renal tubular acidosis (RTA). The kidney excretes acid mainly as ammonium (NH4+), which is rarely measured directly. The urine anion gap and the urine osmolal gap estimate it.
The urine anion gap
Urine anion gap = urine Na + urine K − urine Cl
Ammonium is excreted with chloride. When the kidney excretes a lot of ammonium, chloride exceeds sodium plus potassium and the gap becomes negative.
- Negative gap (often −20 to −50): high ammonium excretion, an appropriate renal response. Points to a non-renal cause, mostly diarrhea.
- Positive gap: low ammonium excretion despite acidosis. Points to distal (type 1) RTA, type 4 RTA (hypoaldosteronism) or kidney failure.
The urine osmolal gap
The urine anion gap fails when other anions are excreted (ketones, hippurate from toluene, drugs) or when urine sodium is very low. The urine osmolal gap is more robust:
Osmolal gap = measured urine osmolality − (2 × (Na + K) + urea + glucose), all in mmol/L
Estimated urine ammonium ≈ osmolal gap ÷ 2. A gap of 100 mOsm/kg or more means adequate ammonium excretion; under 40 suggests impaired excretion. Urea nitrogen in mg/dL is divided by 2.8 and glucose in mg/dL by 18 to convert to mmol/L.
Example
Urine sodium 40, potassium 30 and chloride 90 mmol/L give a urine anion gap of −20, a negative value. With a urine osmolality of 500 mOsm/kg and a urea nitrogen of 600 mg/dL (214 mmol/L), the calculated osmolality is 354 and the osmolal gap 146, so the estimated ammonium is 73 mmol/L: the kidney is responding well, consistent with diarrhea.
Pitfalls
- Only valid in a normal anion gap acidosis.
- Urine must be collected before large volumes of saline or bicarbonate are given.
- Volume depletion with urine sodium under about 20 mmol/L makes the anion gap unreliable.
The result guides further tests, such as urine pH, potassium and aldosterone, and is interpreted by the treating team.