Percentage calculator

Work out a percentage and see how the answer was reached: the value, a sentence, and the formula with your own numbers in it.

What is X% of Y?
15

25% of 60 is 15.

60 × 25 ÷ 100 = 15
X is what percent of Y?
25

15 is 25% of 60.

15 ÷ 60 × 100 = 25
What is the percentage change from X to Y?
50

From 40 to 60 is a change of 50%: a rise.

(60 - 40) ÷ 40 × 100 = 50
What is X changed by Y%?
48

60 changed by -20% is 48.

60 + 60 × -20 ÷ 100 = 48
X is Y% of what?
100

118 is 118% of 100.

118 ÷ (118 ÷ 100) = 100

The five formulas

Five different questions hide behind the phrase "percentage calculator", and answering the wrong one gives you a confident number for a question you never asked. All five are on the page at once for exactly that reason. Here they are as plain arithmetic, where X and Y are whatever you type into the two fields of that panel.

  • What is X% of Y? — Y × X ÷ 100. A 25% discount on 60 is 15 off.
  • X is what percent of Y? — X ÷ Y × 100. 15 out of 60 is 25%.
  • What is the percentage change from X to Y? — (Y − X) ÷ X × 100. From last month's 40 to this month's 60 is a rise of 50%.
  • What is X changed by Y%? — X + X × Y ÷ 100. 60 after a 20% discount is 48, in one step rather than in two.
  • X is Y% of what? — X ÷ (Y ÷ 100). If 118 is the price with 18% VAT already on it, the price before the VAT was 100.

One word runs through the rest of this page: the Base is the value a percentage is measured against — the number the arithmetic divides by. Two of the five have no Base at all, because they only ever divide by a hundred: "X% of Y" and "X changed by Y%" work for every pair of numbers you can type, and their answers always come out exact. The other three divide by a number you chose, which is why only those three can be asked a question that has no answer, and only those three can produce an answer whose digits never end.

A 20% rise and a 20% fall do not cancel out

Put 100 up by 20% and you have 120. Take 20% off that and you have 96, not 100. The two moves are the same size in percent and the same distance apart in words, and they still leave you 4% down.

Nothing has gone wrong. The two percentages are measured against different Bases: the rise is 20% of 100, which is 20, and the fall is 20% of 120, which is 24. A percentage is never a quantity on its own — it is a quantity relative to something, and the something changed in between.

The gap is a rule rather than an accident. A rise of any size followed by a fall of the same size always loses, and always loses the same amount: 10% and 10% leaves you 1% down, 20% and 20% leaves 4%, 50% and 50% leaves 25%. The order does not matter either, because multiplication does not care: fall 20% first and rise 20% after, and you land on 96 again.

This is where a stock reported as "down 50% then up 50%" is still down a quarter, and where a discount stacked on a discount is not the sum of the two. If you want to know what would actually get you back, ask the third panel: from 120 to 100 is a change of −16.6667%, not −20%.

Percentage points are not percent

A central bank moves the interest rate from 2% to 3%. Two newspapers report it. One says rates went up by one point, the other says rates went up by 50 percent. Both are right, and a reader who takes them as the same claim has misread the story by a factor of fifty.

  • A rise of one percentage point. This is the difference between the two figures, subtracted in the units they were already written in: 3 minus 2 is 1.
  • A rise of 50 percent. This is the change relative to where it started: 1 more on a starting value of 2 is half as much again.
  • The same event, two true sentences, two different numbers. The word "point" is what tells you which of the two is being quoted, and it is left out far more often than it should be.

The confusion is worth money in the direction you would expect. A fee that rises from 1% to 2% has risen by one percentage point and doubled; quoting it as "up 1%" makes a doubling sound like a rounding error. It runs the other way too: a poll moving from 40% to 44% is up four points, and describing that as "up 4%" understates it, since 4% of 40 would be 1.6 points.

There is no sixth panel for this, deliberately. Percentage points are subtraction — if you want the point difference, subtract the two figures, and you have it. What is worth having a tool for is the other reading, and that is the third panel: type 2 and 3 into the change panel and it tells you the same move is a rise of 50%.

