Tip Calculator Formula

Understand the math behind the tip calculator. Each variable explained with a worked example.

Formulas Used

Tip Amount

tip_amount = bill_amount * tip_percent / 100

Total with Tip

total_bill = bill_amount + tip_amount

Per Person

per_person = total_bill / num_people

Variables

VariableDescriptionDefault
bill_amountBill Amount(USD)85
tip_percentTip Percentage(%)18
num_peopleNumber of People2

How It Works

How Tips Are Calculated

Tip = Bill × Tip% / 100

Total = Bill + Tip

Per Person = Total / Number of People

Common Tip Percentages

  • 15% — Standard service
  • 18% — Good service
  • 20% — Great service
  • 25%+ — Exceptional service
  • Worked Example

    $85 dinner bill, 18% tip, split between 2 people.

    bill_amount = 85tip_percent = 18num_people = 2
    1. 01Tip = $85 × 18% = $15.30
    2. 02Total = $85 + $15.30 = $100.30
    3. 03Per person = $100.30 / 2 = $50.15

    Ready to run the numbers?

    Open Tip Calculator