Sales Tax Calculator
Calculate sales tax and total price for purchases instantly. This calculator works with any tax rate—whether you're shopping in different US states, traveling internationally, or dealing with combined state and local taxes. Understanding sales tax helps you budget accurately and compare prices across different locations.
Understanding Sales Tax
Sales tax is a consumption tax imposed by governments on the sale of goods and services. In the US, sales tax rates vary significantly by state, county, and city. Some states have no sales tax, while others combine state, county, and city taxes that can total over 10%.
Sales Tax Formulas
| Calculation | Formula | Example (8.5% tax) |
|---|---|---|
| Tax Amount | Price × (Tax Rate / 100) | $100 × 0.085 = $8.50 |
| Total Price | Price + Tax Amount | $100 + $8.50 = $108.50 |
| Pre-tax Price | Total ÷ (1 + Tax Rate / 100) | $108.50 ÷ 1.085 = $100 |
| Tax Rate | (Tax Amount ÷ Price) × 100 | ($8.50 ÷ $100) × 100 = 8.5% |
US State Sales Tax Rates (2024)
| State | Base Rate | Typical Total* | State | Base Rate | Typical Total* |
|---|---|---|---|---|---|
| California | 7.25% | 8.5-10.5% | Texas | 6.25% | 8.25% |
| New York | 4% | 8% | Florida | 6% | 7-8% |
| Tennessee | 7% | 9.75% | Washington | 6.5% | 10.4% |
| Illinois | 6.25% | 10.25% | Pennsylvania | 6% | 6-8% |
| Arizona | 5.6% | 8-11% | Ohio | 5.75% | 7.5% |
Tax-Free States
| State | Notes |
|---|---|
| Oregon | No state or local sales tax |
| Montana | No state sales tax; some resort taxes |
| New Hampshire | No sales tax on most goods |
| Delaware | No state or local sales tax |
| Alaska | No state sales tax; local taxes up to 7.5% in some areas |
Sales Tax Examples
| Pre-tax Price | Tax Rate | Tax Amount | Total Price |
|---|---|---|---|
| $25.00 | 8% | $2.00 | $27.00 |
| $50.00 | 6% | $3.00 | $53.00 |
| $100.00 | 8.5% | $8.50 | $108.50 |
| $250.00 | 10% | $25.00 | $275.00 |
| $499.99 | 7.25% | $36.25 | $536.24 |
| $1,000.00 | 9.5% | $95.00 | $1,095.00 |
Common Exemptions
Many states exempt certain items from sales tax:
| Category | Common Exemptions |
|---|---|
| Groceries | Basic food items (many states) |
| Clothing | NY, PA, NJ, MN, and others |
| Prescription drugs | Most states |
| Medical devices | Varies by state |
| School supplies | Tax holidays in some states |
Implementation
``javascript
function calculateSalesTax(price, taxRate) {
const taxAmount = price * (taxRate / 100);
const total = price + taxAmount;
return {
preTaxPrice: price.toFixed(2),
taxRate: taxRate + '%',
taxAmount: taxAmount.toFixed(2),
totalPrice: total.toFixed(2)
};
}
function reverseCalculate(totalWithTax, taxRate) {
const preTaxPrice = totalWithTax / (1 + taxRate / 100);
const taxAmount = totalWithTax - preTaxPrice;
return {
totalWithTax: totalWithTax.toFixed(2),
preTaxPrice: preTaxPrice.toFixed(2),
taxAmount: taxAmount.toFixed(2)
};
}
console.log(calculateSalesTax(100, 8.5));
// { preTaxPrice: '100.00', taxRate: '8.5%', taxAmount: '8.50', totalPrice: '108.50' }
``
Shopping Across State Lines
Purchasing items from tax-free states can save money on large purchases. However, many states require "use tax" on items purchased out-of-state. Additionally, some retailers collect tax based on the shipping destination rather than their location.