Tip Calculator
Calculate tip amounts and split the bill between multiple people.
TipCalculator.resultsTitle
Tip Calculator quickly calculates how much to tip at a restaurant, bar, hotel, or any service where gratuity is expected. Enter the bill total, choose a tip percentage (or set a custom amount), and optionally split the result among multiple people β the tool shows you the tip amount, the total per person, and the grand total.
Tipping customs vary significantly across countries. In the United States, 15-20% is standard for restaurant service, while many European countries include a service charge in the bill or expect a smaller gratuity of 5-10%. This calculator helps you quickly adapt to local customs when traveling.
You can also use the tool to work backwards: enter the total including tip and the number of people to see exactly what each person owes. This is especially useful for splitting a restaurant bill fairly among a group with different order sizes.
Frequently Asked Questions
Code Implementation
def calculate_tip(bill: float, tip_percent: float, num_people: int = 1) -> dict:
"""Calculate tip and split the bill."""
tip_amount = bill * (tip_percent / 100)
total = bill + tip_amount
per_person = total / num_people
tip_per_person = tip_amount / num_people
return {
"bill": bill,
"tip_amount": tip_amount,
"total": total,
"per_person": per_person,
"tip_per_person": tip_per_person,
"tip_percent": tip_percent,
"num_people": num_people,
}
# Example: $85 bill, 18% tip, split 4 ways
result = calculate_tip(bill=85.00, tip_percent=18, num_people=4)
print(f"Bill: ${result['bill']:.2f}")
print(f"Tip (18%): ${result['tip_amount']:.2f}")
print(f"Total: ${result['total']:.2f}")
print(f"Per Person: ${result['per_person']:.2f}")
print(f"Tip Per Person: ${result['tip_per_person']:.2f}")
# Quick tip reference table
print("\nTip Reference:")
for pct in [10, 15, 18, 20, 25]:
tip = bill_amount = 85 * pct / 100
print(f" {pct}%: ${tip:.2f} tip, ${85 + tip:.2f} total")Comments & Feedback
Comments are powered by Giscus. Sign in with GitHub to leave a comment.