Acid Base Calculator
The acid base calculator organizes blood gas and chemistry inputs into an educational acid-base pattern, then adds anion gap and albumin-corrected anion gap calculations. It is written for learning and documentation support, not for bedside diagnosis, because real acid-base interpretation depends on symptoms, oxygenation, sampling, timing, medications, and the full clinical context.
What it measures
The calculator reads six values: pH, PCO2, bicarbonate, chloride, sodium, and albumin. pH describes whether the blood sample is acidemic, alkalemic, or in the usual arterial reference range. PCO2 reflects the respiratory component, because ventilation changes carbon dioxide. Bicarbonate reflects the metabolic component, although measured serum bicarbonate and calculated blood gas bicarbonate can differ by specimen and method. Sodium, chloride, and bicarbonate are used to calculate the anion gap. Albumin is used to correct that gap because albumin contributes substantially to unmeasured anions.
This page overlaps with the anion gap calculator, but it adds pH and PCO2 pattern language. If oxygen transfer is the main question, use the A-a gradient calculator. For a related protein measurement that can influence the gap correction, see the albumin globulin ratio calculator.
Calculation and formula
The calculator first classifies pH:
PCO2 and bicarbonate remain visible, but the calculator intentionally does not infer a primary disorder, compensation, or mixed disorder from them.
The anion gap is calculated exactly as:
The albumin-corrected anion gap is:
The anion gap item is marked warning when the uncorrected anion gap is greater than 16 or less than 8. The primary interpretation is marked warning when pH is outside 7.35 to 7.45.
Worked example
Consider pH 7.30, PCO2 40 mmHg, bicarbonate 18 mEq/L, sodium 140 mEq/L, chloride 100 mEq/L, and albumin 4.0 g/dL. The primary result is Acidemia because pH is below 7.35. PCO2 and bicarbonate remain visible for clinical interpretation.
The anion gap is:
The corrected anion gap is:
The uncorrected gap is above 16, so the anion gap item receives a warning tone and the hint Elevated. The pH status item shows Acidemia. These outputs match the calculation, including one-decimal formatting for the gap values.
Interpretation and clinical context
The calculator’s pattern labels are intentionally narrow. Acidemia with low bicarbonate suggests a metabolic acidosis pattern, and alkalemia with low PCO2 suggests a respiratory alkalosis pattern, but the cause is not determined by the label. Elevated anion gap metabolic acidosis can occur with lactic acidosis, ketoacidosis, renal failure, and some toxic ingestions. Normal-gap acidosis has a different differential. Respiratory disorders require ventilation, oxygenation, and clinical assessment.
A major limitation is mixed or compensated disease. A patient with chronic respiratory acidosis and metabolic compensation, or simultaneous metabolic acidosis and respiratory alkalosis, may have a pH near the stated range. The calculator does not classify those patterns.
Medical disclaimer and urgent cautions
This calculator is for general education only and is not medical advice, diagnosis, triage, or treatment guidance. Blood gas interpretation should be performed by qualified clinicians who can review arterial versus venous sampling, oxygen therapy, lactate, ketones, renal function, glucose, salicylates, toxic alcohol risk, respiratory status, and medications. Severe shortness of breath, altered mental status, shock, suspected poisoning, diabetic ketoacidosis, sepsis, or respiratory failure requires urgent medical care.
Common mistakes
- Using venous and arterial values interchangeably without noting specimen type.
- Treating normal pH as normal physiology when PCO2 and bicarbonate may both be abnormal.
- Forgetting albumin correction when albumin is low, which can mask an elevated gap.
- Using the calculator as a compensation tool; it does not calculate expected compensation.
- Ignoring oxygenation, lactate, renal function, glucose, ketones, and clinical status.
- Assuming an elevated gap identifies a single cause. The differential remains broad.
Sources
- NCBI Bookshelf, Physiology, Acid Base Balance — clinical physiology of pH, ventilation, bicarbonate, and acid-base regulation.
- NCBI Bookshelf, Anion Gap Blood Test — anion gap principles and clinical use.
- NCBI Bookshelf, Metabolic Acidosis — clinical overview of metabolic acidosis patterns and causes.