TheraCALC is a web-based clinical decision support platform. The acid-base calculator applies a stepwise, algorithm-based approach to interpret arterial blood gas (ABG) and basic metabolic panel (BMP) values — identifying primary acid-base disorders, verifying compensation, detecting mixed disorders, and generating pattern-based management guidance for licensed clinicians. Results should be interpreted in the context of the patient's clinical status, comorbidities, and institutional protocols.
Runtime independence Recommendations are generated using the proprietary TheraIQ engine developed and maintained in-house. TheraCALC does not rely on any third-party clinical decision-support service or external AI model.
1 — Acid-Base Interpretation Framework
  • The calculator follows a five-step algorithm modeled on approaches commonly used in internal medicine and critical care education. Each major step is surfaced in the "How We Got Here" tab with the formula applied, the computed value, and a brief clinical interpretation.
StepFocusWhat the calculator evaluates
1pHDetermine acidemia (pH < 7.35), alkalemia (pH > 7.45), or near-normal pH
2Primary processCompare HCO₃ and PaCO₂ to identify the primary driver as metabolic (HCO₃ change) or respiratory (PaCO₂ change)
3Anion gapCalculate AG = Na − Cl − HCO₃. Correct for albumin (+2.5 mEq/L per 1 g/dL below 4.0). Assess delta-delta ratio
4CompensationApply the appropriate bedside compensation formula. Values outside the expected range may suggest a concurrent process
5Mixed-process screeningIntegrate delta-delta ratio, urine indices (Cl, Na, K, UAG, TTKG), osmol gap, and Henderson-Hasselbalch cross-check
2 — Primary Disorder Classification
  • When pH is available it is the primary driver of classification. BMP-only interpretation uses the HCO₃ pattern alone and is labeled as estimated throughout the interface.
  • Near-normal pH (7.35–7.45) with opposing HCO₃ and PaCO₂ abnormalities is handled by identifying the dominant driver based on its relative deviation from normal.
ConditionClassification
pH < 7.35, HCO₃ < 22Metabolic acidosis
pH < 7.35, PaCO₂ > 45Respiratory acidosis
pH > 7.45, HCO₃ > 26Metabolic alkalosis
pH > 7.45, PaCO₂ < 35Respiratory alkalosis
pH 7.35–7.45 with PaCO₂ < 35 and HCO₃ < 22Mixed pattern: respiratory alkalosis + metabolic acidosis (e.g., salicylate toxicity, early sepsis)
pH 7.35–7.45 with PaCO₂ > 45 and HCO₃ > 26Mixed pattern: respiratory acidosis + metabolic alkalosis
BMP only: HCO₃ < 22Metabolic acidosis (estimated — ABG required to confirm)
BMP only: HCO₃ > 26Metabolic alkalosis (estimated — ABG required to confirm)
3 — Anion Gap, Albumin Correction & Delta-Delta Ratio

3.1 Anion gap and albumin correction

Formula / conceptDetail
Anion gap formulaAG = Na⁺ − Cl⁻ − HCO₃⁻ (normal range: approximately 8–12 mEq/L)
Albumin correctionCorrected AG = raw AG + 2.5 × (4.0 − albumin in g/dL). Each 1 g/dL of albumin below 4.0 can mask about 2.5 mEq/L of true AG elevation
ThresholdsRaw AG > 12 mEq/L or corrected AG > 14 mEq/L is flagged as elevated. Corrected AG is used whenever albumin has been entered
PromptsIf AG > 6 without albumin entered, the disclosure strip prompts for albumin. If corrected AG > 14 without serum osmolality, osmol gap entry is prompted

3.2 Delta-delta ratio

  • In a pure elevated-AG process, each mEq/L rise in AG corresponds to a 1 mEq/L fall in HCO₃. The delta-delta ratio detects when these do not match, indicating a concurrent metabolic process.
Delta-delta valueInterpretation
< 0.4Pattern consistent with pure normal-AG (hyperchloremic) metabolic acidosis
0.4 – 1.0Pattern suggests elevated-AG acidosis with concurrent normal-AG acidosis
1.0 – 2.0Pattern consistent with a predominantly elevated-AG process — HCO₃ drop matches AG rise
> 2.0Pattern suggests elevated-AG acidosis with concurrent metabolic alkalosis
4 — Compensation Formulas
  • Expected compensation is calculated from commonly used bedside formulas and displayed as a range rather than a single point. An observed value outside the expected range may suggest a concurrent process; the tool uses "may suggest" language, not "confirms."
