What percent of calculator
The what percent of calculator answers a common comparison question: what percentage does one number represent of another?
Run — free
Enter the part you want to compare and the nonzero whole that provides the reference. The calculator divides the part by the whole and multiplies the result by 100. It returns the ratio, percentage, and calculation together, making the answer easy to review, explain, or use in another workflow. Positive, negative, fractional, and above-whole comparisons are supported.
Choose the part and whole correctly
Start by deciding which number is the part and which is the whole. The part is the quantity you want to express as a percentage. The whole is the reference quantity that represents one complete unit for this comparison. For example, if 18 students out of a class of 24 submitted an assignment, 18 is the part and 24 is the whole. Entering them in the opposite order answers a different question, so the labels matter more than the size of either number. The part does not need to be smaller than the whole. A part of 30 against a whole of 24 is valid and produces 125 percent, indicating that the part is one and one-quarter times the reference. Decimal and negative inputs are also accepted when they make sense in your context. The only forbidden reference is zero because no finite percentage can describe a number as a share of zero. Before using the result, state the comparison in words: “the part is what percent of the whole?” This quick check prevents the most common input reversal.
Understand the calculation and result
The formula is percentage = part divided by whole, multiplied by 100. Division first converts the comparison into a ratio. Multiplying by 100 expresses that ratio in hundredths, which is what the percent symbol means. With a part of 18 and a whole of 24, the ratio is 0.75 and the percentage is 75. The response includes both values so you can use the representation best suited to your work. A ratio of 1 corresponds to 100 percent, a ratio below 1 has a magnitude below 100 percent, and a ratio above 1 has a magnitude above 100 percent. If the part is zero and the whole is nonzero, the answer is 0 percent. Signs are preserved: numbers with opposite signs produce a negative percentage, while two negative numbers produce a positive percentage. The calculator uses standard JavaScript floating-point arithmetic and does not silently round the returned number. For display or reporting, apply rounding appropriate to your domain rather than assuming that every percentage should have the same number of decimal places.
Use percentages without losing context
A percentage makes quantities with different scales easier to compare, but it is meaningful only when the whole is clearly defined. In reporting, name the reference alongside the result: say “18 submissions out of 24 enrolled students, or 75 percent,” rather than presenting 75 percent alone. This matters when totals can change, when records have been excluded, or when two teams use different denominators. Values above 100 percent are not errors; they show that the part exceeds the chosen whole. Negative results are mathematically valid too, though you should explain what a negative part or reference represents. For automated use, validate the business meaning before sending the numbers and handle an invalid-input response when the whole is zero or either value is not a finite number. The API calculation is deterministic and performs no network calls, so identical numeric inputs produce identical outputs. The base request price is $0.002. Store the original part and whole with the result whenever auditability matters, because a percentage alone cannot reconstruct the scale of the original comparison or prove which denominator was used.
What you can do with it
Report completion rates
Compare completed items with the total assigned and retain both source values beside the percentage.
Measure budget usage
Express an amount spent as a percentage of a nonzero approved budget, including cases above 100 percent.
Compare measured values
Convert one measurement into a percentage of a reference value for dashboards, checks, or explanations.
FAQ
What formula does the calculator use?
It calculates (part / whole) × 100. The response also includes the unscaled ratio.
Can the percentage be greater than 100?
Yes. A result above 100 percent means the part is larger than the whole used as the reference.
Why is a zero whole rejected?
Division by zero does not produce a finite percentage, so the capability returns an invalid-input error.
Can I use decimal or negative numbers?
Yes. Any finite numeric part and any finite nonzero whole are accepted, with their signs preserved in the result.
How much does an API calculation cost?
Each API request costs $0.002. The browser calculator can run the same deterministic calculation locally.
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/algebra/is-what-percent-of \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"part":18,"whole":24}'const res = await fetch("https://api.kit.forhosting.com/algebra/is-what-percent-of", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"part": 18,
"whole": 24
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/algebra/is-what-percent-of",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"part": 18,
"whole": 24
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/algebra/is-what-percent-of", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"part":18,"whole":24}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"part":18,"whole":24}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/algebra/is-what-percent-of", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"part": 18,
"whole": 24
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "algebra.is_what_percent_of",
"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. |