Percentage Calculator
Calculate percentages, percentage change, and tip amounts.
Percentage Calculator handles the most common percentage problems in a single, easy-to-use interface: finding what percentage one number is of another, calculating a percentage of a given value, finding the original value when you know a percentage of it, and computing percentage increase or decrease between two numbers.
Simply select the type of calculation you need, enter the known values, and the result appears instantly. You can also work backwards — for example, if you know the discounted price and the discount percentage, the tool can tell you the original price.
Percentage calculations are used everywhere: in retail discounts and markups, tax computations, financial returns, grade calculations, tip calculations, and statistical analysis. This tool eliminates arithmetic errors and gives you precise results for all these everyday scenarios.
Frequently Asked Questions
Code Implementation
def percentage_of(percent, total):
"""X% of Y"""
return total * percent / 100
def what_percent(part, total):
"""X is what % of Y"""
return (part / total) * 100 if total != 0 else 0
def percent_change(old_value, new_value):
"""Percentage change from old to new"""
return ((new_value - old_value) / old_value) * 100 if old_value != 0 else 0
def add_percent(value, percent):
"""Add X% to a value"""
return value * (1 + percent / 100)
def subtract_percent(value, percent):
"""Subtract X% from a value"""
return value * (1 - percent / 100)
# Examples
print(f"15% of 200: {percentage_of(15, 200)}")
print(f"30 is what % of 120: {what_percent(30, 120):.2f}%")
print(f"50 -> 75 change: {percent_change(50, 75):.2f}%")
print(f"100 + 20%: {add_percent(100, 20)}")
print(f"100 - 15%: {subtract_percent(100, 15)}")Comments & Feedback
Comments are powered by Giscus. Sign in with GitHub to leave a comment.