πŸ§ͺ Urine Anion Gap Calculator

Is the acidosis coming from the gut or the kidney?

-

Urine anion gap

For informational purposes only, not medical advice.

Urine anion gap equals urine sodium plus urine potassium, minus urine chloride. With sodium 40, potassium 30, and chloride 90, the gap is -20 mEq/L. A negative gap in metabolic acidosis points to the gut, typically diarrhea, because the kidneys are excreting ammonium appropriately; a positive gap points to the kidney itself, as in distal renal tubular acidosis.

The gap is really an ammonium detector. Ammonium carries a positive charge but is not measured in the basic urine panel, so it hides inside the gap: lots of ammonium excretion drives the gap negative. That single sign, positive or negative, splits the two big families of normal-anion-gap acidosis.

How to Use This Calculator

Enter the three urine electrolytes from a spot urine sample, all in mEq/L. The tool subtracts and interprets the sign for you.

1

Enter urine sodium and urine potassium from the spot sample.

2

Enter urine chloride from the same sample.

3

Read the gap and the interpretation. Use it alongside the serum anion gap, which should be normal for this test to apply.

The Formula

Urine anion gap = (urine Na + urine K) - urine Cl Negative gap: GI bicarbonate loss (kidneys compensating) Positive gap: renal acidification defect (e.g. distal RTA)

Electroneutrality demands that positive and negative charges balance. The measured cations (sodium, potassium) minus the measured anion (chloride) leaves the unmeasured ions, chiefly ammonium, as the difference. In diarrhea, the kidney ramps up ammonium excretion to dump acid, so unmeasured cations are high and the gap goes negative. In distal RTA, the kidney cannot secrete acid properly, ammonium stays low, and the gap stays positive.

This only works for normal-anion-gap (hyperchloremic) metabolic acidosis. In high-anion-gap acidosis from lactate or ketoacids, the urine gap answers a question nobody asked.

Worked Example

A patient has metabolic acidosis with a normal serum anion gap after days of diarrhea. Spot urine shows sodium 40, potassium 30, chloride 90. Add sodium and potassium to get 70, subtract chloride 90, and the urine anion gap is -20 mEq/L.

Negative. The kidneys are excreting plenty of ammonium, doing exactly what they should, which means the bicarbonate loss is extrarenal: the diarrhea. Management targets the gut losses and volume, not the kidney. Had the gap been positive, the same acidosis would have pointed at a tubular defect instead.

Reading Your Result

Urine anion gapLikely meaning
Negative (below 0)GI bicarbonate loss, most often diarrhea. Renal ammonium excretion is intact.
Near zeroIndeterminate. Repeat with a fresh sample and check the clinical context.
Positive (above 0)Impaired renal acid excretion, classic for distal (type 1) RTA.

My take: the gap is a tiebreaker, not a diagnosis. Diarrhea with a positive gap can happen when volume depletion limits ammonium delivery, and the numbers never override the story. Use the sign to aim the workup, then confirm with the full picture.

Limits

The gap assumes ammonium is the main unmeasured ion, which fails with heavy bicarbonaturia, ketoacidosis spilling keto anions, or recent diuretics scrambling the electrolytes. Timing matters too: early in diarrhea, before the kidney ramps up, the gap may not yet be negative. One more wrinkle: it needs a normal serum anion gap to be interpretable, so calculate that first.

Related Tools

Kidney acid handling connects to electrolytes broadly: the TTKG calculator assesses potassium handling, the daily water intake calculator covers the fluid side, and the blood pressure checker tracks what acid-base shifts often accompany.

For informational purposes only, not medical advice. Consult a healthcare professional.

Frequently Asked Questions

What is the urine anion gap?

Urine sodium plus urine potassium minus urine chloride. It estimates unmeasured urinary ammonium: a negative gap means the kidneys are excreting lots of ammonium, while a positive gap means they are not. It helps classify normal-anion-gap metabolic acidosis.

What does a negative urine anion gap mean?

Usually gastrointestinal bicarbonate loss, most commonly diarrhea. The negative sign shows the kidneys are compensating properly by excreting ammonium. The problem is bicarbonate leaving through the gut, not a kidney defect.

What does a positive urine anion gap mean?

Impaired renal acid excretion, classically distal renal tubular acidosis. The kidneys cannot generate enough ammonium despite systemic acidosis, so the gap stays positive. Further workup targets tubular function.

When is the urine anion gap useful?

In normal-anion-gap (hyperchloremic) metabolic acidosis, to separate GI causes from renal causes. It adds little in high-anion-gap acidosis from lactate, ketoacids, or toxins, where the cause is usually evident from other labs.

Can the urine anion gap be misleading?

Yes. Diuretics, bicarbonaturia, ketoacid excretion, and very early diarrhea before compensation can all distort it. It is one clue among many; the clinical story and serum labs carry equal weight.

Do I need a 24-hour urine collection?

No, a spot sample works for the gap. The calculation uses concentrations, not total excretion, which is why it is a convenient bedside test rather than a collection ordeal.

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

Both estimate ammonium, but the osmolal gap uses measured versus calculated osmolality and is considered more reliable when available. The anion gap is simpler, needing only three electrolytes, which is why it remains the bedside default.

What is distal RTA?

Type 1 renal tubular acidosis: the distal tubule cannot secrete hydrogen ions properly, causing persistent metabolic acidosis with an inappropriately alkaline urine pH. The positive urine anion gap reflects the missing ammonium excretion.

Can diarrhea ever give a positive gap?

Occasionally, when severe volume depletion reduces distal delivery so much that the kidney cannot mount the ammonium response yet. Repeat testing after volume repletion usually clarifies. The trend matters more than a single contradictory value.

Who should interpret this result?

A clinician evaluating the metabolic acidosis. The gap is an educational estimate that directs the workup between gut and kidney causes. Acidosis with concerning symptoms warrants prompt medical evaluation.