Sales Tax Calculator Formula

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

Formulas Used

Sales Tax Amount

tax_amount = price * tax_rate / 100

Total Price

total_price = price + price * tax_rate / 100

Variables

VariableDescriptionDefault
pricePrice Before Tax(USD)100
tax_rateSales Tax Rate(%)8.25

How It Works

How to Calculate Sales Tax

Formula

Tax Amount = Price x (Tax Rate / 100) Total Price = Price + Tax Amount

Sales tax rates vary by state and locality. Always check your local rate for accuracy.

Worked Example

A $100 item with 8.25% sales tax.

price = 100tax_rate = 8.25
  1. 01Tax = $100 x 0.0825 = $8.25
  2. 02Total = $100 + $8.25 = $108.25

Ready to run the numbers?

Open Sales Tax Calculator