Percentage Calculator Widget
Add a percentage calculator to your website that answers the three questions readers actually ask: what is 15% of 200, what percent is 45 of 180, and how much did a value rise or fall. The change mode also spells out the difference in percentage points.
Live preview
Exactly what your visitors will seeUnder the widget on your page: Powered by A2Z Tools
Embed code
<iframe src="https://a2z.tools/embed/w/percentage-calculator" title="Percentage Calculator by A2Z Tools" width="100%" height="460" style="border:0;width:100%" loading="lazy" allow="clipboard-write"></iframe>
A plain iframe. Works everywhere, including site builders that strip scripts. Adjust height if your content needs more room.
<div data-a2z-widget="percentage-calculator" data-height="460"></div> <script async src="https://a2z.tools/embed.js"></script>
Adds a small script (what it does) that sizes the widget to fit its content, loads it lazily and keeps it isolated from your page's CSS.
Works with
How it works
A single select switches between the three percentage questions and shows only the two inputs that question needs. The maths comes from the same percent helpers as the A2Z Percentage Calculator page, so both give identical answers. Results are cleaned to 12 significant digits, which removes binary floating-point noise such as 0.30000000000000004. A change from zero is reported as undefined instead of an infinite percentage. Each mode answers with more than the bare number: "X% of Y" also gives Y with X% added and Y with X% taken away, which is what a shopper checking an 18% GST bill or a 25% discount actually wants; "X is what percent of Y" adds the plain fraction; and "percentage change" gives the direction in words (Increase or Decrease), the absolute difference and the new value as a percentage of the old. When both values are themselves percentages - an interest rate moving from 4% to 5% - the note separates the 1 percentage-point rise from the 25% relative rise, the distinction news reports most often blur.
Calculation method
- X% of Y = X / 100 x Y
- X as a percent of Y = X / Y x 100
- Percentage change = (new - old) / |old| x 100
- Percentage-point difference (when both values are percentages) = new - old
Worked examples
Exam marks to a percentage
Inputs: What is 43 as a percentage of 60 (a test scored out of 60)?
Result: 71.666667% (0.71666667 as a fraction)
43 / 60 x 100 = 71.666..., shown to six decimal places so nothing is hidden; a mark sheet would usually round it to 71.7% or 72%.
GST on a price
Inputs: Mode "What is X% of Y?", X = 18, Y = 2,499
Result: 18% of 2,499 = 449.82; Y plus X% = 2,948.82; Y minus X% = 2,049.18
18 / 100 x 2,499 = 449.82, so a 2,499 item with 18% tax added costs 2,948.82.
A restaurant tip
Inputs: Mode "What is X% of Y?", X = 15, Y = 64.80
Result: 15% of 64.8 = 9.72; bill plus tip = 74.52
The same row gives 55.08 for a 15% discount, useful for a voucher.
A score as a percentage
Inputs: Mode "X is what percent of Y?", X = 45, Y = 180
Result: 45 is 25% of 180; as a fraction 0.25
45 / 180 x 100 = 25.
A fall in monthly sales
Inputs: Mode "Percentage change", from 1,250 to 980
Result: Decrease 21.6%; difference -270; new value is 78.4% of the old
(980 - 1,250) / 1,250 x 100 = -21.6.
An interest rate rise
Inputs: Mode "Percentage change", from 4 to 5
Result: Increase 25%; difference +1; the note reads 1 percentage point versus a 25% relative change
Both answers are right; they describe the same move in two different units.
Limitations
- Successive changes are not chained: for growth over several years use the CAGR calculator, and for compounding use the compound interest calculator.
- No reverse percentages: it will not find the price before a 20% discount (divide by 0.8 for that).
- Successive changes are not chained - a 10% rise followed by a 10% fall is a 1% net fall, which needs two steps here.
- Results are rounded to 12 significant digits and shown with up to 6 decimals for percentages and 10 for amounts.
- Numbers only - no currency symbols, fractions such as 1/3, or percentages typed with a % sign inside the value box.
- Decimal commas (12,5) are refused as ambiguous; a point is required for decimals.
- Integers above about 9 quadrillion (2^53) lose exactness, because the arithmetic uses ordinary double-precision numbers.
Where publishers use it
- Maths lessons and homework-help pages on percentages
- Shopping and deal blogs that explain discounts and price rises
- News or data articles that report growth figures and need readers to check them
- Small-business guides that compare this month's sales with last month's
Questions
Is a percentile the same as a percentage?
No. A percentage is a share of a whole; a percentile ranks a value within a group. Scoring 80% on a test means 80 of 100 marks, while the 80th percentile means scoring higher than 80% of test-takers, whatever the marks were.
What is a basis point?
One hundredth of a percentage point, used for interest rates and yields. A rate moving from 6.50% to 6.75% has risen 25 basis points, which is 0.25 percentage points or a 3.85% relative increase.
Why does a 50% rise followed by a 50% fall not get back to the start?
Because each percentage applies to a different base. 100 rises 50% to 150, and a 50% fall from 150 is 75 - a net 25% loss. Successive changes multiply: 1.5 x 0.5 = 0.75.
How do I reverse a markup to find the original price?
Divide by one plus the rate rather than subtracting the percentage: a price of 118 after an 18% markup came from 118 / 1.18 = 100, whereas 118 minus 18% would wrongly give 96.76.
Why is the change from 0 not shown as a percentage?
Dividing by an old value of 0 has no finite answer - any increase from zero would be infinitely large. The widget says so and the difference in absolute terms is the meaningful figure.
What is the difference between percent and percentage points?
If an interest rate moves from 4% to 5%, it rose by 1 percentage point, but by 25% relative to where it started. The change mode shows both.
Why is a fall from -50 to -25 shown as an increase?
The change is measured against the size of the old value, so -25 is 25 higher than -50, which is a 50% increase relative to |-50|.
Can I preset the question and numbers?
Yes. Choose the mode and values in the builder; they are stored in the embed URL, for example v_mode=change&v_from=80&v_to=100.
If a price rises 50% and then falls 50%, is it back where it started?
No. 100 rises to 150, and 50% of 150 is 75, so it ends 25% below the start. Each percentage is taken of a different base; run the two steps separately in change mode to see it.
How do I find the original price before a discount?
Divide the sale price by (1 - discount / 100). A shirt selling at 1,200 after 25% off was 1,200 / 0.75 = 1,600. The widget does not do this reverse step for you.
Why can a percentage be more than 100?
A part can be larger than the base it is compared with: 270 is 150% of 180, and sales that triple have grown by 200%. Only shares of a fixed total, such as exam marks, stop at 100%.
What is a basis point?
One hundredth of a percentage point. A central bank cutting its policy rate from 6.50% to 6.25% cuts it by 25 basis points; change mode shows that as a difference of 0.25 and a relative fall of 3.85%.
Is this the same as markup, margin, percentile or CAGR?
No. Selling at 125 something that cost 100 is a 25% markup but a 20% margin; a percentile ranks a score within a group; and doubling over five years is a compound annual growth rate of about 14.87%, not 20% a year. Those need their own formulas.
Cite or recommend this tool
If you reference this tool in an article, course or documentation, these formats are ready to copy. They are optional - nothing is added to your site unless you paste it.
A2Z Tools Percentage Calculator https://a2z.tools/percentage-calculator
<a href="https://a2z.tools/percentage-calculator">A2Z Tools Percentage Calculator</a>
[A2Z Tools Percentage Calculator](https://a2z.tools/percentage-calculator)
Percentage Calculator by A2Z Tools - https://a2z.tools/percentage-calculator
Related widgets
-
Add, subtract, multiply and divide fractions and mixed numbers, with the simplified answer.
-
A clean on-screen calculator with keyboard support, correct operator precedence and percent.
-
The score you need on the final exam to reach a target grade, plus best and worst cases.
-
Trig in degrees or radians, logs, roots, powers, factorials, pi, e and Ans - typed or tapped.
-
Mean, median, mode, range, variance, standard deviation and quartiles of any list of numbers.
-
Credit-weighted GPA for a term, plus the new cumulative GPA when you add prior results.