Anion Gap Calculation

AG = Na⁺ − (Cl⁻ + HCO₃⁻)

The anion gap measures the difference between blood cations and anions to identify metabolic acidosis. Enter your electrolyte values below for instant clinical interpretation.

Calculate Your Anion Gap

Enter your electrolyte values to get instant results with clinical interpretation and visual feedback.

Electrolyte Values

All values in mEq/L (mmol/L)

Results

Enter values and click Calculate to see your results

Anion Gap Formula & Calculation

The anion gap formula is straightforward. You need three lab values from a basic metabolic panel.

Standard Formula

AG = Na⁺ − (Cl⁻ + HCO₃⁻)

This is the most widely used version. It subtracts the two major measured anions (chloride and bicarbonate) from the major measured cation (sodium). Most labs and textbooks default to this formula.

Adjusted Anion Gap

AG = (Na⁺ + K⁺) − (Cl⁻ + HCO₃⁻)

Some clinicians include potassium. Because potassium levels are small (3.5–5.0 mEq/L) and tightly regulated, this version rarely changes the clinical picture. The normal range shifts to 10–20 mEq/L when potassium is included.

Step-by-Step Calculation

1
Get your lab values. You need serum sodium (Na⁺), chloride (Cl⁻), and bicarbonate (HCO₃⁻) from a basic metabolic panel.
2
Add the anions. Add chloride and bicarbonate together. For example: 104 + 24 = 128 mEq/L.
3
Subtract from sodium. Take sodium minus the sum. For example: 140 − 128 = 12 mEq/L.
4
Compare to normal. A result of 8–12 mEq/L is normal. Above 12 suggests high anion gap metabolic acidosis. Below 8 may point to hypoalbuminemia or lab error.

Live Calculation Preview

This updates in real-time as you change the electrolyte values in the calculator above.

What is Anion Gap?

The anion gap is a calculated value from routine blood work that tells clinicians about the balance of charged particles in the blood.

Definition

The anion gap represents the difference between positively charged ions (cations) and negatively charged ions (anions) that are routinely measured in the blood. In a healthy person, this gap is made up of unmeasured anions — proteins like albumin, phosphate, sulfate, and organic acids.

The body always maintains electrical neutrality. Total cations must equal total anions. But standard lab panels only measure some of them. The anion gap fills in what the labs don't directly report.

Clinical Importance

Doctors order the anion gap when they suspect acid-base problems. It helps answer a specific question: is there an excess of unmeasured acids in the blood? A high anion gap points to conditions like diabetic ketoacidosis, lactic acidosis, or toxic ingestions. A normal anion gap with acidosis suggests chloride-related problems like diarrhea or renal tubular acidosis.

Na⁺ (Sodium)
K⁺ (Potassium)
Cl⁻ (Chloride)
HCO₃⁻ (Bicarbonate)
Anion Gap

Anion Gap Normal Range

Normal values depend on the formula used and can vary slightly between laboratories.

Normal Values

The standard anion gap (without potassium) normally falls between 8 and 12 mEq/L. When potassium is included in the corrected formula, the normal range is 10 to 20 mEq/L.

These numbers assume a normal serum albumin of about 4 g/dL. Each 1 g/dL drop in albumin lowers the anion gap by roughly 2.5 mEq/L. So a patient with an albumin of 2 g/dL might have a "normal" AG of only 3–7 mEq/L — which could mask a true elevation.

Variations

Different labs may report slightly different reference ranges based on their analyzers and local population data. Some institutions quote 4–12 mEq/L, others 8–16 mEq/L. Always check your lab's specific reference range.

Ion-selective electrode technology in modern analyzers tends to produce slightly different values than older flame photometry methods. When comparing results over time, make sure the same methodology was used.

ElectrolyteSymbolNormal RangeUnitRole in AG
SodiumNa⁺136 – 145mEq/LPrimary measured cation
PotassiumK⁺3.5 – 5.0mEq/LIncluded in corrected formula
ChlorideCl⁻98 – 106mEq/LPrimary measured anion
BicarbonateHCO₃⁻22 – 28mEq/LAcid-base buffer anion
Anion Gap (Standard)AG8 – 12mEq/LNa⁺ − (Cl⁻ + HCO₃⁻)
Anion Gap (Corrected)AGc10 – 20mEq/L(Na⁺ + K⁺) − (Cl⁻ + HCO₃⁻)

