Sales Tax Calculator
Calculate sales tax and total price for purchases. Works with any tax rate for US states, countries, or custom rates.
Sales Tax Formula
| Calculation | Formula |
|---|---|
| Tax Amount | Price × (Tax Rate / 100) |
| Total Price | Price + Tax Amount |
| Pre-tax Price | Total / (1 + Tax Rate / 100) |
US State Sales Tax Rates (2024)
| State | Rate | State | Rate |
|---|---|---|---|
| California | 7.25% | Texas | 6.25% |
| New York | 4% | Florida | 6% |
| Tennessee | 7% | Oregon | 0% |
| Washington | 6.5% | Delaware | 0% |
Implementation
``javascript
function calculateSalesTax(price, taxRate) {
const taxAmount = price * (taxRate / 100);
const total = price + taxAmount;
return { taxAmount, total };
}
function reverseCalculate(totalWithTax, taxRate) {
const preTaxPrice = totalWithTax / (1 + taxRate / 100);
const taxAmount = totalWithTax - preTaxPrice;
return { preTaxPrice, taxAmount };
}
``
Tax-Free States
Oregon, Montana, New Hampshire, Delaware, and Alaska have no state sales tax (though Alaska allows local taxes).