Reversing a percentage is not subtracting it

An invoice comes to 118, and the 18% VAT is already in that figure. What was the price before the tax? The tempting move is to take 18% off 118, which gives 96.76. The correct answer is 100, and you can check it in one step: 100 plus 18% is 118, while 96.76 plus 18% is 114.1768.

The mistake is the same one as the section above, in a different coat. The 18% was added to the price before tax, so it is 18% of 100. Subtracting 18% takes it off the price after tax, so it takes off 18% of 118 — a bigger number than was ever added. Adding a percentage and taking the same percentage off are not inverse operations, and the difference is not small: here it is 3.24, over three percent of the pre-tax price.

It always rounds against you in the same direction, which is why it is worth knowing rather than merely worth avoiding. Reversing by subtraction understates the original figure every time, so a business that reverses its VAT this way under-reports its own pre-tax revenue on every invoice it issues.

The fifth panel is the reversal. Ask what 118 is 118% of and it answers 100. The same panel does discounts: a jacket costing 48 after 20% off is 48 at 80% of its old price, so ask what 48 is 80% of and it answers 60 — not the 57.6 you get by adding 20% back on.

When the change starts below zero

A business loses 10 one year and makes 10 the next. That is a recovery by any reading, and the standard formula for percentage change returns −200%. The tool shows you that figure, calls the change a rise in the sentence beneath it, and tells you the two disagree.

The sign comes out backwards because the Base is negative. The change itself is +20, and dividing +20 by −10 flips the sign of the result while the change it describes went upwards. Every real change measured from a negative starting value has this property, not just this one: below zero the sign of the percentage is the opposite of the direction it actually went.

The tool could take the absolute value of the Base and hand back a comfortable +200%. It deliberately does not. Spreadsheets, accounting packages and every textbook use the signed formula, so a tool that quietly used a different one would disagree with the figure you are checking it against, and you would have no way of knowing which of the two had changed the rules. The direction word is worked out separately, from the difference alone, so it stays right where the sign does not.

What that leaves you with is a figure you can reconcile with your spreadsheet and a sentence you can quote to a person, which are not the same sentence. In practice, percentage change from a negative Base is a number worth treating with suspicion in any report: "improved from a loss of 10 to a profit of 10" carries the fact, and "−200%" carries it wrongly however it is computed.

Commas, points, and which number you meant

This page exists in thirteen languages, and eight of them write the decimal separator as a comma. A tool that read 12,5 as one hundred and twenty-five would not be slightly wrong in those languages — it would be silently wrong in the majority of them, on numbers that look perfectly ordinary. So the reading is decided by the language of the page you are on, and never by the settings of the machine you are on.

Your own language comes first, and something that cannot be read that way but reads unambiguously the other way is still accepted. Paste 12.5 out of a spreadsheet onto a German page and you get twelve and a half, because there is no other number it could be. Nothing is said about it, because nothing was decided: only one reading existed.

What remains is the genuinely ambiguous case, and it is symmetric — it is not a problem that only comma languages have. A separator followed by exactly three digits can be a decimal separator or a thousands separator, whichever character it is. On this English page 1.234 could be one and a bit or one thousand two hundred and thirty-four, and 1,234 is ambiguous in precisely the same way; on a German or Spanish page the same two spellings raise the same two questions with the roles swapped. In every one of those cases the page language settles it and the tool announces which reading it used, so a guess you did not want is visible rather than buried in the answer.

Thousands separators are accepted wherever they cannot be mistaken for anything else, so 1,048,576 and 1 048 576 are both a million and a bit. Answers are written back with your own language's separators, so you can paste a result into the document the numbers came out of.

Exact answers, and the ones that had to be rounded

Percentages are arithmetic people check by hand, so the tool does not compute them the way a programming language would. It works in exact decimals rather than in the floating-point numbers a browser reaches for by default, which means an answer that can be written out in full is written out in full, however long it happens to be. 1 out of 512 is 0.1953125%, all seven places of it, and not 0.1953%.

