Bookmarks    
nPr and nCr    
Random Number    
SD Calculator    
Sample Size    
Percent Error    
Density    
Molarity    
Molar Mass    
Ohm's Law    
Watts to Amps    
Voltage Drop    
Long Division    
Mixed Numbers    
Rounding    
Nth Root    
Exponents    
Half-Life    
Polar Form    
De Moivre    
3D Distance    
Point to Line    
Cross Product    
Determinant    
Sin Cos Tan    
Triangle Area    
Scale Factor    
Sector Area    
Ellipse Area    
Cube Volume    
Box Volume    
Sphere Volume    
Cone Volume    
Pipe Volume    
Time Duration    
Time Card    
Present Value    
Future Value    
Churn Rate    
A/B Test Calc    
SEO Traffic    
Ideal Weight    
Fat Intake    
Child Height    
Golf Handicap    
Heat Index    
Wind Chill    
Dew Point    
Download Time    
kWh to Cost    
AC Size (BTU)    
Heating Costs    
LED Savings    
Trip Gas Cost    
Tire Size    
Solar Output    
Solar Payback    
Battery Size    
Wall Area    
Gravel Needed    
Mortar Mix    
Slope Grade    
Curtain Size    
Soil Needed    
Sod Needed    
Ramp Length    
Blind Size    
Drain Slope    
Board Feet    
Heat Loss    
Furniture Fit    
Moving Boxes    
Plywood Cuts    
Shelf Sag    
   Add
