Margin Calculator

Margin calculator: a selling price of 100 dollars and a cost of 70 dollars gives a profit of 30 dollars and a margin of 30 percent
Price $100, cost $70: profit $30.00, margin 30.00%.

Margin Calculator

Gross margin: 30.00%

Profit: $30.00. Markup on cost: 42.86%.

Direct answer: A margin calculator works out gross margin from a selling price and a cost. Sell at $100 with a cost of $70 and the profit is $30.00, the gross margin is 30.00%, and the markup on cost is 42.86%. Margin divides the profit by the selling price. Markup divides the same profit by the cost, which is why the two numbers are never the same.

By Average Calculator Team. Last reviewed: 16 November 2026.

How margin is calculated

Gross margin is the share of the selling price that is left after paying the cost of the item. The formula is margin = (price – cost) / price x 100. Profit is price minus cost. Markup is a different number from the same profit: markup = (price – cost) / cost x 100. Because margin divides by the larger number, the price, margin is always smaller than markup on the same sale. A 30% margin on a $100 sale is the same $30 profit as a 42.86% markup on a $70 cost. For the profit on a loan or a saving instead, see the simple interest calculator.

Margin matters because it is the money left to pay rent, wages, tax, and everything else before profit. A shop that sells $10,000 of goods at a 30% margin keeps $3,000 before those costs. A shop with a 10% margin on the same sales keeps only $1,000. Small changes in margin move the whole business, which is why sellers check it on every product line.

Margin versus markup: the same 30 dollar profit is a 30 percent margin on price and a 42.86 percent markup on cost
Margin divides by price. Markup divides by cost. Same profit, different percent.

Worked examples

Example 1: Selling price $100, cost $70. Profit is $100 – $70 = $30.00. Margin is $30 / $100 x 100 = 30.00%. Markup is $30 / $70 x 100 = 42.86%.

Example 2: Selling price $250, cost $180. Profit is $250 – $180 = $70.00. Margin is $70 / $250 x 100 = 28.00%. Markup is $70 / $180 x 100 = 38.89%.

Example 3: Selling price $49.99, cost $32.00. Profit is $49.99 – $32.00 = $17.99. Margin is $17.99 / $49.99 x 100 = 35.99%. Markup is $17.99 / $32.00 x 100 = 56.22%. A small item can carry a high margin and still leave little money per sale.

Example 4, setting a price from a target margin: cost $60 and a target margin of 40%. The price is cost / (1 – margin) = $60 / (1 – 0.40) = $60 / 0.60 = $100.00. Profit is $100 – $60 = $40.00, and markup is $40 / $60 x 100 = 66.67%. To check the price change in percent, use the percentage calculator.

Margin target example: to keep a 40 percent margin on a cost of 60 dollars, the selling price must be 100 dollars
A 40% margin on a $60 cost needs a $100 price.

Margin and markup at a glance

The table shows the same $30 profit at three price points. The margin falls as the price rises against the same cost, because the profit is a smaller share of a bigger price.

Price Cost Profit Margin Markup
$100.00 $70.00 $30.00 30.00% 42.86%
$150.00 $120.00 $30.00 20.00% 25.00%
$300.00 $270.00 $30.00 10.00% 11.11%

Margin can never reach 100%, because the profit is always less than the price. Markup has no ceiling: a $1 cost sold for $100 is a 9,900% markup and a 99% margin. When someone quotes a margin above 100%, they mean markup, or the number is wrong. For a full view of a business loan, see the loan calculator.

Common mistakes

Mixing up margin and markup: margin divides by price, markup divides by cost. A 30% margin is a 42.86% markup on the same sale. Quoting the wrong one understates or overstates the business by a wide gap.

Forgetting the other costs: gross margin covers only the cost of the item. Rent, wages, shipping, and tax come out of the margin, so a 30% gross margin is not a 30% profit. Net margin is what is left after every cost, and it is always lower.

Pricing from cost plus a percent: adding 30% to a $70 cost gives $91, not a 30% margin. A 30% margin on a $70 cost needs a price of $70 / (1 – 0.30) = $100.00. Cost-plus pricing and margin pricing are different formulas.

Rounding the price down: a price of $99.99 instead of $100.00 on a $70 cost gives a margin of $29.99 / $99.99 x 100 = 29.99%. The one cent looks small, but across thousands of sales it is real money. Check the compound interest calculator to see how small gaps grow over time.

Frequently asked questions

What is gross margin?

Gross margin is the share of the selling price left after paying the cost of the item. It equals the selling price minus the cost, divided by the selling price, times 100. A price of 100 dollars and a cost of 70 dollars gives a profit of 30 dollars and a margin of 30 percent.

How do I 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. On a price of 100 dollars and a cost of 70 dollars, the profit is 30 dollars, and 30 divided by 100 times 100 is a margin of 30 percent.

What is the difference between margin and markup?

Margin divides the profit by the selling price, and markup divides the same profit by the cost. On a price of 100 dollars and a cost of 70 dollars, the margin is 30 percent and the markup is 42.86 percent. Margin is always smaller than markup on the same sale, and margin can never reach 100 percent.

How do I set a price from a target margin?

Divide the cost by one minus the target margin as a decimal. For a 40 percent margin on a cost of 60 dollars, the price is 60 divided by 0.60, which is 100 dollars. The profit is 40 dollars, and the markup is 66.67 percent.

Can margin be more than 100 percent?

No. Margin is the profit divided by the selling price, and the profit is always less than the price, so margin is always under 100 percent. Markup has no ceiling. A 1 dollar cost sold for 100 dollars is a 9900 percent markup and a 99 percent margin.

What is a good gross margin?

It depends on the business. Grocery stores often run near 25 percent, clothing stores often run near 50 percent, and software can run above 80 percent, because the cost of each extra sale differs so much. Compare your margin with similar businesses in your own trade, and watch it over time rather than judging one sale.

Note: This calculator is for education and planning only. It works out gross margin from a price and a cost you enter. It does not include rent, wages, shipping, tax, or other business costs, so gross margin is not net profit. The results here are estimates, not financial advice.

Last updated: November 16, 2026.