# Percentage Calculator

> The four questions people actually ask about percentages, plus the one they ask next, in a single calculator: what X% of Y is, what percentage one number is of another, the rise or fall between two figures, and a number with a percentage added or taken off. Every answer comes with the amount, the rate and the running total, so the figure cannot be read as the wrong quantity.

Use it: https://tessalor.com/en/maths/percentage-calculator

This tool runs entirely in the browser. Nothing entered into it is uploaded.

## Formula

```
Every percentage question is the same four quantities:

  base     the number the percentage is measured against
  percent  the rate
  amount   base x percent / 100
  after    base + amount

Each mode fixes two of them and the other two follow:

  A% of B             base = B,  percent = A
  A is what % of B    base = B,  amount  = A,      percent = amount / base x 100
  From A to B         base = A,  amount  = B - A,  percent = amount / base x 100
  A increased by B%   base = A,  percent = B
  A decreased by B%   base = A,  percent = -B

after = base + amount, in every mode, including the ones where the amount
is negative.

When base = 0 the percentage is undefined and the tool says so rather than
dividing.
```

## Assumptions

- Percentage change is measured against where you started, never where you ended. From 40 to 50 is a 25% rise; the same 10 over 50 would be 20%, and the two are different answers to different questions.
- With a negative starting value the sign follows the textbook formula rather than the direction of travel. From -40 to -50 reads as a 25% increase, because the size of the figure grew by a quarter.
- A base of zero has no percentage, so the answer is a dash. An infinite figure on a page somebody is checking a bill against is worse than no figure at all.
- Arithmetic is decimal, not binary floating point. 10% of 1.15 comes out as 0.115 rather than 0.11499999999999999, which is what the same sum gives in a double.
- Figures are carried to ten decimal places and displayed to two. The sentence beside the answer rounds to four, because a repeating decimal written out in full is unreadable in prose.
- Nothing is rounded to a currency. The tool does not know whether the numbers are pounds, kilograms or exam marks, so it will not silently turn 0.435 into 0.44.

## Inputs

| Name | Label | Type | Default | Range |
| --- | --- | --- | --- | --- |
| `mode` | What are you working out? | select | of |  |
| `a` | First number (A) | number | 15 | -1000000000000 to 1000000000000 |
| `b` | Second number (B) | number | 200 | -1000000000000 to 1000000000000 |

## Outputs

- `result` — Answer (number), primary
- `sentence` — In words (text)
- `amount` — The amount (number)
- `percentage` — As a percentage (percent)
- `after` — Starting value plus the amount (number)

## Questions

### How do I work out the percentage change between two numbers?

Subtract the old value from the new one, divide by the old value, and multiply by 100. The division is always by where you started, which is the step people skip: from 40 to 50 is a 25% rise, and from 50 to 40 is a 20% fall, even though both moved by ten. A change is only meaningful relative to its own starting point.

### Why does a 50% fall not get undone by a 50% rise?

Because the second percentage is taken of a smaller number. 100 less 50% is 50, and 50 plus 50% is 75, not 100. Getting back to 100 from 50 takes a 100% rise. The same asymmetry is why two stacked discounts never add up to the sum of the two.

### Why is the answer showing a dash?

Because the number being measured against is zero, and nothing has a percentage of zero. "30 is what per cent of 0" and "the change from 0 to 50" both have no finite answer, so the tool shows a dash rather than inventing one. Change the second number and the answer returns.

### Why does 10% of 1.15 come out as 0.115 here and 0.11499999999999999 elsewhere?

Because most calculators, including every one built on a plain JavaScript number, work in binary floating point, which cannot represent 1.15 or 0.1 exactly. This tool does the arithmetic in decimal, so the answer is the one you would get on paper. The difference is tiny until it is multiplied by a few thousand rows.

### Are the numbers I type sent anywhere?

No. The calculation runs in this browser tab and there is no server to send it to. The figures do appear in the address bar so a link can carry them to somebody else, and a fragment after the # is never transmitted in an HTTP request.

## Sources

- [NIST Guide to the SI (Special Publication 811)](https://www.nist.gov/pml/special-publication-811) — National Institute of Standards and Technology. Retrieved 2026-07-30.
- [A to Z style guide](https://guidance.publishing.service.gov.uk/writing-to-gov-uk-standards/style-guides/a-to-z-style-guide/) — Government Digital Service, applies to 2026. Retrieved 2026-07-30.
- [ECMAScript Language Specification: the Number type](https://tc39.es/ecma262/#sec-ecmascript-language-types-number-type) — Ecma International. Retrieved 2026-07-30.

## Variants

- [How do you work out the percentage increase between two numbers?](https://tessalor.com/en/maths/percentage-calculator/increase-between-two-numbers)
- [How do I work out 20% off a price?](https://tessalor.com/en/maths/percentage-calculator/percent-off-a-price)

---

Estimate, not advice. See https://tessalor.com/en/disclaimer.
Machine-readable catalogue: https://tessalor.com/api/tools.json
