Welcome back to Shopping and Spending with Percentages! In the first lesson of this course, you learned how to calculate discounts and sale prices — percentages that reduce what you owe. Now, in this second lesson, we turn to a percentage that works in the opposite direction: one that increases your total at the register.
Here we focus on calculating sales tax and total cost. Most purchases in the United States (and many other places) include a tax that is calculated as a percentage of the pretax price. By the end of this lesson, you will be able to find the tax owed on any purchase, even when the tax rate includes decimals like 6.5% or 8.25%, and determine the total amount you actually pay.
Be a part of our community of 1M+ users who develop and demonstrate their skills on CodeSignal
When you buy something at a store, the sticker price is usually not the final amount you pay. A sales tax is an additional charge — expressed as a percent of the purchase price — that goes to the local or state government. If the tax rate is 8%, that means for every 100youspend,anextra8 is collected as tax.
One important detail is that sales tax is calculated on the pretax price (sometimes labeled "subtotal" on a receipt). The store adds up everything you are buying, applies the tax rate to that subtotal, and then tacks the result onto your bill. This two-part process — find the tax, then add it — is exactly what we will practice below.
Finding the tax owed is a single multiplication. Take the pretax price, convert the tax rate to a decimal, and multiply.
Tax=Pretax price×Tax rate (as a decimal)
Let's try an example. Suppose you buy a book for $40.00 in an area with a 5% sales tax.
Step 1 — Convert the rate:5%=0.05
Step 2 — Multiply:
40.00×0.05=2.00
The tax on the book is $2.00. As you may recall from earlier lessons, converting a percent to a decimal simply means moving the decimal point two places to the left.
Once you know the tax amount, add it to the pretax price to get the total cost — the amount that actually gets charged.
Total cost=Pretax price+Tax
Continuing with our 40.00bookand2.00 tax:
40.00+2.00=42.00
You pay $42.00 in total. Two small steps and you are done: multiply to find the tax, then add to find the total.
Many real tax rates are not whole numbers. You will often see rates like 6.5%, 7.75%, or 8.25%. The process is exactly the same; you just need to convert the decimal rate carefully.
Tax Rate
As a Decimal
6.5%
0.065
7.75%
0.0775
8.25%
0.0825
Let's work through an example. You purchase a pair of headphones for $60.00 in an area with an 8.25% tax rate.
Tax amount:
60.00×0.0825=4.95
Total cost:
60.00+4.95=64.95
You owe 4.95∗∗intaxandpay∗∗64.95 altogether. Notice that even though the rate has decimals, the steps stay the same: convert, multiply, add.
Sometimes the multiplication produces more than two decimal places, and since money only goes down to the cent, you need to round. Consider a pretax price of $29.99 with a 7.5% tax rate:
29.99×0.075=2.24925
That result has five decimal places, so we round to the nearest cent: $2.25. The total cost becomes $29.99 + $2.25 = $32.24. Whenever your tax calculation lands between two cents, round to the nearer one — if the third decimal digit is 5 or higher, round up.
In the previous lesson, you used a remaining-percent shortcut to jump straight to a sale price. A similar idea works here, but in reverse. Instead of subtracting a percent, you are adding one, so you multiply the pretax price by 1 plus the tax rate as a decimal.
Total cost=Pretax price×(1+Tax rate as a decimal)
Using the headphones example ($60.00, tax rate 8.25%):
60.00×1.0825=64.95
You land on $64.95 in one step. This shortcut is great when you only need the total and do not need the tax amount by itself. If you do need the tax separately, just subtract: $64.95 − $60.00 = $4.95.
Keep these pointers handy as you practice:
Apply tax to the pretax price. The tax rate should always be multiplied by the price before tax, never by a number that already includes tax.
Watch the decimal conversion on rates like 6.5%. It is tempting to write 0.65 instead of 0.065. Remember, the decimal point moves two places to the left, so 6.5% becomes 0.065.
Check reasonableness. Most sales tax rates are under 10%, so the tax on a $50 item should be well under $5. If your answer is much larger than that, revisit your decimal placement.
In this lesson, you learned how to calculate sales tax and determine the total cost of a purchase. The core process has two steps: multiply the pretax price by the tax rate (as a decimal) to find the tax, then add it to the pretax price. You also saw a one-step shortcut that multiplies by 1 plus the rate to jump directly to the total. These techniques work just as smoothly with decimal tax rates like 6.5% or 8.25% as they do with whole-number rates.
Up next, you will put these skills into practice with hands-on exercises. You will calculate tax amounts for various rates, find totals, and work through a realistic receipt — so get your calculator ready and let's ring up some numbers!