The math
Tip is straightforward arithmetic: multiply the bill by a percentage, then add it back to the total. The only real questions are which number to multiply, and how to split it.
tip = base × (percent ÷ 100)
per_person = (base + tip) ÷ people
Where "base" is either the total bill or the pre-tax subtotal, depending on how you tip. The difference between the two methods is usually about 1-2% of the total - a few dollars on a $100 bill.
Frequently asked
Should I tip on tax?
Etiquette says no - tip is for the service, not the government. Math says it barely matters. If you're tipping 20% on a $100 bill with $8 tax, you'd give $20 on pre-tax or $21.60 on total. The server probably won't notice or care.
What about automatic gratuity?
Large parties often get 18-20% added automatically. Always check the bill before adding more. Many people see "service charge" and tip again out of habit. If the auto-grat is on, you've already tipped.
Is tipping really required?
In the US, restaurant servers are typically paid below minimum wage with the expectation that tips will make up the difference. Skipping a tip on standard service essentially asks the server to pay for the privilege of waiting on you. If you object to the tipping system, the move is to support legislation that pays service workers a real wage - not to stiff your server.