Probability and random number calculators
Independent Events
Independent Events
Two Events Solver
Two Events Solver
Repeated Trials
Repeated Trials
Bayes' Theorem
Bayes' Theorem
Expected Value
Expected Value
Binomial Distribution
Binomial Distribution
nPr and nCr
nPr and nCr
Circular Permutation
Circular Permutation
With Repetition
With Repetition
Random Number
Random Number
Averages and statistics calculators
Average Calculator
Average Calculator
Mean Median Mode
Mean Median Mode
SD Calculator
SD Calculator
Quartiles & IQR
Quartiles & IQR
Frequency Table
Frequency Table
Correlation (r)
Correlation (r)
Normal Probability
Normal Probability
Z-Score Calculator
Z-Score Calculator
Confidence Interval
Confidence Interval
Sample Size
Sample Size
Mark & Recapture
Mark & Recapture
P-Value Calculator
P-Value Calculator
Percentage and ratio calculators
Percentage Calc
Percentage Calc
Percent Change
Percent Change
Percent Difference
Percent Difference
Percent Error
Percent Error
Ratio Calculator
Ratio Calculator
Discount Calculator
Discount Calculator
Sales Tax Calculator
Sales Tax Calculator
Margin Calculator
Margin Calculator
Speed calculators
Speed Calculator
Speed Calculator
Density and concentration calculators
Density
Density
Molarity
Molarity
Molar Mass
Molar Mass
Physics and electricity calculators
Ohm's Law
Ohm's Law
Watts to Amps
Watts to Amps
Resistor Colors
Resistor Colors
Voltage Drop
Voltage Drop
Unit conversion calculators
Weight Converter
Weight Converter
Shoe Size Converter
Shoe Size Converter
Integer and signed number calculators
Long Division
Long Division
LCM Calculator
LCM Calculator
GCF Calculator
GCF Calculator
Integer Calculator
Integer Calculator
Prime Factorization
Prime Factorization
Diophantine Solver
Diophantine Solver
Modulo Calculator
Modulo Calculator
Factor Calculator
Factor Calculator
Roman Numerals
Roman Numerals
Fraction, decimal and rounding calculators
Fraction Calculator
Fraction Calculator
Mixed Numbers
Mixed Numbers
Simplify Fractions
Simplify Fractions
Fraction to Decimal
Fraction to Decimal
Decimal to Fraction
Decimal to Fraction
Rounding
Rounding
Equation and inequality calculators
Linear Equation
Linear Equation
Linear Systems
Linear Systems
Quadratic Formula
Quadratic Formula
Absolute Value
Absolute Value
Quadratic Inequality
Quadratic Inequality
Polynomial calculators
Binomial Theorem
Binomial Theorem
Square root and nth root calculators
Simplify Radicals
Simplify Radicals
Nth Root
Nth Root
Exponent and logarithm calculators
Exponents
Exponents
Log Calculator
Log Calculator
Number of Digits
Number of Digits
Scientific Notation
Scientific Notation
Sci. Notation Math
Sci. Notation Math
Half-Life
Half-Life
Complex number calculators
Complex Numbers
Complex Numbers
Polar Form
Polar Form
De Moivre
De Moivre
Function and graph calculators
Slope Calculator
Slope Calculator
Linear Function
Linear Function
Direct & Inverse Variation
Direct & Inverse Variation
y = ax² Calculator
y = ax² Calculator
Distance Formula
Distance Formula
3D Distance
3D Distance
Section Formula
Section Formula
Point to Line
Point to Line
Lat/Long Distance
Lat/Long Distance
Complete the Square
Complete the Square
Circle Equation
Circle Equation
Conic Sections
Conic Sections
Polar Coordinates
Polar Coordinates
Sequence calculators
Arithmetic Sequence
Arithmetic Sequence
Geometric Sequence
Geometric Sequence
Fibonacci Sequence
Fibonacci Sequence
Recurrence Relation
Recurrence Relation
Vector calculators
Vector Calculator
Vector Calculator
Cross Product
Cross Product
Matrix calculators
Matrix Calculator
Matrix Calculator
Determinant
Determinant
Inverse Matrix
Inverse Matrix
Plane geometry calculators
Sin Cos Tan
Sin Cos Tan
Degrees ⇔ Radians
Degrees ⇔ Radians
a sin θ + b cos θ
a sin θ + b cos θ
Triangle Solver
Triangle Solver
Triangle Area
Triangle Area
Right Triangle
Right Triangle
Pythagorean Theorem
Pythagorean Theorem
Polygon Angles
Polygon Angles
Scale Factor
Scale Factor
Parallel Lines
Parallel Lines
Rectangle Area
Rectangle Area
Parallelogram Area
Parallelogram Area
Trapezoid Area
Trapezoid Area
Circle Calculator
Circle Calculator
Sector Area
Sector Area
Inscribed Angle
Inscribed Angle
Ellipse Area
Ellipse Area
Solid geometry calculators
Cube Volume
Cube Volume
Cube Surface Area
Cube Surface Area
Box Volume
Box Volume
Box Surface Area
Box Surface Area
Cylinder Volume
Cylinder Volume
Cylinder Surface
Cylinder Surface
Sphere Volume
Sphere Volume
Sphere Surface
Sphere Surface
Spherical Cap Volume
Spherical Cap Volume
Cap Surface Area
Cap Surface Area
Ellipsoid Volume
Ellipsoid Volume
Ellipsoid Surface
Ellipsoid Surface
Pyramid Volume
Pyramid Volume
Pyramid Surface
Pyramid Surface
Cone Volume
Cone Volume
Cone Surface Area
Cone Surface Area
Frustum Volume
Frustum Volume
Frustum Surface Area
Frustum Surface Area
Pipe Volume
Pipe Volume
Capsule Volume
Capsule Volume
Capsule Surface Area
Capsule Surface Area
Date and time calculators
Age Calculator
Age Calculator
Days Between Dates
Days Between Dates
Date Calculator
Date Calculator
Hours From Now
Hours From Now
Day of the Week
Day of the Week
Time Calculator
Time Calculator
Time Zone Converter
Time Zone Converter
Hours Calculator
Hours Calculator
Time Duration
Time Duration
Time Card
Time Card
Finance and economics calculators
Compound Interest
Compound Interest
Simple Interest
Simple Interest
Interest Calculator
Interest Calculator
TVM Calculator
TVM Calculator
Present Value
Present Value
Future Value
Future Value
ROI Calculator
ROI Calculator
IRR Calculator
IRR Calculator
Payback Period
Payback Period
Average Return
Average Return
GDP Calculator
GDP Calculator
Web marketing and ad metric calculators
CTR Calculator
CTR Calculator
Conversion Rate
Conversion Rate
CPC, CPM & CPA
CPC, CPM & CPA
ROAS Calculator
ROAS Calculator
Break-Even CPA
Break-Even CPA
LTV Calculator
LTV Calculator
CAC Calculator
CAC Calculator
Churn Rate
Churn Rate
A/B Test Calc
A/B Test Calc
A/B Sample Size
A/B Sample Size
SEO Traffic
SEO Traffic
Break-Even Point
Break-Even Point
Markup vs. Margin
Markup vs. Margin
CAGR Calculator
CAGR Calculator
Health and fitness calculators
BMI Calculator
BMI Calculator
Sleep Calculator
Sleep Calculator
Calorie Calculator
Calorie Calculator
BMR Calculator
BMR Calculator
TDEE Calculator
TDEE Calculator
Ideal Weight
Ideal Weight
Body Fat Calculator
Body Fat Calculator
Lean Body Mass
Lean Body Mass
Calories Burned
Calories Burned
Protein Intake
Protein Intake
Macro Calculator
Macro Calculator
Carb Calculator
Carb Calculator
Fat Intake
Fat Intake
Child Height
Child Height
Sports calculators
Golf Handicap
Golf Handicap
Pace Calculator
Pace Calculator
1RM Calculator
1RM Calculator
Target Heart Rate
Target Heart Rate
Weather calculators
Heat Index
Heat Index
Wind Chill
Wind Chill
Dew Point
Dew Point
Computer calculators
Base Converter
Base Converter
Subnet Calculator
Subnet Calculator
Download Time
Download Time
Household energy and budget calculators
Electricity Cost
Electricity Cost
kWh to Cost
kWh to Cost
Yearly kWh to Cost
Yearly kWh to Cost
AC Size (BTU)
AC Size (BTU)
AC Running Cost
AC Running Cost
Heating Costs
Heating Costs
Gas vs Electric
Gas vs Electric
LED Savings
LED Savings
Salary Calculator
Salary Calculator
Budget Calculator
Budget Calculator
Car calculators
Trip Gas Cost
Trip Gas Cost
EV Charging Cost
EV Charging Cost
EV vs Gas Cost
EV vs Gas Cost
MPG Calculator
MPG Calculator
Tire Size
Tire Size
Solar power and battery calculators
Solar Output
Solar Output
Solar Panel Count
Solar Panel Count
Solar Payback
Solar Payback
Battery Size
Battery Size
Home and DIY calculators
Tile Calculator
Tile Calculator
Stair Calculator
Stair Calculator
Concrete Volume
Concrete Volume
Wall Area
Wall Area
Wallpaper Rolls
Wallpaper Rolls
Paint Calculator
Paint Calculator
Flooring Needed
Flooring Needed
Exterior Walls
Exterior Walls
Gravel Needed
Gravel Needed
Mortar Mix
Mortar Mix
Slope Grade
Slope Grade
Lumber Cut List
Lumber Cut List
Lot Coverage/FAR
Lot Coverage/FAR
Sheet Vinyl Roll
Sheet Vinyl Roll
Insulation Needed
Insulation Needed
Curtain Size
Curtain Size
TV Size & Distance
TV Size & Distance
Soil Needed
Soil Needed
Sod Needed
Sod Needed
Block Calculator
Block Calculator
Brick Calculator
Brick Calculator
Deck Materials
Deck Materials
Ramp Length
Ramp Length
Pilot Hole Size
Pilot Hole Size
Room Ventilation
Room Ventilation
Paint Thinning
Paint Thinning
Baseboard & Trim
Baseboard & Trim
Blind Size
Blind Size
Picture Hanging
Picture Hanging
Drain Slope
Drain Slope
Screw Calculator
Screw Calculator
Board Feet
Board Feet
Fence Calculator
Fence Calculator
Wood Shrinkage
Wood Shrinkage
Caulk Calculator
Caulk Calculator
Heat Loss
Heat Loss
Furniture Fit
Furniture Fit
Moving Boxes
Moving Boxes
Storage Capacity
Storage Capacity
Plywood Cuts
Plywood Cuts
Shelf Sag
Shelf Sag

