How the Discount Calculator Works
The calculator offers five modes built on simple price identities. Percent off computes sale price = original × (1 − percent ÷ 100) and savings = original − sale. Amount off subtracts a flat coupon value from the price. Reverse recovers the original from a discounted price as original = sale ÷ (1 − percent ÷ 100). Find-% derives the discount as percent = (original − sale) ÷ original. Stacked applies a sequence of percentage discounts in order, multiplying the survival factors. Every result is produced by a pure function in a small, unit-tested engine, with the worked formula shown and an optional sales tax applied after the discount.
- Percent off: sale = original × (1 − percent ÷ 100)
- Amount off: sale = original − flat coupon value
- Reverse: original = sale ÷ (1 − percent ÷ 100)
- Find %: percent = (original − sale) ÷ original × 100
- All math is client-side JavaScript with no server round-trip
