What Percent Is X of Y? Percentage Calculator
When you know a partial amount and a total, this calculator tells you what percentage the partial amount represents.
Run — free
It answers everyday questions such as what percent 18 is of 24, what share of the available points a score earned, or what portion of a budget has been spent. Enter the part and the whole, choose the desired decimal precision, and receive a deterministic percentage, ratio, and formula without uploading a worksheet or relying on an external service.
Identify the part and the whole
Start by deciding which value is the part and which value is the whole. The part is the amount you want to compare, while the whole is the reference total that represents one complete unit, or 100 percent. In a test score of 18 points out of 24, 18 is the part and 24 is the whole. In a class where 21 of 28 students submitted an assignment, 21 is the part and 28 is the whole. Entering the values in the opposite order answers a different question, so labels such as “earned out of possible,” “used out of available,” or “completed out of planned” can help you place them correctly. The whole cannot be zero because division by zero has no defined percentage. Zero is valid as the part, however: zero completed tasks out of 12 planned tasks is exactly zero percent. The calculator also accepts negative finite values for mathematical comparisons, although most scores, counts, and quantities in ordinary percentage questions are nonnegative. Keep both values in the same unit before calculating; compare dollars with dollars, points with points, or kilograms with kilograms.
Apply and interpret the percentage formula
The calculation uses the standard relationship percentage = part divided by whole, multiplied by 100. For 18 out of 24, dividing 18 by 24 gives a ratio of 0.75, and multiplying by 100 gives 75 percent. A result below 100 percent means the part is smaller than the whole. Exactly 100 percent means the two values are equal, and a result above 100 percent means the part exceeds the reference whole. For example, 30 compared with 24 is 125 percent; percentages are not inherently capped at 100. The returned ratio is the same relationship before conversion to percent, making it useful when a worksheet or program expects a decimal such as 0.75. The formula text shows how the supplied numbers were arranged so you can review the setup, explain the work, or catch a reversed input. Choose decimal precision according to the situation: whole percentages are often sufficient for rough summaries, while grades, survey results, and measurements may need one or two decimal places. Rounding changes only the displayed result, not which mathematical relationship is being calculated.
Use the result responsibly in school and daily work
A percentage creates a common scale, which makes results with different totals easier to compare. A score of 18 out of 24 and a score of 30 out of 40 both become 75 percent even though their point totals differ. That convenience does not guarantee that every comparison is fair. Assessments can carry different weights, budgets can cover different periods, and survey samples can differ in size or composition. Use the percentage together with the underlying part and whole, especially when reporting a result to someone else. Avoid rounding too early in a multi-step calculation because a rounded intermediate value can slightly change the final answer. This tool performs one direct part-to-whole calculation and rounds the returned percentage and ratio only to the requested number of decimal places. It does not calculate percentage change, determine a missing part from a known percent, or combine weighted categories; those are related but distinct operations. Check that your inputs refer to the same population and time period. For automated work, each API request costs $0.002, and invalid values such as a missing number, non-finite number, out-of-range number, zero whole, or unsupported decimals produce a clear input error rather than a misleading result.
What you can do with it
Convert a score to a percentage
Compare points earned with total possible points to report a quiz, test, or assignment result.
Measure completion
Express completed tasks, submitted forms, or finished items as a share of the planned total.
Summarize a portion of a total
Calculate what share of a budget, inventory, sample, or attendance total is represented by one amount.
FAQ
What formula finds what percent X is of Y?
Divide X by Y and multiply by 100. In this calculator, X is the part and Y is the whole.
What percent is 18 of 24?
18 divided by 24 is 0.75. Multiplying by 100 gives 75 percent.
Can a result be greater than 100 percent?
Yes. A result exceeds 100 percent whenever the part is greater than the whole; for example, 30 is 125 percent of 24.
Why can the whole not be zero?
The formula divides by the whole, and division by zero is undefined, so a zero whole is rejected.
What does an API request cost?
Each API request costs $0.002. The browser calculator can perform the same deterministic arithmetic 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/edu/what-percent-is \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"part":18,"whole":24}'const res = await fetch("https://api.kit.forhosting.com/edu/what-percent-is", {
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/edu/what-percent-is",
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/edu/what-percent-is", 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/edu/what-percent-is", 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": "edu.what_percent_is",
"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. |