ForHosting KIT · Health & fitness

Anion gap delta ratio calculator

Check whether a high anion gap acidosis hides a second disorder: a gap of 28 with bicarbonate at 12 means a rise of 16 against a fall of 12, a ratio inside the 0.8 to 2.0 band of relatively pure high-gap acidosis. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Anion gap
28
Bicarbonate
12
You get
Normal anion gap
12 mEq/L
Normal bicarbonate
24
Delta ag
16
Delta hco3
12

When a high anion gap metabolic acidosis is present, clinicians and students often ask whether a second process is hidden: a concurrent normal anion gap acidosis or a metabolic alkalosis. The anion gap delta ratio, also called the delta-delta, answers that teaching question with simple arithmetic. It compares how much the anion gap rose above a normal reference with how much bicarbonate fell below its own normal. This capability accepts a measured anion gap and bicarbonate, optional normal references (defaults twelve and twenty-four milliequivalents per litre), and returns the gap delta, the bicarbonate delta, the ratio, and an educational band label.

What the anion gap delta ratio measures and which inputs you need

The delta ratio is a teaching tool layered on top of the serum anion gap. First you already know the measured gap, often from sodium minus chloride minus bicarbonate on a basic metabolic panel. Then you form two deltas against reference normals: delta anion gap equals measured anion gap minus the normal gap, and delta bicarbonate equals normal bicarbonate minus the measured bicarbonate.

Their quotient is the delta ratio. When bicarbonate has fallen roughly in proportion to the rise in unmeasured anions, the ratio lands near the pure high anion gap band; when bicarbonate fell more than expected for the gap rise, a concurrent hyperchloremic normal anion gap acidosis is suspected in classroom discussions; when bicarbonate fell less than expected, concurrent metabolic alkalosis or chronic respiratory acidosis is discussed. This product does not diagnose disease—it only computes the arithmetic and the published educational bands so every client gets identical numbers.

Practical bounds keep classroom inputs sane: anion gap zero through eighty, bicarbonate zero through eighty, normal gap zero through thirty, normal bicarbonate zero through forty. When measured bicarbonate equals the normal bicarbonate reference, delta bicarbonate is zero and the ratio is undefined, so the engine rejects that case rather than dividing by zero.

Acid-base teaching apps

Education apps show intermediate ΔAG and ΔHCO3 next to the ratio without re-coding textbook band cut-offs on every client.

What do the educational bands mean?

Ratios under 0.4 suggest concurrent NAGMA with HAGMA; 0.4–0.8 possible mixed HAGMA+NAGMA; 0.8–2.0 relatively pure HAGMA; above 2.0 concurrent metabolic alkalosis or chronic respiratory acidosis. Labels are educational only, not a diagnosis.

Is the anion gap delta ratio calculator free?

The browser tool runs free on your device.

How is the anion gap delta ratio calculated?

Subtract the normal gap of 12 from the measured gap, then divide by 24 minus the measured bicarbonate. With a gap of 28 and bicarbonate of 12, that is 16 divided by 12.

Why is my result rejected when bicarbonate is 24?

Because the bicarbonate fall would be zero and the ratio would mean dividing by zero. Whenever the measured bicarbonate equals the normal reference, the ratio is undefined, so no number is given.

Can I use different normal values than 12 and 24?

