All guides
CalculatorsNovember 9, 2026· 6 min read

How to Calculate Margin, Markup and Tax on Any Sale

Margin and markup sound the same but give different numbers on the same sale. Here is how to calculate each one, and how to add tax on top.

Price tag, coins and a calculator showing a sale price

Margin vs markup: the difference that matters

Margin and markup both describe profit, but they measure it against different numbers — and that is where most confusion starts. Margin is profit as a share of the selling price. Markup is profit as a share of the cost.

Because the two use different bases, the same sale always gives two different percentages. A seller who confuses them can think a product is more profitable than it is, or set a price that misses the profit they wanted.

Margin answers the question: of the money the customer pays, how much do I keep? Markup answers a different one: how much do I add on top of what it cost me? Both are useful, but they are not interchangeable.

The habit to build is simple: always say which one you mean. A bare number like 25 percent is meaningless until you know whether it is a margin or a markup.

  • Margin = profit divided by selling price.
  • Markup = profit divided by cost.
  • The same sale gives a higher markup than margin, every time.

How to calculate margin

To calculate margin, subtract the cost from the selling price to get the profit, then divide the profit by the selling price and multiply by 100. The formula is: margin = (price minus cost) divided by price, times 100.

Take a simple example. You buy a product for $40 and sell it for $50. The profit is $10. Divide $10 by the $50 selling price and you get 0.20 — a 20 percent margin.

Margin is the number most businesses watch, because it shows what share of revenue survives as profit before other expenses. A 20 percent margin means 20 cents of every dollar of sales is gross profit; the other 80 cents covered the cost of the goods.

Track margin per product, not just for the business as a whole. Two products can look equally successful in sales while one keeps far more of each dollar — and that is the one worth pushing.

How to calculate markup

To calculate markup, subtract the cost from the selling price to get the profit, then divide the profit by the cost and multiply by 100. The formula is: markup = (price minus cost) divided by cost, times 100.

Use the same example: cost $40, price $50, profit $10. Divide $10 by the $40 cost and you get 0.25 — a 25 percent markup. Same sale, different number, because the base changed from the $50 price to the $40 cost.

Markup is the natural tool for pricing. If you know what something costs and you want a 25 percent markup, you add 25 percent of the cost: $40 plus $10 gives the $50 price. It is the quickest way to turn costs into prices.

The trap is quoting a markup as if it were a margin. A 25 percent markup sounds like a quarter of the price is profit, but it is only 20 percent — the profit is a quarter of the cost, not of the price. Say which one you mean, every time.

How to add GST, VAT or sales tax

Tax is normally added on top of the selling price. If the price before tax is $50 and the tax rate is 10 percent, the tax is $5 and the customer pays $55. The formula is: tax = price times rate, and total = price plus tax.

To work backwards from a tax-inclusive price, divide the total by one plus the rate. A $55 total at 10 percent tax means the price before tax is $55 divided by 1.10, which is $50, and the tax inside it is $5.

Rates vary by country, by product, and sometimes by seller, so there is no single rate to assume. GST, VAT and sales tax are also different systems with different rules — enter the rate that applies to your sale rather than guessing one.

Keep tax separate from margin in your own records. Tax is collected for the government, not kept as profit, so a sale with a 20 percent margin and 10 percent tax does not leave you with 30 percent of anything — it leaves you with the margin, and the tax passes through.

  • Tax amount = selling price times the tax rate.
  • Total to charge = selling price plus tax.
  • Price before tax = tax-inclusive price divided by one plus the rate.

The bottom line

Margin tells you what you keep, markup tells you what to add, and tax tells you what to collect for the government. Keep the three apart and the numbers stop surprising you — and your prices start doing what you meant them to do.

Free tool

Price every sale correctly

Try the free Margin and Tax Calculator — margin, markup and GST/VAT for any country, using your own figures. No signup, no cost.

Try Margin and Tax Calculator — it's free

Frequently asked questions

Margin is profit as a share of the selling price; markup is profit as a share of the cost. On the same sale the two numbers are always different — for example, a 20 percent margin equals a 25 percent markup. Use margin to judge profitability and markup to set prices.

No, not on a sale with a positive cost. Margin is profit divided by the selling price, so it can only reach 100 percent if the cost is zero. If you see a margin above 100 percent, the numbers have been mixed up — usually margin and markup were swapped.

Divide the cost by one minus the margin you want. For a cost of $40 and a target margin of 20 percent: $40 divided by 0.8 equals a $50 selling price. Check it afterwards: $10 profit on a $50 price is a 20 percent margin.

In most systems, GST, VAT or sales tax is charged on the selling price, not on the cost — but the rules vary by country, product and seller type. Enter the rate that applies to your sale and check your local rules if you are unsure.

Use margin when you want to know how profitable a sale is — it tells you what share of the price you keep. Use markup when you are setting a price from a known cost — it tells you how much to add on top. Most businesses track margin and price with markup.

Keep reading