Percentage Calculator
Use this percentage calculator to find X% of Y, work out what percent one number is of another or recover the whole from a part. It explains the percentage formula, how to calculate percentages and how to find the percent of a number, with worked examples.
Calculate any percentage
Please provide any two values below and click the "Calculate" button to get the third value.
Percentage Calculator in Common Phrases
Select a phrase below and fill in the values to calculate.
A shop takes 20% off a $40 item, your exam paper says 42 out of 50, and the population of your town went from 8,000 to 9,200. Each is a different percentage question, and each needs a different sum. Mix up the base and the answer is wrong.
This online percentage calculator has a mode for each question: pick one, enter two numbers and it returns the third with the working shown. It finds a percentage of a number, what percent one number is of another, and the whole when you know a part and its percentage. For a specific job, such as discounts, change or measurement error, the dedicated calculators further down go deeper.
How to use the percentage calculator
Quick answer: to find X% of Y, multiply Y by X and divide by 100. 20% of 40 is 20 × 40 ÷ 100 = 8.
- Choose the mode that matches your question. Use "what is X% of Y" when you know the percentage and the whole, "X is what percent of Y" when you know two numbers, and "X is Y% of what" when you know a part and its percentage and want the whole.
- Enter the two numbers in the percent calculator. The whole is always the number that follows the word "of".
- Read the result and the working beneath it. If the answer looks wrong, check that the whole and the part are the right way round.
What is a percentage?
A percentage is a number written as a part of 100. The word comes from the Latin per centum, meaning "by the hundred", and the symbol % stands for it. One percent is one hundredth, so 1% = 1/100 = 0.01. Fifty percent is a half, 25% a quarter and 100% the whole. Percent is also written as two words, per cent, in British English.
Percentages are not capped at 100. A value of 150% of 40 is 60, and a price can rise by 300%. Every percentage problem has three parts: the rate (the percentage), the whole (the number the rate applies to) and the part (the result). Two of them are given and the third is the question.
Percentage formula and how to calculate percentages
part = percentage / 100 * wholepercentage = part / whole * 100whole = part / (percentage / 100)The percent equation has three forms, and they are one relationship rearranged. Pick the version that solves for the number you are missing.
How to find a percentage of a number (X% of Y)
How to calculate percentage of a number: turn the percentage into a decimal by dividing by 100, then multiply by the number. For 30% of 300: 30 ÷ 100 = 0.30, and 0.30 × 300 = 90.
How to find percentage: what percent is X of Y?
Divide the part by the whole and multiply by 100. If you scored 15 out of 60, then 15 ÷ 60 = 0.25, so you scored 25%. The order matters: 60 out of 15 is 400%, a different question.
How to find the percentage of two numbers
The percentage of two numbers is the first expressed as a share of the second. For 12 and 48, 12 ÷ 48 = 0.25, so 12 is 25% of 48. Name the whole before you divide: it is the number that follows "of".
How to find the whole when you know the part
Divide the part by the percentage as a decimal. If 45 is 15% of a number, then 45 ÷ 0.15 = 300. The reverse percentage calculator handles this case directly, including the common price-before-discount version.
Percent of total
A share of a total is the item divided by the sum of all items, times 100. Eighteen hours on one project out of 120 total hours is 18 ÷ 120 × 100 = 15%. The shares of all the parts add up to 100%, which makes this a good check on a spreadsheet.
Mental maths shortcuts for percentages
Here is how to do percentages in your head.
- 10%: move the decimal point one place left. 10% of 80 is 8.
- 1%: move it two places left. 1% of 80 is 0.8.
- 5%: half of 10%. 5% of 80 is 4.
- 15%: 10% plus 5%. 15% of 80 is 8 + 4 = 12.
- 25%: a quarter. 25% of 80 is 20.
- 75%: three quarters. 75% of 80 is 60.
- 33⅓%: a third. 33⅓% of 90 is 30.
Build other values from these pieces. 35% is 10% three times plus 5%, and 60% is half plus 10%.
Worked percentage examples
Example 1: 20 percent of 40
Given
Answer
Example 2: 15 out of 60 as a percentage
Given
Answer
Example 3: an exam score
Given
Answer
Example 4: a tip
Given
Step 1
0.18 × 64.50 = 11.61.
Answer
Example 5: a discount
Given
Step 1
0.25 × 120 = 30.
Answer
Example 6: sales tax
Given
Step 1
0.075 × 85 = 6.375, which rounds to $6.38.
Answer
Example 7: a share of a total
Given
Answer
Example 8: scaling a recipe
Given
Answer
Example 9: population growth
Given
Step 1
The change is 1,200, and 1,200 ÷ 8,000 = 0.15.
Answer
Example 10: finding the original number
Given
Answer
Convert between percentages, decimals and fractions
To turn a percentage into a decimal, divide by 100. To turn a decimal into a percentage, multiply by 100. For a fraction, divide the numerator by the denominator and then multiply by 100: 3/8 = 0.375 = 37.5%.
| Fraction | Decimal | Percentage |
|---|---|---|
| 1/2 | 0.5 | 50% |
| 1/4 | 0.25 | 25% |
| 1/5 | 0.2 | 20% |
| 1/8 | 0.125 | 12.5% |
| 3/4 | 0.75 | 75% |
| 1/3 | 0.3333… | 33.33% |
For other values use the fraction to percent calculator, the decimal to percent calculator or the percent to fraction calculator.
A ratio of 1:4 splits a total into 5 equal parts, so the first part is 1 ÷ 5 = 20% of the total. The ratio to percentage calculator converts any ratio this way.
Percentage calculator code
Four functions cover the three modes plus the percent change used in the worked examples. They reproduce the examples above (8, 90, 25%, 84%, 15%, +15% and 300) and reject a zero base.
JavaScript
const finite = (name, v) => { if (typeof v !== "number" || !Number.isFinite(v)) throw new TypeError(`${name} must be a finite number`);};export const percentOf = (percent, whole) => { finite("percent", percent); finite("whole", whole); return (percent / 100) * whole;};export const whatPercent = (part, whole) => { finite("part", part); finite("whole", whole); if (whole === 0) throw new RangeError("whole must not be 0"); return (part / whole) * 100;};export const percentChange = (from, to) => { finite("from", from); finite("to", to); if (from === 0) throw new RangeError("percent change from 0 is undefined"); return ((to - from) / Math.abs(from)) * 100;};export const wholeFromPart = (part, percent) => { finite("part", part); finite("percent", percent); if (percent === 0) throw new RangeError("percent must not be 0"); return part / (percent / 100);};Python
import mathdef _finite(name, v): if isinstance(v, bool) or not isinstance(v, (int, float)) or not math.isfinite(v): raise ValueError(f"{name} must be a finite number")def percent_of(percent, whole): _finite("percent", percent) _finite("whole", whole) return percent / 100 * wholedef what_percent(part, whole): _finite("part", part) _finite("whole", whole) if whole == 0: raise ZeroDivisionError("whole must not be 0") return part / whole * 100def percent_change(start, end): _finite("start", start) _finite("end", end) if start == 0: raise ZeroDivisionError("percent change from 0 is undefined") return (end - start) / abs(start) * 100def whole_from_part(part, percent): _finite("part", part) _finite("percent", percent) if percent == 0: raise ZeroDivisionError("percent must not be 0") return part / (percent / 100)Percent change divides by the absolute value of the starting number, so a move from −50 to −25 reports +50%. Other tools use the signed start and return −50%, so pick one convention and state it.
Privacy and input safety
Every calculation runs in your browser. The numbers you enter are not sent to a server or stored.
- Fields accept numbers only. Text, empty fields and NaN or Infinity are rejected with a message, never evaluated as code.
- A comma followed by exactly three digits is read as a thousands separator, so 1,200 is 1200. Any other comma is a decimal point, so 12,50 is 12.50, and a number starting with 0, such as 0,500, is read as a decimal. Mixed formats such as 1.234,5 and ambiguous entries such as 1,2,3 are refused instead of guessed. Spaces, including no-break spaces, between digit groups are ignored.
- A whole of 0 in "what percent" and a start of 0 in "percent change" return "undefined" with the reason, not a division error.
- Results are rounded for display only. The unrounded value feeds every later step.
Common percentage mistakes
| Mistake | What goes wrong | What the calculator does |
|---|---|---|
| Dividing by the wrong number | 60 ÷ 15 gives 400% when you wanted 15 ÷ 60 = 25% | Labels the part and the whole and shows the division |
| Forgetting to convert the percent | 20% × 40 read as 20 × 40 = 800 instead of 8 | Divides the percentage by 100 first |
| Confusing percentage points and percent | A rate moving from 4% to 6% is 2 percentage points but a 50% increase | Reports the percent change and states the base |
| Averaging an up and a down | +20% then −20% is not back to the start: 100 → 120 → 96, a 4% loss | Percent change mode on 100 and 96 returns −4% |
| Using the new value as the base | A rise from 80 to 100 is 25%, not 20%, because the base is 80 | Always uses the starting value |
| Believing 100% is the limit | 150% of 40 is 60, and increases above 100% are valid | Accepts values above 100 |
| Rounding early | Small errors grow through later steps | Rounds only the final figure |
Which percentage calculator should you use?
The three modes above answer most questions. These dedicated calculators go further on one job each.
| Your question | Formula | Calculator |
|---|---|---|
| How much did a value change from a start to an end? | (end − start) ÷ start × 100 | Percentage change |
| By what percent did a value grow? | (new − old) ÷ old × 100 | Percentage increase |
| By what percent did a value fall? | (old − new) ÷ old × 100 | Percentage decrease |
| How far apart are two values when neither is the reference? | abs(a − b) ÷ ((a + b) ÷ 2) × 100 | Percentage difference |
| How far is a measurement from the accepted value? | abs(measured − true) ÷ abs(true) × 100 | Percent error |
| What is the price after a discount? | price × (1 − percent ÷ 100) | Percent off |
| What was the number before a percentage was applied? | result ÷ (1 ± percent ÷ 100) | Reverse percentage |
| How do I add or take a percentage off a number? | number × (1 ± percent ÷ 100) | Add or subtract a percentage |
| What is the average of several percentages? | sum of the values ÷ count | Average percentage |
Percentage change, increase, decrease and difference
These four are easy to mix up. Change and its two halves, increase and decrease, compare a start with an end and use the start as the base. Difference compares two values that have equal standing, so it uses their average as the base and gives the same answer whichever order you enter them.
Percentage points vs percent
A percentage point is the plain gap between two percentages. A rate that moves from 4% to 6% has gone up 2 percentage points, which is a 50% increase. Finance also uses basis points, where 1 basis point is 0.01 of a percentage point, and per mille, which is parts per thousand. The percentage points guide covers the difference in full.
How to calculate percentage of marks
Percentage of marks is marks obtained ÷ total marks × 100. A score of 420 out of 500 is 420 ÷ 500 = 0.84, or 84%. In the calculator, use the "X is what percent of Y" mode, with the marks you scored as X and the total marks as Y.
For several subjects, add the marks obtained and add the totals, then divide once. Scores of 78, 85, 92, 66 and 79, each out of 100, total 400 out of 500, which is 80%. Add first when the totals differ: 45 out of 50 and 60 out of 100 make 105 out of 150, which is 70%, whereas averaging 90% and 60% gives 75% and over-rewards the short paper.
When every paper has the same total, the average percentage calculator gives the same answer. When papers count for different shares of the final grade, multiply each percentage by its weight and add: 80% × 0.6 + 70% × 0.4 = 76%. Grade boundaries and GPA depend on the exam board or school, so they sit outside this calculator.
Percentages in Excel and Google Sheets
In a spreadsheet, divide the part by the whole (=A2/B2) and format the cell as a percentage. For change, use =(B2-A2)/A2. The Excel percentage guide has copy-ready formulas for each case.