I once watched a friend talk himself into a jacket because the tag said "40% off, then take an extra 20% at the register." In his head that was 60% off. It wasn't - it was 52% - and the difference on a $180 jacket was about fifteen dollars he'd mentally already spent. That gap between the discount you think you're getting and the one you actually get is the entire reason I built the Discount Calculator on toolz.dev. Stacked discounts, in particular, almost never behave the way intuition says they should.
TL;DR: To find a sale price, multiply the original price by (100 − discount%) ÷ 100 - so 30% off a $50 item is $50 × 0.70 = $35. Stacked discounts multiply, they don't add: 20% off then an extra 10% off is 80% × 90% = 72% of the original, a 28% effective discount, not 30%. Sales tax is applied after the discount, on the price you actually pay. The calculator does all three at once and shows the true effective discount.
I build SaaS pricing pages and e-commerce flows for a living - Laravel on the back, React on the front - so I've had to get the discount math exactly right more times than I can count. This guide is that math, explained the way I'd explain it to a colleague, plus the edge cases that quietly cause bugs and overcharges.
What is a discount calculator and when do you need one?
A discount calculator answers two questions instantly: what will I pay, and how much will I save? You give it the original (list) price and the discount, and it returns the sale price and the amount off. That sounds trivial, and for a single "20% off" it nearly is. The value shows up the moment real-world pricing gets involved: stacked coupons, fixed-amount-off vouchers, and sales tax layered on top.
Shoppers use it to sanity-check whether a deal is as good as the sign claims. Sellers use it the other direction - to set a sale price that hits a target margin, or to see what a promotion actually costs them. I use it constantly when building checkout logic, because a discount rule that looks obvious in a spec ("apply 15% then a $10 coupon") has a specific order of operations, and getting that order wrong is the kind of bug that shows up as angry support tickets rather than a red test.
If you only ever need raw percentages - "what is 15% of 240?" - the Percentage Calculator is the leaner tool. The discount calculator is purpose-built for the pricing case: it speaks in original price, sale price, and money saved.
How do you calculate a percentage discount?
The core formula has two equivalent forms, and it's worth knowing both.
To find the amount off, multiply the price by the discount percentage divided by 100:
discount = price × (percent ÷ 100)
To find the sale price directly, multiply by what's left after the discount:
sale price = price × ((100 − percent) ÷ 100)
So for a $80 item at 25% off: the amount off is $80 × 0.25 = $20, and the sale price is $80 × 0.75 = $60. Both routes agree, as they must. The second form is the one I prefer in code because it's a single multiplication and it makes the "you pay 75% of the price" intuition explicit.
A quick mental shortcut for common cases: 10% off is just the price with the decimal shifted one place (10% of $45 is $4.50). Once you have 10%, you can build others - 20% is double it, 5% is half it, 30% is triple it. The Discount Calculator removes the arithmetic entirely and also shows the money saved alongside the sale price, but the shortcut is handy when you're standing in a shop with no signal.
Why don't stacked discounts add up?
This is the single most misunderstood thing in retail pricing, so it's worth being precise. When a store applies a second discount, it applies to the price after the first discount - not to the original. Percentages of different base amounts can't simply be summed.
Take 20% off followed by an extra 10% off. The first discount leaves you paying 80% of the original. The second takes 10% off that reduced price, leaving 90% of it. Multiply: 0.80 × 0.90 = 0.72. You pay 72% of the original, which is a 28% effective discount - not the 30% that adding 20 + 10 would suggest.
The gap widens with bigger numbers. "50% off plus an extra 50% off" sounds like everything's free, but it's 0.50 × 0.50 = 0.25 - you still pay a quarter of the original. This is precisely why my friend's "60% off" jacket was really 52%: 0.60 × 0.80 = 0.48 paid, so 52% off.
The order of the two percentage discounts doesn't change the result, because multiplication is commutative - 20% then 10% gives the same total as 10% then 20%. But mixing a percentage with a fixed-amount coupon is order-sensitive, which is the next trap.
Percentage off vs fixed amount off: which saves more?
A percentage discount scales with price; a fixed-amount discount doesn't. That means they cross over depending on how expensive the item is.
| Original price | 20% off | $15 off | Better deal |
|---|---|---|---|
| $50 | saves $10 → pay $40 | saves $15 → pay $35 | $15 off |
| $75 | saves $15 → pay $60 | saves $15 → pay $60 | tie |
| $120 | saves $24 → pay $96 | saves $15 → pay $105 | 20% off |
Below the break-even point (here, $75) the fixed coupon wins; above it, the percentage wins. That's why stores hand out "$15 off orders under $75" coupons - they're generous exactly where they cost the store the least relative to a percentage.
There's also a safety detail I bake into the tool: a fixed discount can never take the price below zero. If someone applies a $30-off coupon to a $20 item, the price is $0, not −$10. The calculator clamps it, which matches how real registers behave and avoids the negative-total bug I've seen in more than one hand-rolled checkout.
How does sales tax fit into a discounted price?
Tax is charged on the amount you actually pay, which means it comes after the discount. Discount first, then tax on the reduced price.
Work an example. A $60 sale price with 8% sales tax: the tax is $60 × 0.08 = $4.80, so the total at the register is $64.80. If you (incorrectly) taxed the original $80 first and then discounted, you'd get a different, wrong number - and you'd be overpaying tax on money you never spent. Getting this order right matters for anyone building a checkout, because tax authorities expect tax on the post-discount price for most standard promotions.
The Discount Calculator applies the operations in the correct sequence automatically: primary discount, then any stacked percentage, then tax on the result. It shows each stage - sale price, tax, final price - so you can verify the flow rather than trust a single number. When you're moving between currencies or units in a wider pricing model, the Unit Converter pairs well with it, and for splitting a discounted restaurant bill the Tip Calculator handles the gratuity side.
How do you find the original price from a sale price?
Sometimes you have the sale price and the discount and want to know what the item cost before - reverse-engineering a "was" price, or checking a supplier's claim. Divide the sale price by one minus the discount as a fraction:
original = sale price ÷ ((100 − percent) ÷ 100)
If an item is $45 after 25% off, the original was $45 ÷ 0.75 = $60. The trap here is dividing when you should multiply: people instinctively add 25% back to $45 and get $56.25, which is wrong, because the 25% was taken from the larger original, not the smaller sale price. Adding a percentage and removing a percentage are not inverse operations at the same rate - a lesson that also underlies a lot of everyday productivity math. The calculator works forward from the original price, but you can enter candidate originals to confirm which one lands on your known sale price.
What mistakes do people make with discounts?
A few recurring ones, drawn from both shopping and shipping code:
Adding stacked percentages. Covered above, and worth repeating because it's the costliest. Always multiply the remaining fractions.
Taxing before discounting. Tax belongs on the post-discount price. Reversing the order inflates the total.
Confusing markup with margin. A 50% markup on cost is not a 50% margin on price. If a $100-cost item sells at $150, that's a 50% markup but only a 33% margin. Discounts eat into margin fast, which is why "just take another 10% off" is a bigger deal for a business than it looks.
Ignoring the fixed-discount floor. A coupon larger than the price shouldn't create a negative total or, worse, pay the customer. Clamp it to zero.
Rounding at the wrong step. Round only the final displayed figures, not every intermediate value, or small errors compound. The toolz.dev calculator carries full precision through the calculation and rounds the presented numbers to two decimal places at the end. Everything runs in your browser, so the prices you type - which might be commercially sensitive - never leave your device, a principle I hold across all of toolz.dev and wrote about in the data privacy guide.
How do you set a discount that protects your margin?
If you're on the selling side, a discount isn't a gift to the customer so much as a bet against your own margin, and the math runs in reverse. Start from the number you can't cross: your cost. Say an item costs you $60 and normally sells for $100 - a healthy 40% margin. Knock 30% off the price and you're now selling at $70. Your margin didn't drop by 30%; it collapsed from $40 to $10, a two-thirds cut. That asymmetry is the thing that catches new store owners out, and it's why "just run a bigger sale" is rarely the free lever it looks like.
The rule I hold to when building promotion logic is to model the discount against cost, not against the list price. Before I commit a percentage to a campaign, I check what sale price it produces, subtract cost, and confirm the remaining margin still covers the per-order overhead - payment fees, packaging, the slice of support time each order tends to generate. A discount that leaves a positive gross margin can still lose money once those are counted. The Discount Calculator gives me the sale price in one step; the cost-and-overhead subtraction I do alongside it, and it's saved me from shipping more than one "promotion" that would have quietly sold inventory at a loss.
There's also a psychological layer worth respecting. Round, legible discounts - 25%, a third off, buy-one-get-one - read as trustworthy; oddly specific ones like 37% off invite suspicion that the "original" price was inflated to justify them. Regulators in several markets now police reference-price claims for exactly that reason, requiring that a "was" price be one the item genuinely sold at recently. So the honest way to present a markdown is also the durable one: pick a clean percentage, apply it to a real original price, and let the tool show the customer the same effective discount you calculated. When a promotion stacks a coupon on top, I always run the combined number first so the headline I advertise matches the register - because nothing erodes trust faster than a "60% off" sign that rings up as 52%. Getting that right is the same discipline I bring to every part of a checkout, and it pairs naturally with the broader habits in the developer productivity toolkit.
Frequently asked questions
How do I calculate a discount?
Multiply the original price by the discount percentage divided by 100 to get the amount off, then subtract it from the price. For a $80 item at 25% off, the discount is $80 × 0.25 = $20, so the sale price is $60. The Discount Calculator does that instantly and also shows the money saved.
How do I calculate the sale price after a percent off?
Subtract the discount percentage from 100 and multiply the price by that fraction. A 30%-off item costs 70% of its original price, so a $50 item becomes $50 × 0.70 = $35. Enter the price and percentage in the calculator to get the sale price and savings without the mental math.
How much do I save with a 20% discount?
You save one-fifth of the price. On a $45 item, 20% off saves $9, leaving $36. On a $200 item it saves $40, leaving $160. The calculator shows both the amount saved and the final price for any starting price you enter.
How does stacking an extra discount work?
A stacked coupon applies to the already-reduced price, not the original, so the percentages do not add. An item at 20% off then an extra 10% off costs 80% × 90% = 72% of the original - a 28% effective discount, not 30%. The calculator applies the extra percentage correctly and reports the true combined discount.
How do I add sales tax to a discounted price?
Tax is charged on the price you actually pay, so it applies after the discount. Take the discounted price, multiply by the tax rate divided by 100, and add it back. On a $60 sale price with 8% tax, the tax is $4.80 and the total is $64.80. Enter a tax rate in the calculator to include it in the final price.
How do I find the original price from a sale price?
Divide the sale price by one minus the discount as a fraction. If an item is $45 after 25% off, the original was $45 ÷ 0.75 = $60. Adding the percentage back to the sale price gives the wrong answer, because the discount was taken from the larger original amount.
What is the difference between a percentage and a fixed discount?
A percentage discount scales with the price - 10% off is more money on an expensive item - while a fixed discount takes the same currency amount off regardless of price. Fixed discounts save a larger share on cheaper items. The calculator supports both and caps a fixed amount at the price so the total never goes negative.
Are my prices kept private in the Discount Calculator?
Yes. Every calculation runs in your browser in plain JavaScript. The prices, discounts, and tax rate you enter are never transmitted, logged, or stored, and the tool keeps working with no network connection once the page has loaded.
Written by Liton, builder of toolz.dev and WP Adminify, who has shipped enough pricing pages in Laravel and React to respect the order of operations.



