Qp/Qs ratio calculator
Saturations of 98, 70, 99 and 85% give a Qp/Qs of 2: the lungs receive twice the systemic flow, a left-to-right shunt. Enter the four oxygen saturations to compare pulmonary and systemic blood flow. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Sat systemic arterial
- 98
- Sat mixed venous
- 70
- Sat pulmonary venous
- 99
- Sat pulmonary arterial
- 85
- Numerator
- 28 ratio
- Denominator
- 14
- Qp qs
- 2
- Qp qs rounded
- 2
The Qp/Qs ratio compares pulmonary blood flow to systemic blood flow and is a standard teaching quantity in congenital cardiology, cardiac catheterization, and physiology courses. This calculator applies the Fick oxygen-saturation identity: pulmonary-to-systemic flow equals systemic arterial saturation minus mixed venous saturation, divided by pulmonary venous saturation minus pulmonary arterial saturation. You send four oxygen saturations as percents from zero through one hundred. The engine returns the dimensionless Qp/Qs ratio, the numerator and denominator used in the division, a two-decimal display value, and a simple educational shunt-direction label.
What Qp/Qs measures and how four saturations yield the ratio
The Qp/Qs ratio is pulmonary blood flow divided by systemic blood flow. In a circulation without a shunt those two flows are equal, so the ratio equals one. A left-to-right shunt sends extra volume through the lungs, pulmonary flow exceeds systemic flow, and Qp/Qs is greater than one.
A right-to-left shunt bypasses the lungs, pulmonary flow falls below systemic flow, and Qp/Qs is less than one. Direct volumetric flow is not always available in a classroom, a worksheet, or a teaching catheterization dataset, but oxygen saturations from four sites are. The Fick principle states that oxygen consumption equals blood flow times the arteriovenous oxygen-content difference.
Canceling consumption between the pulmonary and systemic circuits, and substituting saturation percents for content when hemoglobin and dissolved oxygen are treated as shared, yields the classic identity used here: Qp/Qs equals (SaO2 minus SvO2) divided by (SpvO2 minus SpaO2). SaO2 is systemic arterial saturation, typically sampled from the aorta or left ventricle. SvO2 is mixed venous saturation, typically from the superior vena cava or a mixed vena-cava estimate.
SpvO2 is pulmonary venous saturation, sampled from pulmonary veins or assumed near ninety-eight percent when not measured. SpaO2 is pulmonary arterial saturation.
Where the Qp/Qs ratio helps, and its limits
Cardiology courses, congenital heart disease modules, and physiology labs use a Qp/Qs ratio calculator so learners can check Fick arithmetic without spreading a spreadsheet formula that silently divides by zero. Exam generators and LMS plugins need a deterministic oracle that rejects saturations outside zero to one hundred instead of inventing a ratio. Keep expectations educational: this is a calculation and learning tool, not a diagnostic medical device, and it does not replace catheterization reports, cardiac magnetic resonance flow mapping, or clinical judgment.
People with known congenital lesions, cyanosis, or an unexplained murmur should follow professional medical advice rather than any single automated ratio.
What you can do with it
Congenital cardiology teaching
Let students submit four site saturations and verify Qp/Qs plus shunt direction against the Fick identity used in class.
Catheterization worksheets and simulation
Lab simulators that already store aortic, mixed venous, pulmonary venous, and pulmonary arterial saturations compute Qp/Qs without a local formula fork.
LMS auto-grading of physiology items
Mark Qp/Qs homework with a deterministic oracle that rejects saturations outside 0–100 and never returns Infinity on a zero denominator.
FAQ
How is the Qp/Qs ratio calculated from oxygen saturations?
Qp/Qs = (SaO2 − SvO2) / (SpvO2 − SpaO2).
What saturations do I need for a Qp/Qs ratio?
Four oxygen saturations in percent: systemic arterial (aorta), mixed venous (typically SVC), pulmonary venous (often assumed near 98% if not sampled), and pulmonary arterial.
What happens if a saturation is outside 0 to 100?
Oxygen saturations must be between 0 and 100 inclusive; values outside that range are not billed.
What does a Qp/Qs of 2 mean?
Pulmonary blood flow is twice systemic flow, which points to a left-to-right shunt. A ratio of 1 means both flows are equal, as without a shunt, and a ratio below 1 points to a right-to-left shunt.
What if pulmonary venous saturation was not measured?
It is often assumed to be near 98% when no pulmonary vein sample is available, and many teaching cases use that figure. Enter the value your case or report states so the ratio matches it.
Related tools
For developers — API access
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.
API endpoint
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.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/health/qp-qs-ratio \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"sat_systemic_arterial":98,"sat_mixed_venous":70,"sat_pulmonary_venous":99,"sat_pulmonary_arterial":85}'const res = await fetch("https://api.kit.forhosting.com/health/qp-qs-ratio", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"sat_systemic_arterial": 98,
"sat_mixed_venous": 70,
"sat_pulmonary_venous": 99,
"sat_pulmonary_arterial": 85
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/health/qp-qs-ratio",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"sat_systemic_arterial": 98,
"sat_mixed_venous": 70,
"sat_pulmonary_venous": 99,
"sat_pulmonary_arterial": 85
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/health/qp-qs-ratio", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"sat_systemic_arterial":98,"sat_mixed_venous":70,"sat_pulmonary_venous":99,"sat_pulmonary_arterial":85}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"sat_systemic_arterial":98,"sat_mixed_venous":70,"sat_pulmonary_venous":99,"sat_pulmonary_arterial":85}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/health/qp-qs-ratio", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"sat_systemic_arterial": 98,
"sat_mixed_venous": 70,
"sat_pulmonary_venous": 99,
"sat_pulmonary_arterial": 85
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "health.qp_qs_ratio",
"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.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
Saturations outside the zero-to-one-hundred range, missing fields, non-finite values, and a zero denominator fail with invalid_input and are never billed.
What Qp/Qs measures and how four saturations yield the ratio
This endpoint implements that identity only: four percents in, one dimensionless ratio out, with no imaging, no hemoglobin correction, and no diagnostic claim about lesion type or surgical threshold.
Input contract, response shape, and error behaviour
Example: ninety-eight, seventy, ninety-nine, and eighty-five percent yield numerator twenty-eight, denominator fourteen, and Qp/Qs equal to two. POST a JSON body with four required finite numbers, each an oxygen saturation percent from zero through one hundred inclusive. sat_systemic_arterial is SaO2 (aliases sao2, aortic_sat, sat_ao, systemic_arterial, ao_sat). sat_mixed_venous is SvO2 (aliases svo2, mv_sat, sat_mv, mixed_venous, mixed_venous_sat). sat_pulmonary_venous is SpvO2 (aliases spvo2, pv_sat, sat_pv, pulmonary_venous, pulmonary_vein_sat). sat_pulmonary_arterial is SpaO2 (aliases spao2, pa_sat, sat_pa, pulmonary_arterial, pulmonary_artery_sat). Each field may arrive as a JSON number or as a numeric string. Missing fields, empty strings, and non-finite values fail with invalid_input naming the field. Any saturation strictly below zero or strictly above one hundred fails with invalid_input; that is the hard range this product enforces. If pulmonary venous saturation equals pulmonary arterial saturation the denominator is zero and the request fails rather than returning Infinity. On success the body echoes the four saturations, reports numerator and denominator, qp_qs as a stably rounded ratio, qp_qs_rounded to two decimal places for display, shunt_direction as left_to_right when the ratio is greater than one, balanced when it equals one, right_to_left when it is between zero and one, or inverted when the sign is negative, plus unit, formula, and method strings. Pair the JSON with your own charting if you need a plot; this endpoint computes the ratio only.
Where a Qp/Qs API earns its keep, pricing, and honest limits
Simulation and catheterization-worksheet backends that already store four site saturations can call a tiny parse API instead of reimplementing the identity in every language. Pin qp_qs in tests, treat shunt_direction as a teaching label rather than a surgical cutoff, convert pulse-oximeter readings to the same percent scale before you call, and never send partial pressures in millimetres of mercury without a saturation conversion of your own.
Technical questions
What does Qp/Qs greater than one mean?
Educationally, Qp/Qs > 1 is labeled left_to_right (pulmonary flow exceeds systemic flow). Qp/Qs = 1 is balanced, and 0 ≤ Qp/Qs < 1 is right_to_left. These labels are teaching aids, not a diagnosis or surgical threshold.
What does the Qp/Qs ratio calculator cost?
The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.