Primary disorderExpected compensationTolerance / notes
Metabolic acidosisPaCO₂ ≈ 1.5 × HCO₃ + 8 (Winters formula)±2 mmHg around the calculated value
Metabolic alkalosisPaCO₂ ≈ 0.7 × (HCO₃ − 24) + 40±2 mmHg; capped at approximately 55 mmHg
Acute respiratory acidosisHCO₃ rises by about (PaCO₂ − 40) / 10±2 mEq/L; onset < 24 hours
Chronic respiratory acidosisHCO₃ rises by about 3.5 × (PaCO₂ − 40) / 10±3 mEq/L; onset over days–weeks
Acute respiratory alkalosisHCO₃ falls by about 2 × (40 − PaCO₂) / 10±3 mEq/L
Chronic respiratory alkalosisHCO₃ falls by about 5 × (40 − PaCO₂) / 10±3 mEq/L
Respiratory acidosis annotation For respiratory acidosis, the "How We Got Here" tab annotates whether HCO₃ falls within the acute range, the chronic range, or between them — displayed as "consistent with acute event," "consistent with chronic hypercapnia," or "acute-on-chronic pattern." This distinction is directly relevant to COPD management decisions.
5 — Mixed Disorder Detection
  • Mixed disorders are identified from five pattern triggers. Each detected pattern is displayed with the specific findings that triggered it, a confidence label reflecting available data, and any limitations such as albumin not being entered.
PatternTriggerExamples
Elevated-AG acidosis + metabolic alkalosisCorrected AG > 14 and HCO₃ > 26 (or delta-delta > 2)DKA with vomiting; uremia with contraction alkalosis
Elevated-AG acidosis + normal-AG acidosisCorrected AG > 14 and delta-delta < 1.0Lactic acidosis with concurrent diarrhea; sepsis with large-volume normal saline
Respiratory acidosis + metabolic alkalosisPaCO₂ > 45, HCO₃ > 30, and pH near-normalCOPD with diuretics; post-hypercapnic alkalosis
Respiratory alkalosis + metabolic acidosisPaCO₂ < 35, HCO₃ < 20, and pH 7.38–7.45Salicylate toxicity; early sepsis
Triple disorder (rare)Elevated AG, delta-delta < 1.0, and HCO₃ higher than normal-AG acidosis alone would predictDKA with concurrent GI loss and vomiting
6 — Clinical Cutoffs & Action Thresholds
  • Key clinical values used as thresholds throughout the calculator are defined centrally so changes propagate consistently to every output that depends on them.
ParameterThresholdPurpose
Anion gap (raw)> 12 mEq/LFlags as elevated; prompts albumin entry
Anion gap (albumin-corrected)> 14 mEq/LElevated corrected AG; triggers AGMA workup
pH — critical low< 7.10Critical urgency trigger; bicarbonate consideration threshold
pH — urgent low< 7.20Urgent intervention range
pH — urgent high> 7.60Emergent alkalemia; HCl therapy consideration in selected ICU cases
pH — critical high> 7.65Critical urgency trigger
Potassium — critical low< 2.5 mEq/LCritical hypokalemia; arrhythmia risk
Potassium — high> 5.5 mEq/LHyperkalemia intervention trigger
Potassium — urgent high> 6.5 mEq/LCritical urgency escalation; EKG prompt
Lactate — elevated> 2.0 mmol/LPerfusion concern
Lactate — critical> 4.0 mmol/LPerfusion emergency; urgent action
Osmolal gap — borderline> 10 mOsm/kgBorderline elevation; limited specificity alone
Osmolal gap — significant> 20 mOsm/kgHigh concern for toxic alcohol or mannitol
Urine chloride — responsive< 25 mEq/LChloride-responsive metabolic alkalosis pattern
Urine chloride — resistant> 40 mEq/LChloride-resistant (mineralocorticoid-mediated) alkalosis pattern
CrCl — acetazolamide gate< 30 mL/minAcetazolamide considered contraindicated below this threshold
CrCl — arginine HCl gate< 50 mL/minArginine HCl considered contraindicated below this threshold
7 — Derived Calculations

7.1 Osmolal gap

  • Calculated osmolality = (2 × Na⁺) + (BUN / 2.8) + (glucose / 18). Gap = measured serum osmolality − calculated osmolality.
Gap valueInterpretation
< 10 mOsm/kgNormal
10–20 mOsm/kgBorderline — consider ethanol or early toxic alcohol ingestion
> 20 mOsm/kgSignificant — high concern for toxic alcohol (methanol, ethylene glycol), mannitol, or ethanol

7.2 Transtubular Potassium Gradient (TTKG)

  • Valid only when urine osmolality exceeds serum osmolality (concentrated urine). Suppressed automatically when urine is dilute.
