Urine Anion Gap Calculator

Urine anion gap-30 mEq/L
Measured cations (Na + K)55 mEq/L
InterpretationNegative — the kidneys are excreting ammonium appropriately
How this was calculated
  1. The urine anion gap is the measured cations minus the measured chloride: (sodium + potassium) - chloride. Here that is (25 + 30) - 85 = -30 mEq/L.
  2. Chloride is the giveaway: the kidney excretes acid as ammonium chloride, so when ammonium excretion is working, urinary chloride rises above sodium plus potassium and the gap turns negative.
  3. The measured cations sum to 55 mEq/L against 85 mEq/L of chloride. Negative — the kidneys are excreting ammonium appropriately.
  4. The test earns its keep in a normal-anion-gap metabolic acidosis: a negative urine anion gap points at the gut (diarrhoea losing bicarbonate), a positive one at the kidney's own acid handling, as in distal renal tubular acidosis.
  5. Caveats: the gap misleads when the urine holds unusual anions (ketones, salicylate, some antibiotics) or when sodium excretion is very low — it is a bedside estimate of ammonium excretion, not a measurement of it.

The urine anion gap calculator computes a single number from three urine electrolytes: sodium, potassium and chloride, all in mEq/L. The formula is (urine sodium + urine potassium) minus urine chloride. For example, sodium 25, potassium 30 and chloride 85 mEq/L give a urine anion gap of -30 mEq/L. The result is a bedside estimate of urinary ammonium excretion. The kidney excretes acid as ammonium chloride, so active ammonium excretion pushes chloride up and the gap negative. Its main use is sorting a normal-anion-gap metabolic acidosis: a negative gap points to gastrointestinal bicarbonate loss, while a positive gap points to a renal cause such as distal renal tubular acidosis. The estimate misleads when the urine contains unusual anions such as ketones or salicylate, or when sodium excretion is very low.

The underlying method is the accepted standard for this kind of calculation because it relies on the directly measured urine electrolytes that accompany ammonium chloride excretion, so the arithmetic tracks the acid the kidney is clearing without a separate ammonium measurement. This page shows the formula, step-by-step workings, worked examples and sources, so you can check each number yourself rather than trusting a black box. That transparency matters with an estimate this easy to misread: knowing exactly how sodium, potassium and chloride combine, and where the ketone, salicylate and low-sodium caveats apply, keeps the interpretation tied to the patient in front of you.

Worked examples

Primary result: -30 mEq/L

Primary result: -30 mEq/L — High chloride pulls the gap negative — ammonium excretion is working. (25 · 30 · 85)

Urine anion gap-30 mEq/L
Measured cations (Na + K)55 mEq/L
InterpretationNegative — the kidneys are excreting ammonium appropriately

Primary result: 20 mEq/L

Primary result: 20 mEq/L — A positive gap points at the kidney's own acid handling. (40 · 25 · 45)

Urine anion gap20 mEq/L
Measured cations (Na + K)65 mEq/L
InterpretationPositive — ammonium excretion is impaired; a renal cause is likely

Primary result: 0 mEq/L

Primary result: 0 mEq/L — Cations and chloride exactly balance. (60 · 40 · 100)

Urine anion gap0 mEq/L
Measured cations (Na + K)100 mEq/L
InterpretationZero — a borderline result; read it with the urine pH

What the urine anion gap tells you

The urine anion gap is a small piece of arithmetic — (urine sodium + urine potassium) minus urine chloride, all in mEq/L — that opens an indirect window on how much ammonium the kidney is excreting. The kidney disposes of acid largely by making ammonium and pairing it with chloride, so ammonium chloride leaves the body in the urine. That means the harder the kidney works to excrete acid, the more chloride it puts into the urine, and the more negative the gap becomes. A urine anion gap calculator turns three routine electrolyte values into that estimate at the bedside, without waiting for a direct ammonium measurement.