Sales Tax Calculator (Add or Remove Sales Tax and VAT)

Enter the two you know out of "Pre-tax price", "Tax rate (%)" and "Total price", leave the one you want to find blank, and press "Calculate". The missing value and the tax amount are calculated together.

Enter the tax rate as a percentage (for 8.25%, enter "8.25"). If all three fields are filled in, nothing can be calculated, so always leave the field you want to find blank. If the tax comes out in fractions of a cent, the amounts with the tax rounded to the nearest cent are also shown for reference.
Result
Enter the two values you know in the fields on the left and press "Calculate". The result will appear here.

What you can do on this page

  • Enter any two of "pre-tax price", "tax rate (%)" and "total price", and the third one and the tax amount are found on the spot
  • "What is $50 plus 8% tax?" "What was the price before tax on a $108 receipt?" - it works in both directions (adding tax and removing it)
  • You type in the tax rate yourself, so it works for any US state and local sales tax rate, and for VAT or GST in other countries (such as 20% VAT in the UK or 10% GST in Australia)
  • A plain-language explanation of the formulas and copy-and-paste formulas for Excel, Google Sheets and Python are all on this page
The US has no national sales tax. Each state sets its own rate (a few states have none), and many counties and cities add their own, so check the combined rate for where you shop. In the US, sales tax is usually added at the register rather than included in the price tag, while VAT and GST prices in many other countries already include the tax. Stores round the tax to the cent, so your receipt may differ by a cent.

