The Electroneutrality Principle
Every body-fluid compartment must contain exactly as many positive charges as negative charges. This single law of physics — the law of electroneutrality — is the reason the anion gap exists at all.
What is the electroneutrality principle?
The electroneutrality principle states that in any macroscopic aqueous solution — including plasma, interstitial fluid, and intracellular fluid — the sum of all positive charges must equal the sum of all negative charges. There are no "free" charges wandering on their own; for every Na⁺ there is a balancing Cl⁻, HCO₃⁻, protein-bound anion, or other negative counter-ion. Written compactly:
This is not a biological convention but a physical necessity. Biological membranes, proteins, and ion channels all operate on tiny charge separations; a net charge imbalance across a whole compartment would require astronomical voltages that no cell could sustain. The body therefore enforces electroneutrality at every level, and the law of electroneutrality in blood is the foundation on which the entire anion gap concept is built. The anion gap formula Na⁺ − (Cl⁻ + HCO₃⁻) is simply this law rearranged: it isolates the difference between the measured cations and the measured anions, knowing that the remainder must be balanced by ions the routine panel does not measure.
The Gibbs-Donnan equilibrium
The most famous consequence of electroneutrality is the Gibbs-Donnan equilibrium. When a membrane (the capillary wall) separates two compartments and one side holds a non-diffusible charged macromolecule (plasma albumin, which carries a net negative charge), the diffusible ions redistribute so that two conditions hold simultaneously: each compartment remains individually electroneutral, and the electrochemical potential of each diffusible ion is equal across the membrane. The result is a small but measurable asymmetry — slightly more Na⁺ and fewer Cl⁻ in plasma than in interstitial fluid — driven entirely by the impermeant protein. This is why plasma has a marginally higher anion gap than interstitial fluid, and why albumin is the single largest contributor to the normal anion gap (covered in detail on the unmeasured ions page).
Impermeant anions (mostly albumin) on one side of a membrane hold back diffusible cations (Na⁺) and repel diffusible anions (Cl⁻), producing an electroneutral but asymmetric distribution — and a tiny osmotic pressure — across every capillary in the body.
How electroneutrality gives rise to the anion gap
If total cations equal total anions, then subtracting the measured anions from the measured cations should give zero — yet the calculated anion gap is normally 8–12 mEq/L, not zero. The resolution is that the daily clinical formula deliberately omits the "minor" ions. Sodium is the only cation counted, while chloride and bicarbonate are the only anions counted. The uncounted anions (albumin, phosphate, sulfate, organic anions) substantially outnumber the uncounted cations (K⁺, Ca²⁺, Mg²⁺), so the arithmetic answer is a small positive number rather than zero.
That number is precisely unmeasured anions minus unmeasured cations. Rearranging the electroneutrality equation:
So the anion gap is not empty space and not a measurement of any single substance. It is the net charge carried by every ion the routine panel leaves out. When a new acid accumulates — lactate in shock, ketoacids in diabetic ketoacidosis, sulfuric and phosphoric acids in uremia, glycolate and formate after toxic-alcohol ingestion — it is buffered by bicarbonate (which falls) and replaced by the acid's conjugate anion (which rises but is "unmeasured"). Electroneutrality is preserved, but the calculated gap climbs. This is the entire physiological basis for screening metabolic acidosis with the anion gap; you can confirm the arithmetic in seconds with the anion gap calculator.
Why this matters clinically
Because electroneutrality is inviolable, the anion gap is a conservation law in disguise: if unmeasured anions rise, either the measured anions (Cl⁻, HCO₃⁻) must fall or Na⁺ must rise. Two patterns emerge. In high-anion-gap metabolic acidosis, HCO₃⁻ is consumed buffering the new acid while the unmeasured anion takes its place, widening the gap. In hyperchloremic (normal-anion-gap) metabolic acidosis, HCO₃⁻ is lost (diarrhea) or diluted (large-volume normal saline) and replaced by Cl⁻, so the gap stays flat while chloride rises. Electroneutrality explains why these two acid-base patterns look different on the panel despite both having a low bicarbonate.
Reference frameworks: StatPearls "Anion Gap" (Kraut & Madias) and the Life in the Fast Lane (LITFL) acid-base archive present this derivation in full quantitative detail. The Henderson-Hasselbalch and Stewart approaches are both, at root, restatements of electroneutrality under different independent variables.