Discount calculator
Sale price after a percentage or fixed discount, an optional stacked second discount and sales tax.
- Version 1
- Free, no sign-up
Examples
Example: 25% off 80
| Discount amount First discount. |
20.00 exact |
|---|---|
| Additional discount amount Second discount. |
0.00 exact |
| Price after discount Price after both discounts. |
60.00 exact |
| Tax amount Sales tax on the discounted price. |
0.00 exact |
| Final price Price after discounts plus tax. |
60.00 exact |
| Total savings Both discounts together. |
20.00 exact |
| Effective discount percent Total savings as a percent of the price. Unit: percent. |
25.00 exact |
Rounding: Half even, 2 decimal places. Calculator everyday/discount@1.
How it is calculated
after = price − d₁ − (price − d₁)·p₂; final = after + after·taxApplies a discount (percent or amount), then an optional second percentage discount on the reduced price (the way '20% off, then an extra 10%' works in shops), then sales tax. Each money amount is rounded to the cent and the totals are built from those rounded amounts, so the figures always add up.
- Amounts are plain numbers in any single currency; no currency conversion is done.
References
Results follow each calculator's documented rules and the sources listed. They are not financial, tax or legal advice. Check that the rules fit your case before you rely on a result. See the terms.
Use it from your code
curl https://api.curatedapi.com/v1/calc/everyday/discount \
-H "Authorization: Bearer $CURATEDAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"price": "80",
"discount_percent": "25"
}'
The same call in Python
import os
import requests
payload = {
"price": "80",
"discount_percent": "25",
}
response = requests.post(
"https://api.curatedapi.com/v1/calc/everyday/discount",
headers={"Authorization": f"Bearer {os.environ['CURATEDAPI_KEY']}"},
json=payload,
timeout=10,
)
print(response.json()["result"])
The same call in JavaScript
const payload = {
"price": "80",
"discount_percent": "25",
};
const response = await fetch("https://api.curatedapi.com/v1/calc/everyday/discount", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.CURATEDAPI_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify(payload),
});
console.log((await response.json()).result);
MCP tool calc_everyday_discount at https://mcp.curatedapi.com.
Inputs, outputs and errors in the API reference.
Put it on your website
<div data-curatedapi-widget="everyday/discount" data-key="capi_public_…"></div>
<script src="https://widgets.curatedapi.com/v1/widget.js" async></script>
Use a public key registered for your site. Calculations are billed like API calls. How widgets work.
Related calculators
Add this calculator to your website
Paste two lines into your page and your visitors get this calculator. Each use counts as one call on your plan, the same as the API.
Free for up to 1,000 uses a month. 50,000 uses a month cost $9.00 on the Starter plan.