ScenarioTTKGInterpretation
Hypokalemia> 4Renal potassium wasting (aldosterone, diuretics, RTA)
Hypokalemia< 2Extrarenal loss (GI, skin)
Hyperkalemia< 7Impaired aldosterone; consider Type 4 RTA or adrenal insufficiency
Hyperkalemia> 11Appropriate kaliuresis

7.3 Urine Anion Gap (UAG)

  • UAG = urine Na⁺ + urine K⁺ − urine Cl⁻. Estimates unmeasured urinary ammonium excretion to differentiate causes of normal-AG metabolic acidosis.
UAGInterpretation
Strongly negative (< −20 mEq/L)High ammonium excretion — consistent with GI bicarbonate loss (diarrhea, ileostomy)
Positive (> 0 mEq/L)Low ammonium excretion — consistent with RTA; subtype by urine pH and potassium

7.4 A-a Oxygen Gradient

  • Formula: A-a = [(FiO₂/100) × 713 − PaCO₂/0.8] − PaO₂. Age-adjusted upper limit of normal: approximately 4 + (age/4) mmHg. FiO₂ outside 21–100% is flagged and A-a suppressed. Requires PaO₂ from ABG.

7.5 Corrected Sodium for Hyperglycemia

  • Corrected Na⁺ = Measured Na⁺ + 1.6 × (glucose − 100) / 100 mg/dL. Shown when glucose > 200 mg/dL. Glucose > 600 mg/dL prompts DKA vs HHS differentiation.
8 — Renal Function & Drug Dosing Gates
  • Cockcroft-Gault CrCl is used for three drug-specific safety gates: acetazolamide (CrCl < 30 mL/min: considered contraindicated), arginine HCl (CrCl < 50 mL/min: considered contraindicated), and potassium replacement rate adjustment.
  • Formula: CrCl = [(140 − age) × weight × (0.85 if female)] / (72 × SCr).
Cockcroft-Gault limitation This equation may overestimate GFR in frail or sarcopenic patients. Cystatin C-based eGFR is preferred in those populations where available. This is disclosed in the caveats section when creatinine is elevated.
9 — Input Plausibility Checks
  • The calculator cross-checks entered values for internal consistency. Warnings appear in the caveats section and do not block calculation.
CheckTriggerWhat the clinician sees
Henderson-Hasselbalch cross-checkCalculated pH differs from entered pH by more than 0.08 unitsAmber caveat: pH inconsistent with HCO₃ and PaCO₂ — verify the entered values
Physiologic pH rangepH below 6.5 or above 8.0Amber caveat: outside the survivable range — verify entry
PaCO₂ rangePaCO₂ below 10 or above 120 mmHgAmber caveat: outside plausible range — verify entry
FiO₂ validityFiO₂ below 21% or above 100%A-a gradient suppressed; amber caveat displayed
TTKG validityUrine osmolality at or below serum osmolalityTTKG suppressed; dilute urine renders result unreliable
CrCl availabilityCreatinine entered but age or weight missingCaveat names the specific missing field and lists affected drug dosing gates
10 — Data Confidence & Urgency Indicators

10.1 Data confidence badge

BadgeWhen it appears
BMP ONLYNo pH or PaCO₂ entered; banner shows "(BMP-estimated)" after the disorder label
ABG CONFIRMEDpH and PaCO₂ present
ABG + ALBUMINpH, PaCO₂, and albumin all present
URINE-INFORMEDpH, PaCO₂, and urine electrolytes present
MULTI-SOURCEpH, PaCO₂, albumin, and urine data all present

10.2 Action urgency indicator

Urgency levelTriggered by
Urgent action (red bar)pH below 7.10, pH above 7.65, potassium above 6.5 mEq/L, or lactate above 4.0 mmol/L
Urgent (orange bar)pH below 7.20, potassium below 2.5 or above 6.0 mEq/L, mixed disorder, or creatinine above 4.0 mg/dL
RoutineNone of the above applies
11 — Clinical Presets
  • The calculator includes 18 clinical teaching presets covering major acid-base patterns encountered in inpatient practice. Each includes age, weight, and creatinine for full CrCl calculation.
CategoryPresets
Elevated-AG metabolic acidosisDKA / HAGMA ketoacidosis, lactic acidosis (shock), ethylene glycol, methanol, isopropanol (osmol gap without acidosis), uremic acidosis
Normal-AG metabolic acidosisDiarrheal NAGMA, RTA Type 1 (distal; urine pH 6.5), RTA Type 4 (hyperkalemic), chronic diarrhea on CKD
Metabolic alkalosisVomiting-induced alkalosis (urine Cl⁻ 15 mEq/L; chloride-responsive)
Mixed and respiratorySalicylate (respiratory alkalosis + metabolic acidosis; near-normal pH), sepsis (early respiratory alkalosis + metabolic acidosis), COPD exacerbation (chronic respiratory acidosis)
12 — Internal Validation Summary
  • Calculation logic has been verified against known clinical scenarios prior to deployment. Automated testing covers the clinical presets and targeted logic scenarios listed below.
  • These tests represent internal unit testing and do not replace prospective clinical validation. External validation against patient-level data is a future goal.
