Simplify and scale a ratio
This ratio simplifier handles the two operations that usually belong together. Enter two or three non-negative numbers, and it reduces their relationship to the smallest whole-number terms.
Run — free
Add a target total, and it also calculates the proportional amount assigned to every term. The result shows the original ratio, its lowest-term form, the number of simplified parts, the multiplier, and the scaled values. It works with whole numbers, zeros, and terminating decimals, making it useful for recipes, allocations, mixtures, plans, and classroom checks.
Reduce two or three terms without losing their relationship
A ratio describes relative shares, so multiplying or dividing every term by the same value leaves the relationship unchanged. The calculator first converts each supplied number into an exact integer representation. This matters when the input includes terminating decimals such as 1.5:2.25, because treating those values as approximate display text can produce an awkward answer. It then finds the greatest common divisor shared by all terms and divides each integer term by that divisor. For example, 18:24 becomes 3:4, while 6:9:15 becomes 2:3:5. Zero is allowed as an individual term because ratios such as 0:4:8 have a useful reduced form of 0:1:2. However, every term cannot be zero: 0:0 has no positive number of parts and therefore cannot be scaled. The output preserves the original numeric entries and provides both an array and a colon-separated version of the simplified ratio, so it is convenient for people and straightforward for software to consume.
Scale the simplified parts to an exact target total
After simplification, the calculator adds the reduced terms to find the total number of ratio parts. It divides the requested target total by that part count to obtain the scale factor, then multiplies each simplified term by the factor. Suppose a budget is divided in the ratio 2:3:5 and the available total is 1,000. There are ten parts, each part is worth 100, and the scaled result is 200, 300, and 500. The same method works when the result is fractional. A ratio of 1:2 scaled to a total of 10 produces 3.33333333333 and 6.66666666667 using stable output precision. The calculation is based on the simplified integers, which keeps the method transparent and avoids changing the intended proportions. A target total of zero is valid and produces zero for every scaled term. Negative totals are rejected because a share allocation with a negative target does not fit this calculator’s non-negative ratio model.
Choose valid inputs and interpret the returned fields
Provide exactly two or three finite numeric terms. Negative ratio terms always cause an input error, as do missing values, NaN, infinity, an all-zero ratio, or a list with the wrong number of entries. The target total must also be a finite, non-negative number. In the response, original_ratio repeats the accepted terms, while simplified_ratio contains the lowest whole-number form. The parts_total field is the sum of those simplified terms. The scale_factor tells you how much one simplified part is worth at the requested total, and scaled_ratio lists the final allocations in the same order as the input. Units are deliberately not attached: if the total represents grams, dollars, liters, seats, or hours, every scaled value uses that same unit. This makes the capability reusable without pretending to convert measurements. For production automation, keep the returned numeric array rather than parsing the colon-separated display string, and apply any domain-specific rounding only after deciding how remainders should be handled.
What you can do with it
Resize a recipe or mixture
Reduce ingredient proportions and calculate the amount of each component needed for a new batch total.
Allocate a fixed budget
Turn departmental weights into transparent shares whose proportional amounts match the available budget.
Check ratio homework
Verify the lowest-term form of a two- or three-number ratio and see how it scales to a stated total.
FAQ
How much does the ratio calculation cost?
The API costs $0.002 per request. You can also run the same deterministic calculation free in your browser.
Can I simplify a three-part ratio?
Yes. Supply exactly two or three terms; all terms are reduced together using their shared greatest common divisor.
Are decimal ratio terms supported?
Yes. Finite terminating decimal inputs are converted to an exact integer relationship before the ratio is reduced.
Can a ratio contain zero?
An individual term may be zero, but at least one term must be greater than zero. An all-zero ratio cannot be scaled.
What happens if a ratio term is negative?
The request returns an invalid input error. Every ratio term must be non-negative.
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/calc2/ratio-simplify \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"terms":[2,3,5],"total":100}'const res = await fetch("https://api.kit.forhosting.com/calc2/ratio-simplify", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"terms": [
2,
3,
5
],
"total": 100
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/calc2/ratio-simplify",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"terms": [
2,
3,
5
],
"total": 100
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/calc2/ratio-simplify", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"terms":[2,3,5],"total":100}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"terms":[2,3,5],"total":100}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/calc2/ratio-simplify", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"terms": [
2,
3,
5
],
"total": 100
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "calc2.ratio_simplify",
"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. |