x402AgentTools

🏷️Discount Calculator

Calculate the final sale price and the amount saved for any price and percent-off discount, with the working shown.

Worked examples

20% off 79.99

GET /api/v1/calculators/discount-calculator?price=79.99&discount=20

Result: 63.99

50% off 240

GET /api/v1/calculators/discount-calculator?price=240&discount=50

Result: 120

12.5% off 1600

GET /api/v1/calculators/discount-calculator?price=1600&discount=12.5

Result: 1,400

Machine API (x402)

$0.001 / call

This tool is also a JSON API for AI agents. Requests without payment receive 402 Payment Required plus instructions; agents pay USDC on Base via the x402 protocol — no accounts, no API keys.

GET /api/v1/calculators/discount-calculator?price=79.99&discount=20 HTTP/1.1
Host: agenttools-hub.vercel.app

→ 402 (payment required, instructions in headers)
→ 200 (after X-PAYMENT header; JSON body below)

{
  "tool": "calculators/discount-calculator",
  "input": {"price":79.99,"discount":20},
  "result": { "value": 63.992, "answer": "63.99" }
}

Agent docs: /llms.txt · OpenAPI spec · integration guide

About this tool

Enter any original price and percent-off discount to get the final sale price and your total savings instantly, with each step of the calculation shown.

savings = price × discount ÷ 100 · final price = price − savings

Frequently asked questions

How do I calculate 20% off a price?

Multiply the price by 20, divide by 100 to get the savings, then subtract the savings from the original price. This tool does both steps for you.

Does the discount apply before or after tax?

Retailers almost always apply discounts to the pre-tax price. To include tax, calculate the discounted price first, then add VAT/sales tax with the VAT calculator.

Can I stack two discounts?

Sequential discounts multiply: 20% then 10% off equals 72% of the original price, not 70%. Apply this tool twice to see it.

Related tools