Yes. Both references are optional and can be changed when your course or laboratory teaches other normals. Leave them empty and the usual 12 for the gap and 24 for bicarbonate are used.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/health/anion-gap-delta

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/health/anion-gap-delta \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"anion_gap":28,"bicarbonate":12}'
{
  "anion_gap": 28,
  "bicarbonate": 12
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "health.anion_gap_delta",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

The path is pure deterministic math with no network and no model, so homework checkers and API clients always see the same JSON. Negative or missing numbers fail with invalid_input and are not charged.

What the anion gap delta ratio measures and which inputs you need

Send required fields anion_gap and bicarbonate as finite non-negative numbers; aliases such as ag, hco3, bicarb, and total_co2 are accepted when documented. Optional normal_anion_gap defaults to twelve milliequivalents per litre and optional normal_bicarbonate defaults to twenty-four. Any missing field, non-finite value, or negative reading fails with invalid_input. Identical inputs always yield identical JSON because the path is pure arithmetic with stable rounding, no random seed, and no wall clock.

Reading delta_ratio, bands, and the response shape

The formula field restates the quotient so teaching cards can show the equation next to the number. The interpretation field is a short English sentence describing the educational meaning of that band: concurrent normal anion gap acidosis with high anion gap acidosis for ratios under zero point four; possible mixed high and normal gap acidosis for zero point four up to but not including zero point eight; relatively pure high anion gap metabolic acidosis for zero point eight through two point zero; and concurrent metabolic alkalosis or chronic respiratory acidosis for ratios above two. Those cut-offs match common textbook teaching ranges and are labels only—they are not a clinical diagnosis, not a substitute for arterial blood gas interpretation, and not a medical device claim. On success the response echoes anion_gap, bicarbonate, normal_anion_gap, and normal_bicarbonate with stable rounding, sets unit to mEq/L, and reports delta_ag, delta_hco3, and delta_ratio as the core numeric trio. The method field is always anion_gap_delta_ratio so downstream code can branch without sniffing shapes. The band field is a short machine-stable code: lt_0.4, 0.4_to_0.8, 0.8_to_2.0, or gt_2.0. Use delta_ag and delta_hco3 when you want to show intermediate steps; use delta_ratio and band when you only need the summary. Do not confuse this endpoint with the serum anion gap calculator that builds the gap from sodium, chloride, and bicarbonate, with osmolar gap tools, or with full acid-base engines that combine blood gas and electrolytes into a multi-step workflow. Those are different search intents and different contracts. Missing required values, non-numeric strings, out-of-range readings, negatives, and zero delta bicarbonate all fail with invalid_input and are not charged.

API usage, pricing, product workflows, and practical limits

Call the free in-browser anion gap delta ratio calculator for classroom demos, nursing homework checks, and quick personal learning without reimplementing the quotient in every spreadsheet. Prefer consistent milliequivalent units for monovalent ions; if your UI only collects whole numbers, send integers and the engine still accepts numeric strings. Keep expectations educational: this is a calculation and learning tool, not a diagnostic medical device, and people with symptoms, known acid-base disorders, kidney disease, poisoning, or medication changes should follow professional medical advice rather than any single automated number alone. Send a JSON body with required anion_gap and bicarbonate values and optional normal_anion_gap and normal_bicarbonate when your curriculum uses different reference normals than twelve and twenty-four. Use the prepaid API when a health education SaaS, electronic worksheet, simulation lab, tutoring platform, or school LMS needs a stable contract under KIT balance at $0.002 per successful item; validation failures never consume balance after the engine rejects the request. Pair this endpoint with a separate anion gap computation when you start from raw electrolytes: first obtain the gap, then pass gap and bicarbonate here for the delta ratio. Authors shipping SDKs can map delta_ratio and band into tables, colour bands for educational thresholds you define yourself, and step-by-step teaching cards that show the formula string.

Medical and nursing school homework

Students submit measured AG and HCO3 and pin expected delta_ratio and educational band JSON in automated checkers with deterministic outputs.

Simulation labs and SaaS backends

Server pipelines that already store anion gap and bicarbonate call a prepaid endpoint for delta-ratio fields instead of duplicating formulas in every language.

How is the anion gap delta ratio calculated?

delta_ratio = (anion_gap − normal_anion_gap) / (normal_bicarbonate − bicarbonate). Defaults are normal_anion_gap 12 and normal_bicarbonate 24 mEq/L. The response includes delta_ag, delta_hco3, delta_ratio, and a formula string.

What if bicarbonate equals the normal reference?

The request fails with invalid_input because ΔHCO3 would be zero and the ratio is undefined (division by zero).

Does this compute the anion gap from sodium and chloride?

No. Send an already-measured anion_gap plus bicarbonate. For Na−(Cl+HCO3) itself use a separate anion gap calculator, then feed the gap and bicarbonate into this delta-ratio endpoint.

Read the full KIT documentation →