Percentage calculator
Work out percentages: X% of Y, what percent X is of Y, percent change, and increase or decrease by X%.
Input
Result
Fill in the input and press Run.
Your input is processed in memory and then discarded. It is not stored or logged. Even so, don't paste live passwords or keys into any online tool.
Use it from code or an agent
curl -s https://setget.net/v1/tools/percent \
-H 'Content-Type: application/json' \
-d '{"input":{"mode":"percent_of","x":15,"y":80}}'
import json, urllib.request
body = {'input': {'mode': 'percent_of', 'x': 15, 'y': 80}}
request = urllib.request.Request("https://setget.net/v1/tools/percent", json.dumps(body).encode(),
{"Content-Type": "application/json"})
print(json.load(urllib.request.urlopen(request))["result"])
const response = await fetch("https://setget.net/v1/tools/percent", {
method: "POST",
headers: {"Content-Type": "application/json"},
body: JSON.stringify({"input":{"mode":"percent_of","x":15,"y":80}}),
});
console.log((await response.json()).result);
Tool: run_tool
Arguments:
{
"slug": "percent",
"input": {
"mode": "percent_of",
"x": 15,
"y": 80
}
}
{
"input": {
"mode": "percent_of",
"x": 15,
"y": 80
}
}
Endpoint: POST /v1/tools/percent. Over MCP: run_tool with slug: "percent".
Machine-readable: input schema, Markdown. Connect an agent.
Inputs
| Name | Type | Required | What it does |
|---|---|---|---|
mode |
string | yes | What to work out: percent_of (X% of Y), what_percent (X is what % of Y), change (from X to Y), increase (Y plus X%) or decrease (Y minus X%). One of: percent_of, what_percent, change, increase, decrease. |
x |
number | yes | X: the percentage, or the first value, depending on the mode. From -1000000000000000.0 to 1000000000000000.0. |
y |
number | yes | Y: the amount the percentage applies to, or the second value. From -1000000000000000.0 to 1000000000000000.0. |
Examples
Input
{
"mode": "percent_of",
"x": 15,
"y": 80
}Result
{
"result": 12,
"formula": "80 * 15 / 100 = 12",
"text": "15% of 80 is 12"
}Percent change
Input
{
"mode": "change",
"x": 80,
"y": 100
}Result
{
"result": 25,
"formula": "(100 - 80) / 80 * 100 = 25",
"text": "From 80 to 100 is an increase of 25%"
}What percent
Input
{
"mode": "what_percent",
"x": 30,
"y": 120
}Result
{
"result": 25,
"formula": "30 / 120 * 100 = 25",
"text": "30 is 25% of 120"
}Questions
- Why is a rise from 80 to 100 25%, but a fall from 100 to 80 only 20%?
- Percent change is measured against the starting value. 20 is a quarter of 80 but only a fifth of 100.
- How do I take 20% off a price?
- Use mode "decrease" with x = 20 and y = the price.
Related tools
- Calculator and expression evaluatorWork out an arithmetic expression safely: brackets, powers, functions such as sqrt and log, and variables.
math-eval - Fraction and decimal converterConvert a decimal to a fraction or a fraction to a decimal, simplify a/b, and show mixed numbers.
fraction - Number formatterFormat a number with thousands separators, in scientific or compact form, as an ordinal, or in words.
number-format - Add or subtract time from a dateAdd or subtract years, months, weeks, days, hours and minutes from a date and get the resulting date.
date-add - Age calculatorWork out an exact age in years, months and days on a given date, plus the next birthday.
age-calculator - Aspect ratio calculatorSimplify a width and height to a ratio such as 16:9, and scale to a new width or height.
aspect-ratio