A worked check shows how the numbers behave. If urine sodium is 25 mEq/L, urine potassium is 30 mEq/L and urine chloride is 85 mEq/L, the sodium-plus-potassium total is 55 mEq/L. Subtracting 85 gives a urine anion gap of -30 mEq/L. The chloride has clearly outrun the two cations measured, and that surplus is the fingerprint of ammonium chloride in the sample. In this way chloride is the giveaway: it is the anion that travels with ammonium, so a rising urine chloride relative to sodium and potassium is what drives the gap downward.

Its main use is sorting a normal-anion-gap metabolic acidosis — the situation where acid has accumulated but the usual gap calculation looks unremarkable, so the question becomes whether the kidney is responding appropriately. A negative urine anion gap points to gastrointestinal bicarbonate loss, where the kidney is doing its job and pumping out ammonium chloride. A positive urine anion gap points to a renal cause, such as distal renal tubular acidosis, where the kidney is failing to excrete acid as ammonium and the urine chloride stays low. The result is an estimate of urinary ammonium excretion, not a direct measurement, and it belongs inside the acidosis workup alongside the history, the serum electrolytes and the rest of the acid-base picture.

The test misleads in predictable ways. When the urine contains unusual anions such as ketones or salicylate, those anions take the place of chloride and the gap can look positive even though ammonium excretion is high. When sodium excretion is very low, the arithmetic also loses its footing, because the measured sodium and potassium no longer reflect the urine's full cation content. Read the result with those limits in mind, and treat it as one clue in the workup rather than a verdict on its own.

Urine anion gap = (urine sodium + urine potassium) − urine chloride, in mEq/L. Example: 25 + 30 − 85 = −30 mEq/L.

How to calculate the urine anion gap

To calculate the urine anion gap, add the urine sodium and urine potassium concentrations, then subtract the urine chloride concentration: urine anion gap = (urine sodium + urine potassium) − urine chloride. All three values must be in the same units, milliequivalents per liter (mEq/L), so the arithmetic stays consistent. A urine anion gap calculator simply performs this subtraction once you enter the three numbers, but the formula is easy enough to do by hand at the bedside and is worth understanding before you rely on the result.

Here is a worked check you can use to confirm your setup. Suppose the urine sodium is 25 mEq/L, the urine potassium is 30 mEq/L and the urine chloride is 85 mEq/L. Adding sodium and potassium gives 55 mEq/L, and subtracting chloride gives 55 − 85 = −30 mEq/L. That negative result is the expected pattern when the kidney is excreting ammonium chloride: because the kidney excretes acid as ammonium chloride, working ammonium excretion pushes chloride up and drives the gap negative. A positive example works the same way in reverse — if sodium is 40 mEq/L and potassium is 20 mEq/L, the sum is 60 mEq/L, and if chloride is only 30 mEq/L the gap is +30 mEq/L, a positive value that suggests ammonium excretion is not keeping pace.

The reason the number matters is that the gap is a bedside estimate of urinary ammonium excretion. Its main use is sorting a normal-anion-gap metabolic acidosis: a negative gap points to gastrointestinal bicarbonate loss, while a positive gap points to a renal cause such as distal renal tubular acidosis. Keeping the units in mEq/L and checking your arithmetic against the −30 mEq/L example above helps you trust the direction of the result before you interpret it.

The gap misleads when the urine contains unusual anions such as ketones or salicylate, or when sodium excretion is very low. In those situations the arithmetic still works, but the number no longer reflects ammonium excretion the way it usually does, so treat a surprising result with caution rather than as a final answer.

  • Formula: (urine sodium + urine potassium) − urine chloride, all in mEq/L
  • Worked check: 25 + 30 − 85 = −30 mEq/L
  • Positive example: 40 + 20 − 30 = +30 mEq/L
  • Negative gap suggests gastrointestinal bicarbonate loss; positive gap suggests a renal cause such as distal renal tubular acidosis
  • Unusual urine anions (ketones, salicylate) or very low sodium excretion can make the result misleading