Some answers cannot be written out at all. 1 out of 3 is 33.3333…% with the threes running forever, and no amount of care changes that. Those are shown to four decimal places — a figure you can actually use — and the tool says it rounded and offers a longer expansion beneath. The point of saying so is that you can tell the two situations apart: a number with no notice under it is the whole answer, not a tidied one.

That distinction only holds because the notice is rare, and it is rare by construction — though it is not limited to the answers that run on forever. The two panels with no Base divide by a hundred and by nothing else, so nothing they produce repeats endlessly. Multiply two long decimals together, though, and the exact answer can still be far longer than there is room to print: 0.0000001% of 1.23456789 comes out exact at seventeen decimal places, and it is shortened for display like anything else. The five worked examples the page starts with were chosen so that none of this touches them — every one is exact and short, so a notice sitting there before you have typed anything would mean something was genuinely being rounded.

Four decimal places is a good rule for a number near one and a useless one for a number near zero, where there is nothing left for it to show. So when an answer is too small for four places to say anything — anything under 0.00005 — the tool counts four significant digits instead, and the expansion beneath it counts twelve. That seventeen-place answer is shown as 0.000000001235, not as 0. The alternative was to print the 0 and leave the notice underneath carrying the only real figure on the panel, and it was rejected for turning the page upside down: the value is the answer and the notice is the admission, not the other way round.

Frequently asked questions

What is the difference between percent and percentage points?
A percentage point is the plain difference between two percentages, subtracted as they stand: 2% to 3% is a rise of one percentage point. Percent describes the change relative to where it started, and 2% to 3% is a rise of 50 percent. Both sentences are true about the same event and they differ by a factor of fifty here, so the word "point" is doing real work whenever it appears.
If a price goes up 20% and then down 20%, is it back where it started?
No — it is 4% below where it started. 100 becomes 120, and 20% of 120 is 24, so you come back down to 96. The fall is measured against a bigger number than the rise was. The same thing happens at every size: 10% and 10% leaves you 1% down, 50% and 50% leaves you 25% down. To get 120 back to 100 you need a fall of 16.6667%.
How do I work out the price before VAT was added?
Divide by the whole percentage, do not subtract the rate. If 118 includes 18% VAT, then 118 is 118% of the pre-tax price, so the answer is 100. Taking 18% off 118 gives 96.76, which is wrong by 3.24 and wrong in the same direction every time. The fifth panel does this directly: put the figure you have in the first field and the whole percentage — 118, or 120 for 20% VAT — in the second.
Why does the tool say −200% when the business improved?
Because the change is measured from a negative starting value. Going from a loss of 10 to a profit of 10 is a change of +20 divided by −10, which comes out negative even though the movement was upwards. That is the standard formula and the one your spreadsheet uses, so the tool keeps it rather than quietly using a different one, works the direction word out separately from the difference, and tells you the two disagree.
Why was I told which way my number was read?
Because it could have been read two ways and something had to decide. A separator with exactly three digits after it — 1,234 or 1.234, either character — is both a valid decimal and valid thousands grouping, so the language of the page settles it and the tool says what it settled on. It appears only when the reading was genuinely a choice: 12,5 and 12.5 both mean twelve and a half everywhere on this site, and neither is remarked on.
Why is my answer shown to four decimal places?
Because its exact value does not fit in a finite number of them — 1 out of 3 is 33.3333…% forever. When that happens the answer is shortened for reading and the tool tells you it did, with a longer expansion underneath. When an answer can be written out exactly it is written out exactly, however many places that takes, so a result with no notice under it has nothing hidden behind it. There is one departure, for answers too small for four places to show anything at all: under 0.00005 you get four significant digits instead, so 0.000000001235 rather than a bare 0.
Should I store percentages as floating-point numbers in my own code?
Not for money or anything you have to reconcile. Binary floating point cannot represent 0.1 exactly, so rates and prices drift by fractions of a cent and then fail to add up. Store the underlying integers — cents, basis points — or use a decimal type, and round once at the point of display. That is what this tool does internally, which is why its exact answers really are exact.
Is anything I type sent to a server?
No. All five calculations run in your browser as you type, nothing is uploaded or logged, and the page keeps working with no network connection at all.