Diabetic Ketoacidosis Calculator

Enter glucose, electrolytes, arterial pH, and mental status to calculate the anion gap, corrected sodium, effective osmolality, and ADA-based DKA severity grade.

Quick Facts

DKA diagnostic criteria (ADA)
Glucose >250 mg/dL, pH <7.30 or HCO₃⁻ <18, ketones positive, anion gap >10
All four typically present together at diagnosis.
Anion gap
AG = Na⁻ (Cl + HCO₃⁻)
A gap above 12 mEq/L points to a high-anion-gap acidosis such as DKA.
Corrected sodium
Na + 1.6 × [(glucose − 100) / 100]
Corrects for the dilutional effect of hyperglycemia on measured sodium.
Severity grading
Mild pH 7.25–7.30 · Moderate pH 7.00–7.24 · Severe pH <7.00
Paired with bicarbonate and mental status per ADA consensus criteria.

Your Results

Calculated
DKA Severity
-
ADA pH / HCO₃⁻ / mental-status grading
Anion Gap
-
Na − (Cl + HCO₃⁻); >12 mEq/L is elevated
Corrected Sodium
-
Adjusted for hyperglycemia
Effective Osmolality
-
2 × Na + glucose / 18

Ready

Enter labs and press Calculate. This tool is educational only and does not replace emergency medical evaluation.

How the Diabetic Ketoacidosis (DKA) Calculator Works

Diabetic ketoacidosis is a life-threatening complication of diabetes caused by insulin deficiency: the body burns fat for fuel and produces excess ketoacids, which drive down blood pH and bicarbonate while glucose rises sharply. The American Diabetes Association (ADA) consensus statement on hyperglycemic crises defines DKA using four measurements taken together: blood glucose above 250 mg/dL, an arterial pH below 7.30 or bicarbonate below 18 mEq/L, positive ketones in blood or urine, and an elevated anion gap (typically above 10-12 mEq/L). This calculator takes the labs you enter and computes the anion gap, hyperglycemia-corrected sodium, effective serum osmolality, and an ADA-based severity grade so you can see how the numbers fit together.

The formulas behind the numbers

The anion gap is AG = Na⁻ (Cl + HCO₃⁻); DKA is a "high-anion-gap" metabolic acidosis because circulating ketoacids (beta-hydroxybutyrate and acetoacetate) consume bicarbonate and add unmeasured anions. Corrected sodium is Na + 1.6 × [(glucose − 100) / 100] — high glucose osmotically pulls water out of cells and dilutes the measured sodium, so this correction estimates the patient's true sodium status. Effective serum osmolality is 2 × Na + glucose / 18, a simplified osmolality that excludes urea (which moves freely across membranes and doesn't drive fluid shifts) and is used to help distinguish DKA from hyperosmolar hyperglycemic state (HHS).

Interpreting the severity grade

Per the ADA criteria, mild DKA has arterial pH 7.25-7.30 and bicarbonate 15-18 mEq/L with the patient alert; moderate DKA has pH 7.00-7.24 and bicarbonate 10 to under 15 mEq/L with the patient alert or drowsy; severe DKA has pH below 7.00 and bicarbonate below 10 mEq/L, often with stupor or coma. Because pH, bicarbonate, and mental status don't always move in lockstep, this calculator grades severity using whichever measurement indicates the worst tier. If glucose is not above 250 mg/dL, ketones are negative, or the anion gap is not elevated, the core diagnostic pattern for DKA is not fully met and the result will flag that explicitly rather than force a severity label.

Important limitations

This calculator is an educational reference for understanding how DKA labs and severity criteria relate to each other — it is not a diagnostic tool, does not calculate fluid or insulin dosing, and cannot replace bedside clinical judgment. Suspected DKA is a medical emergency: anyone with these symptoms or lab findings needs immediate evaluation in a hospital or emergency department, not a delay for online calculation.

Frequently Asked Questions

What are the diagnostic criteria for diabetic ketoacidosis?
The ADA consensus criteria for DKA are blood glucose above 250 mg/dL, arterial pH below 7.30 or serum bicarbonate below 18 mEq/L, positive serum or urine ketones, and an anion gap above 10 mEq/L. All of these typically occur together; a patient missing several of these findings may not have DKA.
How is DKA severity classified as mild, moderate, or severe?
Severity is graded mainly by arterial pH and serum bicarbonate: mild DKA has pH 7.25-7.30 and bicarbonate 15-18 mEq/L with the patient alert; moderate DKA has pH 7.00-7.24 and bicarbonate 10-<15 mEq/L with the patient alert or drowsy; severe DKA has pH below 7.00 and bicarbonate below 10 mEq/L, often with stupor or coma.
What is the anion gap and why does it matter in DKA?
The anion gap equals serum sodium minus the sum of chloride and bicarbonate (AG = Na − (Cl + HCO₃⁻)). DKA is a high-anion-gap metabolic acidosis caused by circulating ketoacids, so a gap above 10-12 mEq/L supports the diagnosis alongside low bicarbonate and acidotic pH.
Why does serum sodium need to be corrected for high glucose?
High glucose pulls water out of cells and dilutes measured sodium, so the lab value can look falsely low. The correction adds 1.6 mEq/L to sodium for every 100 mg/dL that glucose exceeds 100 mg/dL, giving a truer picture of the patient's actual sodium and hydration status.