What is this calculation used for?

Estimating what you will pay at the register

In the US, price tags usually do not include sales tax, so the total at the register is higher than the tag. At an 8% rate, a $40 item costs \(40 \times 1.08 = 43.20\) dollars.
Once you know your local multiplier (1.08 for 8%), you can estimate your total before you reach the register and see right away whether you are over budget.

Splitting a receipt into price and tax (budgeting and bookkeeping)

Expense reports and small-business books often need the price and the tax recorded separately. For a $108 total at 8% tax, the pre-tax price is \(108 \div 1.08 = 100\) dollars and the tax is $8. With 20% UK VAT, a £120 receipt is £100 plus £20 VAT (\(120 \div 1.2 = 100\)).
Removing tax from a total is the tax calculation used most in everyday bookkeeping.

Setting tax-inclusive prices and planning for the tax you collect (business)

"I want customers to pay a round $55 including 10% GST. What should the price before tax be?" Working this out is the reverse formula itself (\(55 \div 1.1 = 50\) dollars). Food trucks and event vendors that charge tax-included round prices do the same.
Sales tax you collect is not your money: businesses pass it on to the state (or, for VAT and GST, to the national tax agency). Estimating the tax inside your sales helps you plan how much money you really get to keep.

Comparing the tax in different places (shopping)

Because rates differ by state and city, the same purchase can cost different amounts. A $1,000 laptop costs \(1000 \times 1.06 = 1060\) dollars at a 6% rate, but \(1000 \times 1.095 = 1095\) dollars at a 9.5% rate - a $35 difference.
Knowing the rate where you buy (and whether an item is taxed there at all) helps you compare the real prices of big purchases.

Knowing the tax on big purchases like a car

Sales tax grows with the price, so big purchases come with big tax bills. On a $30,000 car at a 7% rate, the tax alone is \(30000 \times 0.07 = 2100\) dollars.
When you budget for a large purchase, it is important to know how much the tax itself will be, not just the price.

Formula

