★ GUIDES · MONEY · HOW TO CALCULATE

How to Calculate Gross Margin: A Step-by-Step Guide

To calculate gross margin, subtract COGS from revenue and divide by revenue: $100,000 of revenue and $60,000 of COGS is a 40.00% gross margin. This guide works the method step by step — the formula, the worked example, markup vs margin, and the mistakes that shrink the answer — and the gross-margin-calculator page does the same calculation for your own numbers, with the branches and the reverse check. The cost-of-goods-sold-calculator page is the COGS tool — working out the cost itself — not the margin on it; the profit-margin-calculator page is the PROFIT-MARGIN tool — margin on any profit figure — not gross margin specifically; and the how-to-calculate-gross-profit-margin guide is the GROSS-PROFIT-MARGIN guide — the margin alone — not the markup conversion or the target price.

How to calculate gross margin, step by step

To calculate gross margin, take the revenue, subtract the cost of goods sold, and divide the answer by the revenue. The formula is margin = (revenue − COGS) ÷ revenue, and the gross profit is the revenue minus the COGS. The margin is a percentage: it says what share of every dollar taken in is left after paying for the goods themselves. On the worked example below, $100,000 of revenue and $60,000 of COGS gives a gross profit of $40,000 and a gross margin of 40.00% — forty cents of every dollar is gross profit, and sixty cents paid for the goods.

The worked example: $100,000 of revenue, $60,000 of COGS

The worked example, step by step. Step 1 — write down the two inputs: the revenue is $100,000 and the cost of goods sold is $60,000. Step 2 — work out the gross profit: $100,000 − $60,000 is $40,000. Step 3 — divide the profit by the revenue: $40,000 ÷ $100,000 is 0.40. Step 4 — turn it into a percentage: 0.40 × 100 is 40.00%. Step 5 — check it by going the other way: 40.00% of $100,000 is $40,000, which is the gross profit — the round trip closes, so the answer is right. Step 6 — read the markup while you are here: $40,000 ÷ $60,000 is 66.67%, which is the same profit measured against the cost instead of the price.

What gross margin is

Gross margin is the share of the selling price you keep before rent, wages, tax and everything else. It is not the profit of the business — that is the net margin, which comes after every other cost — but it is the first and most useful test of whether the pricing works at all. A 40.00% gross margin means forty cents of every dollar survives the cost of the goods; the other sixty cents is gone before the business has paid a single bill. A business with a 40.00% gross margin and low overhead can be very profitable, and a business with a 60.00% gross margin and heavy overhead can lose money. The margin tells you how much room the pricing leaves for everything else, and nothing more.

Markup vs margin: the confusion that costs money

Markup and margin describe the same profit from opposite sides, and mixing them up is the most expensive mistake in pricing. Margin divides the profit by the price: $40,000 of profit on $100,000 of revenue is a 40.00% margin. Markup divides the profit by the cost: the same $40,000 on $60,000 of cost is a 66.67% markup. To convert a markup into a margin, divide the markup by one plus the markup: 66.67% ÷ 166.67% is 40.00%. To convert a margin into a markup, divide the margin by one minus the margin: 40.00% ÷ 60.00% is 66.67%. The two are equal only at 0%, and they cross at 100% markup, which is a 50% margin. If a supplier, a client or a spreadsheet gives you a percentage without saying which one it is, ask — a quote built on a 40% markup when you meant a 40% margin leaves $11,428.57 on the table on every $100,000 of sales. Work both conversions in the gross-margin-calculator, which shows them side by side.

How to price for a target margin

To price for a target margin, divide the cost by one minus the margin: price = cost ÷ (1 − margin). At a 40.00% margin, $60,000 of cost prices at $60,000 ÷ 0.60, which is $100,000.00. At a 25% margin the same cost prices at $80,000.00, and at a 60% margin it prices at $150,000.00. And $45,000 of cost at a 40.00% margin prices at $75,000.00. The formula is the margin formula run backwards: the margin is the profit divided by the price, so the price that holds a given margin on a given cost is the cost divided by what is left after the margin. A 25% markup is a 20.00% margin, so a price built on markup alone will always hold less margin than the markup number suggests — run the target price through the calculator before you quote it.

Common mistakes

The first mistake is using markup where margin belongs: pricing at "40% markup" when the business needs a 40% margin, which leaves $11,428.57 of profit behind on every $100,000 of sales. The second is putting the wrong things in COGS: revenue minus the cost of the goods is the gross profit, but if wages, rent or marketing slip into COGS, the margin looks worse than it is, and if materials are left out, it looks better. The third is comparing margins between businesses that count COGS differently: a retailer and a manufacturer put different things in the line, so their margins are not comparable. The fourth is treating gross margin as profit: a 40.00% gross margin can sit next to a business losing money once overhead is counted. And the fifth is chasing margin by cutting cost alone: cutting COGS by $10,000 takes the margin from 40.00% to 50.00%, but raising the price by $10,000 takes it further, and the customers you lose to the higher price are the cost the formula cannot see.

A quick check you can do in your head

You can sanity-check any gross margin without a calculator. First, the margin must sit between the markup and zero in the usual case: a 66.67% markup gives a 40.00% margin, and the margin is always smaller than the markup when both are positive. Second, the profit must be the revenue minus the COGS: $100,000 − $60,000 is $40,000, and if the profit does not match, one of the inputs is wrong. Third, the round trip must close: 40.00% of $100,000 is $40,000. Fourth, the target price must hold the margin: $60,000 ÷ 0.60 is $100,000.00, and a price below the cost means a negative margin — $120,000 of COGS on $100,000 of revenue is a −20.00% margin, which is a loss on every sale. If a calculator breaks any of these checks, the number is wrong — run your numbers through the gross-margin-calculator and compare them with the worked example above.

Frequently asked questions

How do you calculate gross margin?

Subtract COGS from revenue, then divide by revenue: ($100,000 − $60,000) ÷ $100,000 is 40.00%. The gross profit is $40,000.

What is the difference between margin and markup?

Margin divides the profit by the price; markup divides it by the cost — a 66.67% markup is a 40.00% margin. The same $40,000 of profit is 40.00% of the price and 66.67% of the cost.

How do you price for a 40% margin?

Divide the cost by one minus the margin: $60,000 ÷ 0.60 is $100,000.00. That is the price that holds a 40.00% margin on $60,000 of cost.

Is gross margin the same as net margin?

No — gross margin is revenue minus COGS; net margin is profit after every cost, including rent, wages and tax. A 40.00% gross margin can sit next to a business losing money.

Can gross margin be 100%?

Only with $0 COGS — $100,000 of revenue and no cost is a 100.00% margin. The markup is undefined there, because there is no cost to divide by.

What is a good gross margin?

It depends on the trade — retailers often run 20–40% and software far higher. Compare against businesses that count COGS the same way.