Run the −30 mEq/L worked check first: if your numbers don't reproduce it, recheck the units before interpreting the gap.

Negative vs positive urine anion gap

A urine anion gap calculator gives you a single number, and that number's sign is the point. The formula is (urine sodium + urine potassium) minus urine chloride, all in mEq/L. A worked check: sodium 25, potassium 30 and chloride 85 mEq/L give a urine anion gap of -30 mEq/L. Because the gap is a bedside estimate of urinary ammonium excretion, a negative result and a positive result tell you different stories about why the body is holding onto acid.

A negative gap is the appropriate renal response. The kidney excretes acid as ammonium chloride, so working ammonium excretion pushes chloride up and the gap negative. When a normal-anion-gap metabolic acidosis comes with a negative urine anion gap, the kidneys are doing their job and the acid problem is probably upstream — gastrointestinal bicarbonate loss is the classic example. In that setting, the next place to look is the gut.

A positive gap points the other way. Here ammonium excretion appears impaired, chloride is not rising enough to pull the gap negative, and the problem sits in the kidney. For a normal-anion-gap metabolic acidosis, a positive urine anion gap suggests a renal cause such as distal renal tubular acidosis. The main use of this test is exactly this sorting step: negative points to gastrointestinal bicarbonate loss, positive to a renal cause.

The zero or borderline case deserves its own pause. A gap near zero does not cleanly separate the two categories, so treat it as inconclusive rather than as evidence for either side, and bring in urine pH and the rest of the clinical picture before you commit. Urine pH is a useful companion because it shows whether the urine is being acidified, which the gap alone does not tell you.

The test also misleads when the urine contains unusual anions such as ketones or salicylate, or when sodium excretion is very low. In those situations the arithmetic still runs, but the number no longer reflects ammonium excretion reliably, so a urine anion gap calculator should be read as a clue to confirm, not a verdict on its own.

  • Negative gap: appropriate renal response — look at the gut (gastrointestinal bicarbonate loss).
  • Positive gap: impaired ammonium excretion — look at the kidney (for example, distal renal tubular acidosis).
  • Zero or borderline: inconclusive; use urine pH and the clinical picture alongside it.
  • Misleading when urine contains ketones or salicylate, or when sodium excretion is very low.
Remember the direction: ammonium chloride excretion raises urine chloride, which drives the gap negative. A negative gap means the kidney is responding; a positive gap means it is not.

Limitations of the urine anion gap

The urine anion gap is a convenience, not a measurement. It is calculated as (urine sodium + urine potassium) minus urine chloride, all in mEq/L, and it works only because the arithmetic leaves a residue that usually reflects ammonium. As a worked check, sodium 25, potassium 30 and chloride 85 mEq/L give a urine anion gap of -30 mEq/L. That negative number is the expected signature of acid excretion: the kidney excretes acid as ammonium chloride, so working ammonium excretion pushes chloride up and the gap negative. The trouble is that the gap is an inference from three electrolytes, and anything else in the urine that carries a charge can quietly change the answer.

The clearest failures come from unmeasured anions. The formula assumes the only meaningful anions are chloride and the ammonium pair. When the urine contains unusual anions such as ketones or salicylate, those anions are counted on neither side, and the gap shifts in a direction that has nothing to do with ammonium excretion. A clinician using a urine anion gap calculator at the bedside may then read a negative or positive value as evidence about acid handling when the urine is simply carrying a different anion load. In these situations a direct ammonium measurement is preferred, because it reports the quantity the gap is only trying to estimate.

Low sodium states create a second problem. The gap misleads when sodium excretion is very low, since the sodium term shrinks and the arithmetic becomes dominated by potassium and chloride. Volume depletion is the common setting: the kidney conserves sodium avidly, urine sodium falls, and the calculated gap can look abnormal even when ammonium excretion is appropriate. The same caution applies whenever the urine sodium is very low for any reason. In such cases, and whenever unmeasured anions are suspected, a urine osmolal gap is often preferred as an alternative estimate, or a direct ammonium measurement can settle the question.

