How to Calculate Gross Margin
To calculate gross margin, subtract cost of goods sold from revenue, divide the gross profit by revenue, and multiply by 100. Use the calculator to check margin, markup, and target revenue.
Written and checked by TheToolNet Editorial Team · Last reviewed: September 27, 2026 · Editorial method
Gross margin % = (revenue − cost of goods sold) ÷ revenue × 100.
Calculate gross profit and margin
Gross profit, margin, and markup
Gross profit is a currency amount: revenue minus cost of goods sold. Gross margin divides that profit by revenue. Markup divides the same profit by cost. Because the denominators differ, a 50% markup produces a 33.33% margin, not 50%.
Worked example
If revenue is 100,000 and cost of goods sold is 60,000, gross profit is 40,000. Divide 40,000 by 100,000 to get a 40% gross margin. Divide it by 60,000 to get a 66.67% markup.
Find revenue for a target margin
Holding cost constant, target revenue = cost ÷ (1 − target margin). This is the same logic used to price a product from cost and a desired margin. The result does not account for whether customers will accept that price or whether cost changes with volume.
What belongs in cost of goods sold?
Use costs directly associated with producing or acquiring the sold goods under your accounting policy. Operating expenses such as general administration are normally below gross profit, but classifications vary by business and reporting framework.
Related tools
Use the margin vs markup calculator for unit pricing, the profit margin calculator for Excel for spreadsheet formulas, and the break-even calculator for the required sales volume.
Frequently asked questions
Can gross margin be negative?
Yes. It is negative when cost of goods sold exceeds revenue.
Is gross margin the same as net margin?
No. Net margin also reflects operating expenses, interest, tax, and other items.