Category verified
Primary classification — all four disorder types and normal patterns
Near-normal pH mixed classification (salicylate and early sepsis patterns)
BMP-only inference and confidence badge assignment
Anion gap calculation and albumin correction
Delta-delta ratio calculation and interpretation thresholds
All six compensation formulas with range display and mixed-detection logic
Acute vs chronic respiratory acidosis annotation
Mixed-disorder pattern detection, including rare triple-disorder patterns
Action urgency independent of biochemical severity
Henderson-Hasselbalch plausibility checks (true positives and negatives)
FiO₂ validity gate and A-a gradient suppression
TTKG suppression when urine osmolality is dilute
Osmolal gap calculation
HHS vs DKA differentiation at very high glucose
CrCl drug gates — acetazolamide, arginine HCl, potassium rate adjustment
Female CrCl 0.85 multiplier applied correctly
Urine chloride subtyping; UAG and TTKG calculation
BMP-only gating of intervention and dose text
Runtime across all teaching presets without errors
User interface input/output linkage checks
13 — Known Limitations & Clinical Caveats
  • BMP-only classification. Without pH and PaCO₂, the calculator cannot confirm acidemia or alkalemia, verify compensation, or reliably detect mixed disorders. BMP-only outputs are labeled as provisional.
  • Compensation formula variance. Winters formula and standard respiratory compensation ranges are bedside approximations derived from population studies. Individual variation is expected; the tool consistently uses "may suggest" rather than "confirms."
  • Creatinine clearance in frail patients. Cockcroft-Gault may overestimate GFR when muscle mass is reduced. Cystatin C-based eGFR is preferred in those populations where available.
  • Pediatric use. Adult normal ranges and thresholds are used throughout. Pediatric acid-base interpretation is outside the current scope of this tool.
  • No prospective clinical validation. The calculator has been verified through internal unit testing but has not yet been evaluated against a prospective patient-level dataset.
  • Mixed-disorder confidence. Detection relies on compensation thresholds that carry inherent variance. Post-bicarbonate administration, chronic compensated states, or simultaneously evolving disorders may affect accuracy.
  • One-compartment assumption. Standard acid-base formulas assume equilibrated distribution. They are less reliable during rapid flux states or immediately following bicarbonate administration.
14 — References
  1. Winters RW. Posterior and anterior anion gap acidosis. JAMA. 1967;199(11):80-82.
  2. Emmett M, Narins RG. Clinical use of the anion gap. Medicine (Baltimore). 1977;56(1):38-54.
  3. Battle DC, et al. The use of the urinary anion gap in the diagnosis of hyperchloremic metabolic acidosis. N Engl J Med. 1988;318(10):594-599.
  4. Narins RG, Emmett M. Simple and mixed acid-base disorders: a practical approach. Medicine (Baltimore). 1980;59(3):161-187.
  5. Kraut JA, Madias NE. Approach to patients with acid-base disorders. Respir Care. 2001;46(4):392-403.
  6. Fencl V, et al. Diagnosis of metabolic acid-base disturbances in critically ill patients. Am J Respir Crit Care Med. 2000;162(6):2246-2251.
  7. Adrogué HJ, Madias NE. Management of life-threatening acid-base disorders. N Engl J Med. 1998;338(1):26-34.
  8. Kraut JA, Madias NE. Metabolic acidosis: pathophysiology, diagnosis and management. Nat Rev Nephrol. 2010;6(5):274-285.
  9. Khanna A, Kurtzman NA. Metabolic alkalosis. J Nephrol. 2006;19 Suppl 9:S86-96.
  10. Cockcroft DW, Gault MH. Prediction of creatinine clearance from serum creatinine. Nephron. 1976;16(1):31-41.
  11. US Food and Drug Administration. Guidance for Industry: Pharmacokinetics in Patients with Impaired Renal Function. 2024.
Reporting Discrepancies & Contact
  • If you identify a calculation discrepancy, logic inconsistency, or scenario the calculator does not handle well, please report it using the feedback button on the calculator. Clinical input from practicing pharmacists is the most valuable driver of improvement.
  • Include: the specific section and inputs used; exact values entered; what you expected vs what the calculator returned; and a reference or comparator where applicable. No PHI is required.
  • Contact: [email protected] — all reports reviewed by the clinical pharmacist developer.