Formula for the total price (adding tax)
Standard notation (the usual math form)
\(Y\) \(=\) \(X\) \(\times\) \((\) \(1\) \(+\) \(R\) \(\div\) \(100\) \()\)
In words (symbols replaced with words)
⑤ \(Y\): total price \(=\) ④ \(X\): pre-tax price \(\times\) \((\) ③ \(1\): the whole price \(+\) ① \(R\): tax rate (%) \(\div\) ② \(100\): percent base \()\)
The formula in words
① Take the \(R\): tax rate (%)
② divide it by the \(100\): percent base to turn it into a decimal (0.08 for 8%),
③ add it to \(1\): the whole price (the pre-tax price itself) to get the tax multiplier,
④ multiply the \(X\): pre-tax price by that multiplier,
⑤ and you get the \(Y\): total price
Quick example
The total price of a $50 item with 8% sales tax is
\(Y\): total price \(=\) pre-tax price ($50) \(\times\) \((\) \(1\): the whole price \(+\) tax rate (8%) \(\div\) percent base (100) \()\)
\(8 \div 100 = 0.08\)
\(1 + 0.08 = 1.08\)
\(50 \times 1.08 = 54\)
Key idea
"8% tax" means you pay 100% of the pre-tax price plus 8%, which is 108%. So the multiplier is \(1 + 0.08 = 1.08\), and one multiplication gives the total price. For a 6% rate the multiplier is \(1.06\); for 20% VAT it is \(1.2\).
Formula for the tax amount
Standard notation (the usual math form)
\(T\) \(=\) \(X\) \(\times\) \(R\) \(\div\) \(100\)
In words (symbols replaced with words)
④ \(T\): tax amount \(=\) ① \(X\): pre-tax price \(\times\) ② \(R\): tax rate (%) \(\div\) ③ \(100\): percent base
The formula in words
① Multiply the \(X\): pre-tax price
② by the \(R\): tax rate (%) ,
③ divide by the \(100\): percent base to turn the percent into a decimal,
④ and you get the \(T\): tax amount
Quick example
The tax on a $50 item at 8% sales tax is
\(T\): tax amount \(=\) pre-tax price ($50) \(\times\) tax rate (8%) \(\div\) percent base (100)
\(8 \div 100 = 0.08\)
\(50 \times 0.08 = 4\)
Key idea
The tax amount is simply the tax rate's share of the pre-tax price (8% of $50 here). If you know both the total price and the pre-tax price, a subtraction \(T = Y - X\) is all you need.
Formula for the pre-tax price (removing tax from a total)
Standard notation (the usual math form)
\(X\) \(=\) \(Y\) \(\div\) \((\) \(1\) \(+\) \(R\) \(\div\) \(100\) \()\)
In words (symbols replaced with words)
⑤ \(X\): pre-tax price \(=\) ④ \(Y\): total price \(\div\) \((\) ③ \(1\): the whole price \(+\) ① \(R\): tax rate (%) \(\div\) ② \(100\): percent base \()\)
The formula in words
① Take the \(R\): tax rate (%)
② divide it by the \(100\): percent base to turn it into a decimal,
③ add it to \(1\): the whole price to get the tax multiplier,
④ then divide the \(Y\): total price by that multiplier,
⑤ and you are back to the \(X\): pre-tax price
Quick example
The pre-tax price on a $108 total with 8% sales tax is
\(X\): pre-tax price \(=\) total price ($108) \(\div\) \((\) \(1\): the whole price \(+\) tax rate (8%) \(\div\) percent base (100) \()\)
\(8 \div 100 = 0.08\)
\(1 + 0.08 = 1.08\)
\(108 \div 1.08 = 100\)
Key idea
A common mistake is to take 8% off the total. 8% of $108 is $8.64, and \(108 - 8.64 = 99.36\) dollars, which does not match the correct pre-tax price of $100. The tax rate is a percentage of the pre-tax price, so to go back from the total you divide by the multiplier 1.08 instead of subtracting. This is often called "backing out" the tax, or reverse sales tax.
Formula for the tax rate
Standard notation (the usual math form)
\(R\) \(=\) \((\) \(Y\) \(\div\) \(X\) \(-\) \(1\) \()\) \(\times\) \(100\)
In words (symbols replaced with words)
⑤ \(R\): tax rate (%) \(=\) \((\) ① \(Y\): total price \(\div\) ② \(X\): pre-tax price \(-\) ③ \(1\): the whole price \()\) \(\times\) ④ \(100\): percent base
The formula in words
① Divide the \(Y\): total price
② by the \(X\): pre-tax price to see how many times larger it is,
③ subtract \(1\): the whole price (the pre-tax price itself) to keep only the part that was added,
④ multiply by the \(100\): percent base to turn it into a percent,
⑤ and you get the \(R\): tax rate (%)
Quick example
If a $20.00 item comes to $21.45 at the register, the tax rate is
\(R\): tax rate (%) \(=\) \((\) total price ($21.45) \(\div\) pre-tax price ($20.00) \(-\) \(1\): the whole price \()\) \(\times\) percent base (100)
\(21.45 \div 20 = 1.0725\)
\(1.0725 - 1 = 0.0725\)
\(0.0725 \times 100 = 7.25\ \ (7.25\%)\)
Key idea
This is how you can check which rate you were actually charged. In the US, the rate on a receipt is usually the combined state and local rate, so it changes from place to place. Because stores round the tax to the cent, a rate found from a small purchase can be off by a tiny amount; a larger purchase gives a more exact figure.
Sales tax math starts from "pre-tax price × multiplier = total price" (1.08 for 8%, 1.2 for 20% VAT). The most important tip is that to get back from a total to the pre-tax price, you divide by the multiplier instead of subtracting the tax rate.

Symbols and terms

Symbols

\(X\) ex The pre-tax price. The price of the item itself, before tax is added.
\(R\) are The tax rate (%). In the US it depends on the state, county and city; for 20% UK VAT, \(R = 20\).
\(Y\) why The total price. The price including tax, which is what you actually pay.
\(T\) tee The tax amount. The difference between the total price and the pre-tax price (\(T = Y - X\)).
\(1 + R \div 100\) one plus R over 100 The tax multiplier. It tells how many times the pre-tax price you pay - 1.08 for 8%, 1.2 for 20%.

