Percentage formulas
“Percent” means “per hundred”, so 20% is 20/100 = 0.2. Every calculation above is one of these formulas:
| Question | Formula | Example |
|---|---|---|
| What is X% of Y? | X ÷ 100 × Y | 20% of 150 is 30. |
| X is what % of Y? | X ÷ Y × 100 | 45 is 75% of 60. |
| % change from A to B | (B − A) ÷ |A| × 100 | Going from 80 to 100 is a 25% increase. |
| X is P% of what? | X ÷ (P ÷ 100) | 30 is 20% of 150. |
| Increase Y by P% | Y × (1 + P ÷ 100) | 200 increased by 15% is 230. |
| Decrease Y by P% | Y × (1 − P ÷ 100) | 80 decreased by 25% is 60. |
| % difference | |A − B| ÷ ((|A| + |B|) ÷ 2) × 100 | The percentage difference between 10 and 15 is 40%. |
How to calculate a percentage of a number
Divide the percentage by 100 and multiply by the number. 20% of 150 is 0.20 × 150 = 30. A quick mental shortcut: 10% is the number with the decimal point moved one place left, so 10% of 150 is 15, double it for 20%, halve it for 5%.
| Question | Answer |
|---|---|
| 10% of 50 | 5 |
| 25% of 200 | 50 |
| 15% of 60 | 9 |
| 33% of 300 | 99 |
| 5% of 1,250 | 62.5 |
| 12.5% of 80 | 10 |
Percentage change vs. percentage difference
Percentage change has a direction: it compares a new value to an old one. Going from 80 to 100 is a 25% increase. Going from 250 to 200 is a 20% decrease. Note that a rise and a fall of the same amount aren’t symmetric, going from 100 to 80 is −20%, but from 80 back to 100 is +25%.
Percentage difference compares two values with no “before” and “after”, dividing by their average. Use it to compare two prices, two measurements or two products. The percentage difference between 10 and 15 is 40%.
Don’t confuse either with percentage points. If an interest rate moves from 4% to 5%, it rose by one percentage point, but by 25% in relative terms.
Negative numbers, zero and other edge cases
These results come from running the calculator's own code.
- Negative starting value. Change divides by the absolute value of the start, so going from -50 to -25 is
(-25 − -50) ÷ |-50| × 100 = +50%. The sign then reads as "moved up", which is the usual convention for values that start below zero. - Zero as the start. Change from 0 is refused with an explanation. A zero whole in "X is what % of Y", a 0% in "X is P% of what", and 0 against 0 in percentage difference are refused too.
- Mixed signs in percentage difference. The average uses the absolute values, so the result is always positive and symmetric: swapping A and B gives the same number.
- Numbers you can type. Commas, a trailing %, a leading + or -, decimals like
.5or5.and exponents like1e3are accepted. Spaces inside a number (1 000) are rejected. - Very large values.
1e21% of 5 shows 50,000,000,000,000,000,000, since the display switches to a full integer instead of exponent notation.
Rounding and floating point
JavaScript stores every number as a 64-bit IEEE 754 binary float, which cannot represent most decimals exactly. For example
7 ÷ 100 × 100 evaluates to 7.000000000000001 and 1.1 × 3 to 3.3000000000000003.
Before display, the calculator rounds each result to at most 10 decimal places and drops trailing zeros, so those come out as 7 and 3.3.
Percentage difference of 50 and 100 is shown as 66.6666666667%, not a repeating decimal. Two limits follow from this: a result
smaller than 5 × 10⁻¹¹ displays as 0, and results above about 15 significant digits carry binary rounding error. For money, round the
final figure to cents yourself.
Everyday examples
Tips
On an $80 bill: 15% is $12, 18% is $14.4, 20% is $16, 25% is $20.
Discounts
A 25% discount on $80 leaves you paying 75% of the price: 80 decreased by 25% is 60. Two discounts stack by multiplying, 20% off then 10% off is 0.8 × 0.9 = 0.72 of the price, a 28% total discount, not 30%.
Grades and scores
45 is 75% of 60. That is 45 correct answers out of 60.
Reverse percentages
If $30 is the 20% deposit, the full price is the “of what” question: 30 is 20% of 150.
FAQ
How do I work out a percentage increase between two numbers?
Subtract the old value from the new one, divide by the old value and multiply by 100. Use the “Percentage change” row; a negative result means a decrease.
Why is percentage change from 0 undefined?
The formula divides by the starting value. Going from 0 to anything is an infinite relative increase, so the calculator tells you instead of showing a misleading number.
How do I add a percentage to a number?
Multiply by 1 plus the percentage as a decimal: adding 15% to 200 is 200 × 1.15 = 230. Use the “Increase” row.
Can I use commas or the % sign?
Yes. 1,250 and 15% are read as 1250 and 15.
Why does a 20% drop followed by a 20% rise not return to the start?
The second percentage applies to a smaller base. From 100, a 20% drop gives 80, and 20% of 80 is only 16, so you land on 96. You need +25% to get back to 100.
Which row do I use for "what percent of the total is this"?
"X is what % of Y". Put the part in X and the total in Y: 45 of 60 is 75%.
Why does the percentage difference of 50 and 100 differ from the change from 50 to 100?
Change divides by the starting value (50), giving +100%. Difference divides by the average (75), giving 66.6666666667%. Pick change when there is a before and an after, difference when there is not.
Why do my spreadsheet and this page disagree in the last digits?
Both use IEEE 754 doubles, but this page rounds to 10 decimals before display and a spreadsheet may show 15 significant digits or round differently. The mathematical result is the same.
Method and sources
The formulas are the standard definitions: a percentage is a ratio multiplied by 100; relative change is (new − old) ÷ |old|; and
percentage difference divides the absolute gap by the mean of the two magnitudes, a symmetric form used when neither value is a reference.
Arithmetic follows ECMAScript's Number type, which is the IEEE 754 binary64 format (the current revision is IEEE 754-2019), and the output
uses toLocaleString with the en-US convention for thousands separators.