These limitations matter most because of how the test is used. Its main use is sorting a normal-anion-gap metabolic acidosis: negative points to gastrointestinal bicarbonate loss, positive to a renal cause such as distal renal tubular acidosis. That is a narrow question, and the answer is only as good as the assumption that sodium, potassium, chloride and ammonium are the ions that matter. When that assumption fails, the gap can point the wrong way with apparent confidence.

A practical reading is to treat the urine anion gap as a first-pass estimate and to check its assumptions before acting on it. If the urine sodium is very low, if ketones or salicylate may be present, or if the result does not fit the clinical picture, move to a direct ammonium measurement or a urine osmolal gap rather than forcing an interpretation onto the gap. The calculation remains useful and quick, but it is a bedside estimate of urinary ammonium excretion, not a substitute for measuring it.

  • Unmeasured anions such as ketones or salicylate can shift the gap without any change in ammonium excretion.
  • Very low sodium excretion, as in volume depletion, distorts the arithmetic and can make the gap misleading.
  • When these conditions apply, a direct ammonium measurement or a urine osmolal gap is preferred.
The urine anion gap is a bedside estimate of urinary ammonium excretion — not a direct measurement. If urine sodium is very low or unusual anions are present, confirm with a direct ammonium measurement or a urine osmolal gap.

FAQs

What is a normal urine anion gap?

In a patient without acidosis, the urine anion gap is usually slightly positive, roughly +20 to +90 mEq/L on a typical diet. Interpretation happens in the acidosis context, where a negative value is the appropriate response. So a positive number on its own does not signal a problem unless acidosis is present.

What does a negative urine anion gap mean?

A negative urine anion gap means the kidneys are excreting ammonium appropriately. With ammonium handling intact, a normal-gap acidosis is likely coming from the gut — classically diarrhea. In that setting, the kidneys are responding correctly and the acid load is being lost through the gastrointestinal tract rather than retained.

What does a positive urine anion gap mean in acidosis?

In acidosis, a positive urine anion gap means ammonium excretion is impaired. That points at the kidney itself rather than the gut. Distal renal tubular acidosis is the textbook cause: the kidney fails to excrete ammonium as it should, so the gap stays positive when a negative result would be expected.

How is the urine anion gap different from the serum anion gap?

The serum anion gap uses blood electrolytes to classify acidosis. The urine anion gap uses urine electrolytes to find the cause once the acidosis has a normal serum gap. In other words, the serum test tells you what kind of acidosis is present; the urine test helps identify why, once the serum gap is normal.

When is the urine anion gap unreliable?

The urine anion gap is unreliable when unusual anions are in the urine, such as ketones, salicylate, or some antibiotics, or when urinary sodium is very low. In those situations, the urine osmolal gap is the better estimate, because the extra anions or low sodium distort the calculated gap.

Do I need a 24-hour urine collection?

No. A spot urine sample's sodium, potassium, and chloride are enough for the calculation. You do not need to collect urine over a full day to get a usable urine anion gap. A single spot specimen gives the values the formula requires.

Sources

Related calculators

Anion Gap Calculator
The serum anion gap from sodium, chloride and bicarbonate — with the potassium-inclusive figure and the albumin correction that unmasks hidden gaps.
Corrected Calcium Calculator
Payne's formula adjusts a measured serum calcium for albumin, so a low protein level does not hide the calcium the body actually sees. Educational use only.
Serum Osmolality Calculator
Calculated serum osmolality from sodium, glucose and BUN — with effective osmolality and the osmolar gap when you have a measured value. Educational use only.
eGFR Calculator (CKD-EPI 2021)
Estimated glomerular filtration rate from creatinine, age and sex using the race-free 2021 CKD-EPI equation — with the KDIGO GFR category.