Terms

sales tax A tax on buying goods and services, paid by the customer and collected by the seller. In the US there is no national sales tax. Most states have a statewide rate, a few have none, and many counties and cities add a local rate on top. Which items are taxed also differs by state (for example, many states exempt groceries).
pre-tax price The price of an item before tax. In the US, this is usually the price shown on the tag.
total price The price including tax, which is what you actually pay. Also called the tax-inclusive price or the after-tax price.
VAT (value-added tax) A tax on goods and services used in the UK, the European Union and many other countries, collected at each stage of production and sale. The UK standard rate is 20%. For the shopper, the math is the same as sales tax.
GST (goods and services tax) The name for this kind of tax in countries such as Australia (10%) and Canada (5% federal GST, combined with provincial tax as HST in some provinces).
tax-inclusive pricing Showing prices with the tax already included. It is the rule for consumer prices in the UK, the EU and Australia. In the US, tag prices usually do not include sales tax, which is added at checkout.
reverse sales tax Finding the pre-tax price from a total that includes tax, also called "backing out" the tax. You undo the multiplication by dividing - for 8% tax, divide the total by 1.08.
rounding How fractions of a cent in the tax are handled. Sales tax is normally rounded to the nearest cent, usually on the receipt total, but the exact rules depend on the state. This page shows the tax rounded to the nearest cent for reference.

Good to know before you start

Here is what helps you use the calculation on this page with real understanding, not just by pressing the button.
If you get stuck, going back over these topics is the quickest way forward.

Percents (Grade 6)
  • Being able to switch between percents and decimals, such as 10% = 0.1 and 8% = 0.08
  • Being able to find "8% of $50" as \(50 \times 0.08\)
Multiplying and dividing decimals (Grades 5–6)
  • Being able to calculate with decimals, as in \(50 \times 1.08\) and \(108 \div 1.08\)
Writing a percent increase as one multiplication (Grade 7)
  • Knowing that "8% more" can be written as one multiplication, \(\times (1 + 0.08) = \times 1.08\)
  • Knowing that to undo a multiplication you divide; you do not subtract

How to calculate it in Excel

Copy the whole table below and paste it into cell A1 in Excel. It works as is.
Table to find the total price
Pre-tax price 50
Tax rate (%) 8
Total price =B1*(1+B2/100)
Table to find the tax amount
Pre-tax price 50
Tax rate (%) 8
Tax amount =B1*B2/100
Table to find the pre-tax price (removing tax from a total)
Total price 108
Tax rate (%) 8
Pre-tax price =B1/(1+B2/100)
Table to find the tax rate
Pre-tax price 20
Total price 21.45
Tax rate (%) =(B2/B1-1)*100
After pasting, the upper rows are your inputs and the last row is calculated automatically. "B1" and "B2" in a formula stand for "the number in that cell". "*" is multiplication and "/" is division.
In the first table, for example, B3 shows 50 × 1.08 = 54. Just replace B1 and B2 with your own numbers.
To round the tax to the nearest cent, wrap the formula in the ROUND function, as in =ROUND(B1*B2/100,2).

How to calculate it in Google Sheets

Copy the whole table below and paste it into cell A1 in Google Sheets. It works as is.
Table to find the total price
Pre-tax price 50
Tax rate (%) 8
Total price =B1*(1+B2/100)
Table to find the tax amount
Pre-tax price 50
Tax rate (%) 8
Tax amount =B1*B2/100
Table to find the pre-tax price (removing tax from a total)
Total price 108
Tax rate (%) 8
Pre-tax price =B1/(1+B2/100)
Table to find the tax rate
Pre-tax price 20
Total price 21.45
Tax rate (%) =(B2/B1-1)*100
The same formulas as in Excel work as is. Copy the whole table, paste it into cell A1, and replace the input numbers with your own.
The ROUND function for rounding to the nearest cent works in Google Sheets as is.

How to calculate it in Python

net_price = 50    # pre-tax price
tax_rate = 8      # tax rate (%). Use your state and local rate, or 20 for UK VAT

tax_amount = net_price * tax_rate / 100   # tax amount
gross_price = net_price + tax_amount      # total price
print(f"Tax amount: {tax_amount}")
print(f"Total price: {gross_price}")