Where Does Your AG Fall?

This gauge shows your current anion gap value from the calculator. Change the electrolyte values above to see the needle move.

Anion Gap Interpretation

What different anion gap values mean and what conditions to consider.

Based on your AG of 12.0 mEq/L
🔴

High Anion Gap Causes

AG > 12 mEq/L
  • Diabetic ketoacidosis (DKA)
  • Lactic acidosis (sepsis, shock)
  • Renal failure (uremia)
  • Toxic alcohol ingestion
  • Salicylate overdose
  • Starvation ketoacidosis
🟢

Normal Anion Gap (Hyperchloremic)

AG 8–12 mEq/L with acidosis
  • Diarrhea (GI bicarbonate loss)
  • Renal tubular acidosis (RTA)
  • Normal saline overload
  • Carbonic anhydrase inhibitors
  • Ureteral diversions
  • Addison's disease
🔵

Low Anion Gap Causes

AG < 8 mEq/L
  • Hypoalbuminemia (most common)
  • Multiple myeloma (IgG)
  • Lithium toxicity
  • Bromide ingestion (lab artifact)
  • Hypercalcemia
  • Hypermagnesemia

High Anion Gap Metabolic Acidosis Causes

When the anion gap is elevated, clinicians use mnemonics to recall the differential diagnosis.

MUDPILES Mnemonic

M
Methanol — Metabolized to formic acid. Causes blindness and severe acidosis.
U
Uremia — Kidney failure leads to accumulation of sulfate, phosphate, and organic acids.
D
Diabetic Ketoacidosis — Insulin deficiency causes fat breakdown into ketone bodies.
P
Propylene Glycol — Found in some IV medications. Metabolized to lactic acid.
I
Isoniazid / Iron — Both cause lactic acidosis through different mechanisms.
L
Lactic Acidosis — Most common cause overall. Results from tissue hypoperfusion or mitochondrial dysfunction.
E
Ethylene Glycol — Antifreeze. Metabolized to glycolic and oxalic acid.
S
Salicylates — Aspirin overdose causes a mixed respiratory alkalosis and metabolic acidosis.

GOLDMARK Mnemonic

An alternative to MUDPILES that some clinicians prefer:

G
Glycols (ethylene and propylene)
O
Oxoproline (pyroglutamic acid, from acetaminophen)
L
L-Lactate (most common cause)
D
D-Lactate (short bowel syndrome)
M
Methanol
A
Aspirin (salicylates)
R
Renal failure (uremia)
K
Ketoacidosis (diabetic, alcoholic, starvation)

Clinical Examples

A 45-year-old with diabetes presents with nausea and rapid breathing. Labs show Na⁺ 138, Cl⁻ 100, HCO₃⁻ 10. The anion gap is 138 − (100 + 10) = 28 mEq/L — significantly elevated. Combined with high blood glucose and positive urine ketones, this points to diabetic ketoacidosis.

A 70-year-old with sepsis arrives in shock. Labs show Na⁺ 140, Cl⁻ 102, HCO₃⁻ 14. AG = 140 − (102 + 14) = 24 mEq/L. Serum lactate is 8 mmol/L. The elevated anion gap is driven by lactic acidosis from poor tissue perfusion.

Try a Clinical Scenario

Click a scenario to auto-fill the calculator with real-world lab values and see how the anion gap changes.

Anion Gap Clinical Applications

When and why clinicians order an anion gap calculation.

Indications

The anion gap should be calculated whenever you have a basic metabolic panel (BMP) or comprehensive metabolic panel (CMP) and suspect an acid-base disorder. Common scenarios include:

  • Metabolic acidosis workup — The anion gap is the first step in narrowing the cause of a low bicarbonate.
  • Altered mental status — Toxic ingestions (methanol, ethylene glycol) cause a high AG and require urgent treatment.
  • Diabetic emergencies — Monitoring the AG during DKA treatment tracks whether ketoacid production is slowing.
  • Sepsis and shock — Lactic acidosis from poor perfusion shows up as a rising anion gap.
  • Renal failure monitoring — As kidney function declines, unmeasured anions accumulate and the AG rises.
  • ICU monitoring — Serial anion gap measurements help track treatment response in critically ill patients.

