Skip to main content

Discount Calculator

Computes final sale price under any of ten discount structures, with optional double or triple stacking and a price-target back-solve mode. Structures include percent-off, fixed-amount, buy-X-get-Y, Nth-item, multi-buy (N for M), N-for-fixed-price, and bundle, all constrained by an optional discount cap, price floor, and sales tax that applies before or after the discount. Output covers final price, total savings, effective price per unit, and savings per unit.

Runs entirely in your browser

This tool sends nothing over the network. Everything you enter is processed on your device and never reaches our servers.

Finance
Budget & Expense
Ecommerce
Retail
Shopping
Marketing
Loading the tool
Reference

Documentation

A discount calculator applies any of ten discount structures, percent off, fixed amount off, buy-X-get-Y, Nth-item percent off, multi-buy (N for M), N-for-fixed-price, bundle, and sequential double or triple stacking, to a subtotal, respecting an optional discount cap and price floor, and handling tax as configured. Each discount type ships with an example illustrating its structure.

Pricing runs from a single base unit price and item count, or from a cart table holding several products with independent prices and quantities. Tax can be marked as already included in the listed prices, with a configurable sales tax rate, and applied before or after the discount. A discount cap (as a percent or a flat dollar amount) and a price floor (as a percent of list price or a dollar amount per unit) constrain how far the discount can reduce the total. Results report the subtotal, the discount amount and percent, tax, the total after tax, the effective per-unit price, and the details of how the deal was applied.

Use the following plain-text formulas and logic for quick reference:

  • Percent off: discounted_subtotal = subtotal × (1 − p), where p is percent/100.
  • Fixed amount off: discounted_subtotal = max(0, subtotal − A).
  • Buy X get Y (discount d% on Y): set_size = X + Y; eligible_sets = floor(Q / set_size); discounted_units = eligible_sets × Y; savings = sum_of_highest_prices_for(discounted_units) × d.
  • Nth-item percent off: sort all unit prices descending; apply percent r to every Nth item starting at index N; savings = sum(selected_unit_prices) × r.
  • Multi-buy (N for M): eligible_sets = floor(Q / N); free_units = eligible_sets × (N − M); savings = sum_of_highest_prices_for(free_units).
  • N for fixed price ($B): eligible_sets = floor(Q / N); bundled_total = eligible_sets × B; unbundled_qty = Q mod N; unbundled_total = sum_of_highest_prices_for(unbundled_qty); savings = (normal_total − (bundled_total + unbundled_total)).
  • Bundle (size S): eligible_sets = floor(Q / S); apply benefit as configured:
    • Percent off on entire bundle: savings = bundle_value × percent.
    • Percent off on cheapest or most expensive items within bundles: savings = sum(target_items) × percent.
    • Amount off: savings = amount × eligible_sets.
    • Fixed bundle price: savings = (bundle_list_total − fixed_price) × eligible_sets.
  • Double/Triple discount (sequential): apply each discount in order to the remaining subtotal, not additively. Example: after percent a% then amount $b then percent c%:
    step1 = subtotal × (1 − a); step2 = max(0, step1 − b); step3 = step2 × (1 − c).
  • Price target: required_discount = max(0, subtotal − target); required_percent = (required_discount ÷ subtotal) × 100.
  • Cap: max_savings_% = subtotal × cap%; max_savings_$ = cap_amount; savings = min(savings, cap).
  • Price floor:
    floor_%: min_price = subtotal × floor%; max_savings = subtotal − min_price;
    floor_$ per unit: max_savings = subtotal − (floor_per_unit × total_units);
    savings = min(savings, max_savings).
  • Tax:
    • Discount before tax: tax = discounted_subtotal × rate; total = discounted_subtotal + tax.
    • Tax included in prices: pre_tax = discounted_subtotal ÷ (1 + rate); tax = pre_tax × rate; total = discounted_subtotal.
  • Per-unit metrics: effective_price = discounted_subtotal ÷ total_units; savings_per_unit = (subtotal ÷ total_units) − effective_price.
  • Tie-breaking when prices vary: when deals specify free or discounted units, higher-priced units are prioritized first for customer-friendly savings.

The formulas above cover retail and ecommerce scenarios where promotions must be compared, purchases planned, and pricing rules validated.

  • Comparing a "25% off" coupon against "3 for 2" finds the lower effective unit price.
  • Evaluating "Buy 2, get 1 free" with mixed prices shows how savings change by item mix.
  • Fitting a cart to a target subtotal (for free shipping or a budget limit) computes the required discount percent.
  • Enforcing price floors or caps simulates store policy and confirms compliant totals.
  • Including sales tax accurately tests "discount before tax" versus "tax-included" pricing.
  • Modeling bundle offers like "any 3 for $10" or "20% off the cheapest 3 in a set of 5."
  • Stacking sequential discounts reflects loyalty, coupon, and clearance reductions applied in order.
Inputs, outputs, and what the Discount Calculator computes

What the Discount Calculator asks for and what it returns, as a plain list. Defaults, units, and ranges are the ones the form loads with.

Inputs

  • Discount type · default: % off
  • Tax included? · default: off
  • Sales tax rate (%) (text input)
  • Apply discount before tax · default: on
  • Allow decimal quantities · default: off
  • Base unit price (text input)
  • Item count (text input) · default: 1
  • Target subtotal (text input)
  • Percent off (text input)
  • Amount off (text input)
  • Buy quantity (X) (text input)
  • Get quantity (Y) (text input)
  • Discount on Y (text input)
  • Nth (text input)
  • Percent off on Nth (text input)
  • N for M pattern (text input)
  • Get N (text input)
  • Pay M (text input)
  • N (text input)
  • Bundle price (text input)
  • Bundle size (text input)
  • Bundle scope · default: Same SKU
  • Bundle benefit · default: Percent off
  • Benefit value (text input)
  • Apply to · default: Entire bundle
  • First discount · default: Percent
  • First discount value (text input)
  • Second discount · default: Percent
  • Second discount value (text input)
  • Third discount · default: Percent
  • Third discount value (text input)
  • Allow stacking with structured deals? · default: off
  • Discount cap · default: None
  • Discount cap value (text input)
  • Price floor · default: None
  • Price floor value (text input)
  • Product name or SKU (text input)
  • List unit price (text input)
  • Override unit price (text input)
  • Quantity (text input)

Controls

Calculate · Reset