# Remove tax from a total to get the pre-tax price (reverse sales tax)
gross_price2 = 108    # total price
tax_rate2 = 8         # tax rate (%)
net_price2 = gross_price2 / (1 + tax_rate2 / 100)
# Decimal arithmetic can give a result slightly off, such as 99.99999999999999, so round it for display
print(f"Pre-tax price: {round(net_price2, 2)}")
Runs with the standard library only. "*" is multiplication and "/" is division. The first part adds tax to a pre-tax price; the second part removes tax from a total. The second result can be off by a tiny amount because of how computers handle decimals, so it is rounded with the round function. Replace the numbers at the top with your own and run it.

How to write it in LaTeX and other math languages (copy and paste)

Formula for the total price (adding tax)
Y = X × (1 + R ÷ 100)
Y = X \times \left(1 + \frac{R}{100}\right)
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <mi>Y</mi>
    <mo>=</mo>
    <mi>X</mi>
    <mo>&#xD7;</mo>
    <mrow>
      <mo>(</mo>
      <mn>1</mn>
      <mo>+</mo>
      <mfrac><mi>R</mi><mn>100</mn></mfrac>
      <mo>)</mo>
    </mrow>
  </mrow>
</math>
Y = X xx (1 + R/100)
net*(1 + rate/100)
gross := net*(1 + rate/100);
gross = net*(1 + rate/100);
Y = X × (1 + R/100)
Formula for the tax amount
T = X × R ÷ 100
T = X \times \frac{R}{100}
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <mi>T</mi>
    <mo>=</mo>
    <mi>X</mi>
    <mo>&#xD7;</mo>
    <mfrac><mi>R</mi><mn>100</mn></mfrac>
  </mrow>
</math>
T = X xx R/100
net*rate/100
tax := net*rate/100;
tax = net*rate/100;
T = X × R/100
Formula for the pre-tax price (removing tax from a total)
X = Y ÷ (1 + R ÷ 100)
X = \frac{Y}{1 + \frac{R}{100}}
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <mi>X</mi>
    <mo>=</mo>
    <mfrac>
      <mi>Y</mi>
      <mrow>
        <mn>1</mn>
        <mo>+</mo>
        <mfrac><mi>R</mi><mn>100</mn></mfrac>
      </mrow>
    </mfrac>
  </mrow>
</math>
X = Y/(1 + R/100)
gross/(1 + rate/100)
net := gross/(1 + rate/100);
net = gross/(1 + rate/100);
X = Y/(1 + R/100)
Formula for the tax rate
R = (Y ÷ X − 1) × 100
R = \left(\frac{Y}{X} - 1\right) \times 100
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <mi>R</mi>
    <mo>=</mo>
    <mrow>
      <mo>(</mo>
      <mfrac><mi>Y</mi><mi>X</mi></mfrac>
      <mo>&#x2212;</mo>
      <mn>1</mn>
      <mo>)</mo>
    </mrow>
    <mo>&#xD7;</mo>
    <mn>100</mn>
  </mrow>
</math>
R = (Y/X - 1) xx 100
(gross/net - 1)*100
rate := (gross/net - 1)*100;
rate = (gross/net - 1)*100;
R = (Y/X - 1) × 100

How to have ChatGPT  do the calculation

You are a calculation assistant for sales tax. Do the following calculations by actually running Python code, and base your answer only on the numbers from the execution result (do not answer by mental math or guessing).

1. The tax amount and the total price for a pre-tax price of $50 at a tax rate of 8%
2. The pre-tax price and the tax amount for a total price of $108 at a tax rate of 8%
3. The tax rate (%) when a $20.00 item comes to $21.45 including tax

Show the formulas you used and the numbers from the execution result.

How to Use
  1. 1
    Enter your numbers
    Type the numbers you want to calculate with into the input fields
  2. 2
    Calculate
    Press the "Calculate" button
  3. 3
    Check the result
    The result appears on the spot. The same page also explains the idea behind the calculation and the formula
  DataChef Features
Easy and Free
Unlimited conversions for free.
No technical knowledge required.
Intuitive and user-friendly operation.
No Registration Required
Available immediately after access.
Can be used without registering personal information.
Safe and Secure
Fully SSL encrypted communication.
Automatic file deletion by clicking "download".
Fast
High-speed site access
and rapid file conversion.
No Watermark
No watermark.
No attribution required.
Commercial Use Available
Free for commercial use.
No need to contact us for commercial use permission.