Skip to content
ToolMoose

Margin Calculator

Calculate gross margin, markup and selling price from cost, and see margin vs markup.

Gross margin
20%
Gross profit$10.00
Gross margin20%
Markup25%

Margin is profit as a share of price. Markup is the same profit as a share of cost, so it is always the larger number.

Worked examples

Cost $40, price $50
Gross profit is $10, gross margin is 20% (10 ÷ 50), and markup is 25% (10 ÷ 40). Same $10 profit, two different percentages.
Price for a 20% margin
An item that costs $40 needs to sell for $50.00 to hit a 20% gross margin, since $40 ÷ (1 − 0.20) = $50.00.
Price for a 25% markup
Adding a 25% markup to a $40 cost gives $40 × 1.25 = $50.00, which works out to a 20% gross margin.
Cost $8, price $20
Gross profit is $12, gross margin is 60% (12 ÷ 20), and markup is 150% (12 ÷ 8).

How the margin calculator works

Margin, markup, and price are three views of the same simple relationship: what an item costs you, what you sell it for, and the profit in between. This tool moves between them in three modes so you can start from whatever numbers you already have.

The gap between price and cost is your gross profit:

  • Gross profit = selling price − cost

Everything else on this page is that same profit expressed as a percentage of either the price (margin) or the cost (markup).

Gross margin formula

Gross margin expresses profit as a percentage of the selling price:

  • Gross margin % = (price − cost) ÷ price × 100

Buy an item for $40 and sell it for $50, and the profit is $10. That $10 is 20% of the $50 price, so the gross margin is 10 ÷ 50 = 0.20, or 20%. Margin answers the question “of every dollar a customer pays me, how much do I keep?”

Markup formula

Markup expresses the same profit as a percentage of the cost:

  • Markup % = (price − cost) ÷ cost × 100

For the same $40 item sold at $50, the $10 profit is 10 ÷ 40 = 0.25, or a 25% markup. Markup answers a different question: “how much did I add on top of what I paid?”

Margin vs markup: the distinction that trips people up

The $40 to $50 example shows why these two numbers must never be confused: the exact same sale is a 20% margin and a 25% markup. They describe one $10 profit against two different bases.

  • Margin uses price as the base, so it can never reach 100%.
  • Markup uses cost as the base, so it has no upper limit.

Because cost is always smaller than price, the markup percentage is always larger than the margin percentage for the same sale. Mixing them up is a common and expensive mistake. If you mean to earn a 40% margin but instead add a 40% markup, you will under-price and keep less than you planned.

Pricing to hit a target margin

If you know your cost and the margin you want to keep, work backwards to the price:

  • Price = cost ÷ (1 − margin ÷ 100)

To earn a 20% margin on a $40 item, the price is $40 ÷ (1 − 0.20) = $40 ÷ 0.80 = $50.00. Note that you cannot simply add 20% of the cost ($8, giving $48), because that would be a 20% markup and would leave you with a margin of only about 16.7%.

To price from a markup instead, add the markup to the cost:

  • Price = cost × (1 + markup ÷ 100)

A 25% markup on $40 is $40 × 1.25 = $50.00, which happens to be the same price as a 20% margin. That is the whole point of keeping the two straight.

A note on gross vs net

The figures here are gross margin and markup: they only account for the direct cost of the item. They do not include overheads like rent, wages, payment processing fees, shipping, returns, or taxes. Your net profit after those costs will be lower. Use gross margin to set prices and compare products, then track net profit separately to see whether the business as a whole is making money. These results are estimates for planning, not accounting or professional financial advice.

Frequently asked questions

What is gross profit margin?
Gross profit margin is the share of the selling price left after you subtract the cost of the item. The formula is (price − cost) ÷ price × 100. If you buy something for $40 and sell it for $50, the $10 profit is 20% of the $50 price, so your gross margin is 20%.
What is the difference between margin and markup?
They use the same profit but a different base. Margin measures profit against the selling price, while markup measures the same profit against the cost. On a $40 item sold for $50, the $10 profit is a 20% margin (10 ÷ 50) but a 25% markup (10 ÷ 40). Markup is always the larger number because cost is smaller than price.
How do I price an item to hit a target margin?
Divide the cost by 1 minus the margin written as a decimal: price = cost ÷ (1 − margin ÷ 100). For a 20% margin on a $40 cost, that is $40 ÷ 0.80 = $50.00. Do not just add 20% to the cost, that gives a markup, not a margin, and leaves you short.
Why can a gross margin never reach 100%?
Margin is profit divided by price, and profit can never be larger than the price itself unless the item cost nothing. At a 100% margin the cost would have to be zero. Markup has no such ceiling, since it is measured against cost, a $1 item sold for $5 has a 400% markup but only an 80% margin.
Is this the same as net profit?
No. This calculator works out gross margin, which only accounts for the direct cost of the goods. Net profit also subtracts overheads like rent, wages, shipping, fees, and taxes, so it is lower. Use gross margin for pricing decisions and net profit to judge overall profitability.

Last updated: 2026-07-02