This document describes the clinical equations, reference ranges, compensation formulas, and validation approach used in the Theracalc Acid-Base Clinical Calculator. All logic executes locally in the user's browser via the TheraIQ engine. No patient data is transmitted to external servers. This document is intended for licensed clinicians, clinical pharmacists, and institutional reviewers.
1 — Anion Gap (AG)
AG = Na⁺ − Cl⁻ − HCO₃⁻
  • Normal range: 8–12 mEq/L (cutoff 12 used; lab reference ranges vary)
  • Elevated AG (>12): suggests unmeasured anion — lactate, ketones, uremic toxins, salicylate, toxic alcohols
  • Normal AG: hyperchloremic metabolic acidosis — consider GI loss, RTA, NS excess
Reference Emmett M, Narins RG. Clinical use of the anion gap. Medicine. 1977;56(1):38–54. Oh MS, Carroll HJ. The anion gap. NEJM. 1977;297(15):814–817.
2 — Albumin-Corrected Anion Gap
Corrected AG = AG + 2.5 × (4.0 − Albuminmeasured)
  • Hypoalbuminemia lowers the AG by approximately 2.5 mEq/L per 1 g/dL drop below 4.0 g/dL
  • Applied automatically when albumin is entered; otherwise raw AG is used
  • Clinical significance: a patient with albumin 2.0 g/dL and AG 14 has a corrected AG of 19 — a true HAGMA that raw AG would miss
Reference Figge J, et al. Serum proteins and acid-base equilibria. J Lab Clin Med. 1991;117(6):453–467. Feldman M, et al. Effect of hypoalbuminemia on the serum anion gap. J Lab Clin Med. 2000.
3 — Delta-Delta Ratio (Δ/Δ)
(Corrected AG − 12) ÷ (24 − HCO₃measured)
Interpretation thresholds
Δ/Δ ValueInterpretation
< 0.4Pure normal-AG (hyperchloremic) metabolic acidosis
0.4 – 1.0Mixed elevated-AG + normal-AG acidosis
1.0 – 2.0Pure elevated-AG metabolic acidosis
> 2.0Elevated-AG acidosis + concurrent metabolic alkalosis
Limitation The Δ/Δ ratio assumes HCO₃ normal baseline of 24 mEq/L and AG normal of 12. In chronic compensated disorders or mixed pre-existing states, the ratio may be misleading. Interpret alongside clinical context.
4 — Primary Disorder Classification
DisorderpHHCO₃PaCO₂
Metabolic Acidosis<7.35<22 mEq/LLow (compensatory)
Metabolic Alkalosis>7.45>26 mEq/LHigh (compensatory)
Respiratory Acidosis<7.35High (compensatory)>45 mmHg
Respiratory Alkalosis>7.45Low (compensatory)<35 mmHg
BMP-only mode When pH and PaCO₂ are not entered, the engine estimates primary disorder from HCO₃ pattern alone and flags all output as provisional pending ABG confirmation.
5 — Expected Compensation Formulas
Metabolic Acidosis — Winters' Formula
Expected PaCO₂ = 1.5 × HCO₃ + 8 ± 2
Metabolic Alkalosis
Expected PaCO₂ = 0.7 × HCO₃ + 21 ± 2
Respiratory Acidosis
Acute: HCO₃ ↑ 1 mEq/L per 10 mmHg ↑ PaCO₂ Chronic: HCO₃ ↑ 3.5 mEq/L per 10 mmHg ↑ PaCO₂
Respiratory Alkalosis
Acute: HCO₃ ↓ 2 mEq/L per 10 mmHg ↓ PaCO₂ Chronic: HCO₃ ↓ 5 mEq/L per 10 mmHg ↓ PaCO₂
Individual variation These are population-derived bedside rules. Individual variation applies. The engine flags inadequate or excessive compensation as a potential mixed disorder requiring further clinical evaluation.
References Winters RW. Terminology of acid-base disorders. Ann Intern Med. 1965;63(5):873–884. Martini WZ, et al. Metabolic acidosis and compensation. Arch Surg. 2007. Albert MS, et al. Quantitative displacement of acid-base equilibrium. Ann Intern Med. 1967.
6 — Urine Anion Gap (UAG)
UAG = uNa⁺ + uK⁺ − uCl⁻
UAGInterpretation
Negative (<−20)High NH₄⁺ excretion — GI bicarbonate loss (diarrhea, ileostomy)
Near zeroIndeterminate
Positive (>0)Low NH₄⁺ excretion — suspect renal tubular acidosis
Context-sensitive display When lactate ≥ 4 mmol/L and the AG is elevated, the UAG section is de-emphasized in the output — lactate clearly accounts for the AG and UAG adds minimal decision value. UAG prominence is restored when lactate normalizes or the AG pattern changes.
7 — Osmol Gap
Calculated Osm = 2×Na + BUN/2.8 + Glucose/18 Osmol Gap = Measured Osm − Calculated Osm
GapInterpretation
<10 mOsm/kgNormal — significant toxic alcohol unlikely
10–20 mOsm/kgBorderline — rule out ethanol, early toxic alcohol ingestion
>20 mOsm/kgElevated — methanol, ethylene glycol, isopropanol, mannitol
8 — CrCl (Cockcroft-Gault)
CrCl = ((140 − Age) × Weight) ÷ (72 × SCr) [× 0.85 if female]
  • Used to screen for pharmacotherapy eligibility (acetazolamide, arginine HCl, potassium repletion thresholds)
  • Weight used: ABW; use AdjBW if ABW > 1.2 × IBW
  • Flags CrCl <30 as severely reduced for acid-base pharmacotherapy purposes
9 — Alveolar-Arterial (A-a) Gradient
PAO₂ = FiO₂ × 713 − PaCO₂ / 0.8 A-a gradient = PAO₂ − PaO₂
  • Normal A-a: <20 mmHg on room air (increases with age and FiO₂)
  • Elevated A-a: suggests intrinsic lung pathology (V/Q mismatch, shunt, diffusion impairment)
  • Normal A-a with hypoxemia: hypoventilation or low FiO₂ as cause
10 — Validation & Testing
  • 30-scenario logic sanity check: all primary disorder classifications, compensation formulas, delta-delta calculations, and UAG interpretations verified against reference texts
  • 18-preset runtime test: all clinical presets (DKA, lactic acidosis, COPD, salicylate, etc.) verified to produce expected output on each release
  • Edge case testing: BMP-only mode, missing ABG, hypoalbuminemia, severe acidemia (pH <7.0), mixed triple disorders
  • Clinical review: outputs reviewed by clinical pharmacists with critical care and inpatient pharmacy experience
Important limitation This tool has not undergone formal prospective clinical validation against patient outcomes. All outputs are estimates based on population-derived formulas. Individual patient responses may vary. Always verify calculations independently and apply clinical judgment.