Calculators Works offline

Percentage Calculator

Four percentage calculators in one page — a share of a number, one number as a percentage of another, percentage change with an increase or decrease verdict, and adding or removing a percentage such as tax or a discount — each showing the formula and the substitution it used.

What is X% of Y?

Formula: X% of Y = (X ÷ 100) × Y

30

Substituted: (15 ÷ 100) × 200 = 30

Common percentages of 100

Common percentages and the value they represent, using 100 as the base
Percentage Of 100 As a decimal As a fraction
1%10.011/100
5%50.051/20
10%100.101/10
12.5%12.50.1251/8
20%200.201/5
25%250.251/4
33⅓%33.333…0.333…1/3
50%500.501/2
75%750.753/4
100%1001.001/1
Every mode recalculates as you type; the formula line and the substituted line always show exactly which arithmetic produced the number, and no value you enter leaves this page.

How the percentage calculator works

The page holds four independent calculators, each with its own two inputs and its own formula, shown beside the result. Mode 1 answers "what is X% of Y?" by converting the percentage to a fraction and multiplying: (X ÷ 100) × Y. Mode 2 inverts that relationship to express one number as a share of another, computing (X ÷ Y) × 100 and appending a percent sign. Mode 3 compares two measurements of the same quantity, subtracting to find the size of the move, dividing by the size of the starting value, and reporting both the percentage and whether it is an increase or a decrease — a move downwards is shown as a negative percentage so a fall is never mistaken for a rise. Mode 4 applies a percentage to a base, as tax, tip or markup adds it and a discount or deduction removes it, using Y × (1 + X ÷ 100) for an increase and Y × (1 − X ÷ 100) for a decrease.

Each panel recomputes as you type, and, importantly, prints the arithmetic it performed underneath the answer — Substituted: (30 ÷ 200) × 100 = 15% — so the result can be checked against the inputs without guessing which formula was used. Results are held to 12 significant digits for display and printed with thousands separators. That is deliberately a little less than the 15 to 17 significant decimal digits a JavaScript double can carry, and it is what keeps binary floating-point artefacts such as the 0.30000000000000004 produced by 0.1 + 0.2 out of an answer that should simply read 0.3.

The reference table below the four modes lists the percentages people reach for most often — 1, 5, 10, 12.5, 20, 25, 33⅓, 50, 75 and 100 percent — with the value each represents against a base of 100, plus the decimal and fraction equivalents. It is a fixed table, not a live conversion, and it renders even when scripts are switched off, which makes it a handy anchor for mental arithmetic: 12.5% of 100 is 12.5, so 12.5% of any number is that number divided by eight.

Accuracy, rounding and the limits of percentages

Percentages are exact arithmetic in principle, but three practical effects make a computed result differ from a figure someone else has already rounded. The first is rounding order. If a figure has already been rounded — a price to the nearest cent, a measurement to two decimal places, a population to the nearest thousand — then any percentage derived from it inherits that rounding, and the error grows when you multiply it back up. A rate computed from a rounded base can be off by several tenths of a percentage point without any of the arithmetic being wrong.

The second is stepwise rounding. This tool rounds once, at the end, and keeps full precision in between. Many billing and accounting systems instead round at each intermediate stage — tax per line item, currency conversion per shipment — and the accumulated difference is a cent or two rather than a mistake. When you are reconciling against an invoice, find out where the other system rounds before you conclude that either figure is wrong. The third effect is floating point itself: JavaScript numbers are IEEE 754 binary64, 0.1 has no exact binary representation, and a naive sum prints as 0.30000000000000004. The 12-significant-digit display rounding used here hides that noise, but it does not make the underlying arithmetic exact.

Percentages can also mislead without being numerically wrong. A 50% increase from a base of two is one unit, and identical headline percentages can describe wildly different absolute amounts. Always read a percentage change together with the base it was measured from, and for money calculate in whole cents and apply one documented rounding rule at the end.

How to use it

Choose the mode that matches your question with the buttons above the tool, or focus a button and use the arrow keys to move between them. Each mode keeps its own inputs, so switching back and forth does not lose what you typed. In mode 1 enter the percentage and the value it applies to; in mode 2 enter the part and the whole; in mode 3 enter the starting value and the ending value, in that order, because the sign of the answer depends on which is which; in mode 4 enter the percentage, the base value, and choose whether it is being added or subtracted with the radio buttons. Results update on every keystroke, so there is nothing to submit.

Mode 4 covers the everyday finance cases. To add value-added tax or sales tax, enter the rate, enter the pre-tax amount and leave Add selected; to take a discount off a marked price, enter the discount rate and the marked price and select Subtract. Note that subtracting a percentage does not reverse adding one — 20% added to 150 gives 180, and 20% taken off 180 gives 144, not 150 — so if you need the pre-tax amount from a tax-inclusive price, the substituted line will show you the multiplication that was reversed and you can divide by (1 + rate) instead.

All four modes are keyboard reachable, every input has a label, and each result sits in a live region so a screen reader announces the new value as it changes. Decimals, negative numbers and thousands separators are accepted in every field, and the layout is usable at 360 pixels wide. Because the whole calculator is one local script with no network calls, it works offline and nothing you enter leaves the page.

Frequently asked questions

What is the difference between "percent of" and "percent change"?

They answer different questions. "X percent of Y" takes a share of a single number and needs no second measurement: 15% of 200 is 30. "Percent change" compares two measurements of the same thing taken at different times and expresses the size of the move relative to where it started: from 200 to 230 is an increase of 30, which is 30 ÷ 200 = 0.15, so 15%. The base matters — a 15% rise followed by a 15% fall does not return you to the starting number, because the second calculation is taken from the larger base. From 200, a 15% rise gives 230, and 15% off 230 gives 195.5, not 200. That asymmetry is why percentage changes should always be read together with the base they were measured from.

Why does the total after adding a percentage sometimes look a cent out compared with my invoice?

Three separate things cause this. First, some systems round at every intermediate step — the tax on each line item — while this tool rounds once at the very end, so a five-line invoice can differ by a cent or two in either direction. Second, VAT or sales tax charged per line rather than on the subtotal produces a different total by design, not by error. Third, the underlying arithmetic is IEEE 754 binary floating point and cannot represent 0.1 exactly, which is why a raw calculation can print 0.30000000000000004; this page rounds its display to 12 significant digits so that noise stays invisible. For an amount that must balance to the cent, calculate in whole cents — multiply by 100, work in integers, and round once with a documented rule such as round-half-up.

How do I work out the original price before a discount, or the price before tax?

Work backwards from the percentage that remains. If an item is 30% off and you paid 70, then 70 is 70% of the original price, so the original is 70 ÷ 0.70 = 100. If a price of 120 includes 20% tax, then 120 is 120% of the pre-tax amount, so the pre-tax figure is 120 ÷ 1.20 = 100 and the tax is 20. This is the single most common percentage mistake: subtracting the percentage instead of dividing by (1 + rate). Taking 20% off 120 gives 96, which is not the pre-tax price. Mode 4 computes the division for you when you select subtract and read the result as the base.

What is the difference between percentage points and percent?

A percentage point is an absolute difference between two percentages; a percent is a relative one. If a rate moves from 20% to 25%, it has risen by 5 percentage points, but the relative increase is 5 ÷ 20 = 25%. Both statements are true and they are used to describe very different magnitudes, so news reporting that says "up 25%" without stating the base is genuinely ambiguous. Mode 3 on this page always computes the relative change, so enter 20 and 25 rather than 0.20 and 0.25 — the relative answer is the one it reports.

Sources & further reading