Discount Calculator
Calculate sale prices, discount amounts, and savings instantly.
Discount Calculator instantly computes the sale price after a percentage discount is applied, or tells you what discount percentage you are receiving given an original and sale price. It is useful for shoppers evaluating deals, retailers setting promotional prices, and anyone comparing offers across different stores.
Enter the original price and discount percentage to see the savings amount and final price. Or enter the original price and the sale price to calculate the percentage saved. The tool handles multiple discount stacking if you need to apply a second discount on top of the first.
A 20% discount does not mean the price is 20% of the original — it means you pay 80%. This distinction matters when stacking discounts: two 20% discounts result in paying 64% of the original price (0.8 × 0.8 = 0.64), not 60% as one might assume.
Frequently Asked Questions
Code Implementation
def calculate_discount(original_price, discount_percent):
"""Calculate discounted price and savings."""
discount_amount = original_price * (discount_percent / 100)
final_price = original_price - discount_amount
return {
"original": original_price,
"discount_amount": round(discount_amount, 2),
"final_price": round(final_price, 2),
"savings_percent": discount_percent,
}
def calculate_discount_percent(original_price, sale_price):
"""Find the discount percentage from two prices."""
return round(((original_price - sale_price) / original_price) * 100, 2)
def stack_discounts(original_price, *discounts):
"""Apply multiple discounts sequentially."""
price = original_price
for d in discounts:
price *= (1 - d / 100)
return round(price, 2)
# Examples
print(calculate_discount(80, 30))
print(calculate_discount_percent(50, 35)) # => 30.0%
print(stack_discounts(100, 20, 10)) # => 72.0 (not 70.0)Comments & Feedback
Comments are powered by Giscus. Sign in with GitHub to leave a comment.