Diagnostic Decision Tree

This flowchart highlights the active path based on your current lab values from the calculator.

How Anion Gap Works

The physiology behind electrolyte balance and why the anion gap changes in disease.

Anion Gap and Electrolyte Balance

Blood must stay electrically neutral. Every positive charge has a matching negative charge. Standard lab panels measure sodium and potassium on the cation side, and chloride and bicarbonate on the anion side. But they miss many other charged particles — albumin, phosphate, sulfate, and organic acids on the anion side, and calcium, magnesium, and gamma globulins on the cation side.

Because unmeasured anions normally outweigh unmeasured cations, the measured cations always appear to exceed the measured anions. That difference is the anion gap.

Pathophysiology of Anion Gap Disorders

When the body produces excess acid (like lactate or ketoacids), these acids release hydrogen ions. The hydrogen ions consume bicarbonate as a buffer, lowering the HCO₃⁻ level. But the conjugate base (lactate, ketoanion) remains — it becomes an unmeasured anion. The result: bicarbonate drops, unmeasured anions rise, and the anion gap increases.

In non-anion gap acidosis, the story is different. Bicarbonate is lost directly (through the gut or kidneys), and chloride rises to maintain electrical neutrality. The anion gap stays normal because no new unmeasured anions appear.

Interactive Ion Balance

Watch how the unmeasured anion column (the anion gap) grows or shrinks as you change the electrolyte values in the calculator.

Frequently Asked Questions

Answers to common clinical and technical questions about the anion gap.

Subtract the sum of chloride and bicarbonate from sodium: AG = Na⁺ − (Cl⁻ + HCO₃⁻). For example, if Na⁺ is 140, Cl⁻ is 104, and HCO₃⁻ is 24, then AG = 140 − (104 + 24) = 12 mEq/L. Some labs include potassium in the formula, which shifts the normal range to 10–20 mEq/L.
The normal anion gap is 8–12 mEq/L using the standard formula (without potassium). With potassium included, the normal range is 10–20 mEq/L. These values assume a normal albumin level of about 4 g/dL. Low albumin will artificially lower the anion gap, so many clinicians apply an albumin correction.
In uncontrolled diabetes, the body breaks down fat for energy and produces ketone bodies (acetoacetate, beta-hydroxybutyrate). These ketoacids accumulate in the blood, consume bicarbonate, and raise the anion gap. This condition — diabetic ketoacidosis (DKA) — is one of the most common causes of high anion gap metabolic acidosis. Tracking the anion gap during treatment helps monitor whether ketoacid production is slowing down.
Lactic acidosis is the most common cause of a high anion gap in clinical practice. It happens when tissues don't get enough oxygen (sepsis, shock, cardiac arrest) or when mitochondria can't use oxygen properly (certain drugs, toxins). Diabetic ketoacidosis and renal failure are the next most frequent causes.
There's no fixed schedule. The anion gap should be calculated whenever a basic metabolic panel (BMP) is drawn and acidosis is suspected. In the ICU, it may be checked every 4–6 hours during active treatment of DKA or sepsis. For outpatients with stable chronic kidney disease, checking it at routine lab visits (every 3–6 months) is usually enough.
In the ICU, the anion gap serves as a quick bedside tool to detect and track metabolic acidosis. A rising AG may signal worsening sepsis, organ failure, or new toxic exposure. A falling AG during DKA treatment confirms that insulin therapy is working. Pairing the AG with the delta-delta ratio helps identify mixed acid-base disorders that are common in critically ill patients.
Yes, but usually not enough to push it outside the normal range in healthy people. Prolonged fasting or very low-carbohydrate diets can produce mild ketosis, which may slightly raise the anion gap. A high-protein diet increases acid production from amino acid metabolism. These effects are generally small and clinically insignificant in patients with normal kidney function.
The delta anion gap (also called the delta-delta ratio or Δ-Δ) compares how much the anion gap has risen above normal to how much the bicarbonate has fallen below normal: (AG − 12) / (24 − HCO₃⁻). A ratio below 1 suggests a mixed AG and non-AG acidosis. A ratio of 1–2 indicates a pure AG metabolic acidosis. A ratio above 2 suggests a concurrent metabolic alkalosis or pre-existing elevated bicarbonate.