Revenue − COGS

Gross margin calculator

Gross margin is revenue minus cost of goods sold, divided by revenue. Three product lines with $180,000 of revenue and $100,500 of COGS earn $79,500 of gross profit, a blended gross margin of 44.2%.

Profit Margin Calc editorial teamUpdated 4 sources

Calculator 04

Gross margin

One product line or a blend of three

Try:

Line A

$
$

Line B (optional)

$
$

Line C (optional)

$
$

Target

%
Gross margin44.17%blended, all lines
Gross profit$79,500revenue − COGS
COGS ratio55.83%COGS ÷ revenue
Markup on cost79.10%gross profit ÷ COGS

On $180,000 of revenue and $100,500 of cost of goods sold, gross profit is $79,500 and the gross margin is 44.17%.

RevenueCOGSGross profitMarginShare of profit
Line A$120,000$78,000$42,00035.0%52.8%
Line B$45,000$18,000$27,00060.0%34.0%
Line C$15,000$4,500.00$10,50070.0%13.2%
Total$180,000$100,500$79,50044.2%100%

At a 45.0% target gross margin, $180,000 of revenue allows $99,000 of COGS and leaves $81,000 of gross profit (you are 0.8% points below it).

Formula. Gross profit = revenue − COGS. Gross margin = gross profit ÷ revenue. Blended margin = total gross profit ÷ total revenue (not the average of the line margins).

Gross margin formula

Gross margin is gross profit as a percentage of net sales, where gross profit is net sales minus the cost of goods sold.[1]

Gross margin=Revenue − COGSRevenue

Use net sales: revenue after returns, allowances and discounts. For a business that buys goods to resell, cost of goods sold is beginning inventory plus purchases and freight-in, minus ending inventory; a manufacturer adds direct labor and production overhead.[2][3] General expenses such as office rent, salaries outside production and advertising are not part of COGS.

Gross profit vs gross margin

Gross profit is a dollar amount; gross margin is that amount as a share of revenue. In the example above, line A earns the most gross profit ($42,000) but has the lowest gross margin (35.0%), while line C earns $10,500 at 70.0%.

LineRevenueCOGSGross profitGross margin
Line A$120,000$78,000$42,00035.0%
Line B$45,000$18,000$27,00060.0%
Line C$15,000$4,500$10,50070.0%
Blended$180,000$100,500$79,50044.2%

A shift in sales mix changes the blended margin even if no price or cost changes. If line A grows faster than the others, the business margin falls; this is a common reason a store's margin drifts without any single product getting worse.

Gross margin by kind of retail business

Gross margins vary widely by kind of business: in the Census Bureau's Annual Retail Trade Survey for 2022, the range ran from 24.3% to 53.6%.[4]

U.S. retail gross margin as a % of sales, 2022
Kind of businessNAICSGross margin
Total retail44–4531.1%
Furniture and home furnishings stores44251.0%
Electronics and appliance stores44329.4%
Building materials and supplies dealers444136.0%
Grocery stores445128.0%
Beer, wine and liquor stores445331.1%
Health and personal care stores44632.9%
Pharmacies and drug stores4461128.0%
Automotive parts, accessories and tire stores441348.1%
Clothing stores448150.6%
Shoe stores448250.9%
Sporting goods, hobby and musical instrument stores451144.6%
Department stores452242.0%
Warehouse clubs and supercenters45231124.3%
Miscellaneous store retailers45353.6%
Electronic shopping and mail-order houses454139.6%

The survey's gross margin is sales minus cost of goods sold, measured across all firms of each kind, so it is a benchmark for the category rather than a target for any one shop.

How to raise gross margin

  • Price. A small increase goes straight to gross profit; the price increase calculator shows how many sales you could lose and still come out ahead.
  • Unit cost. Volume discounts, cheaper inbound freight and less waste all lower COGS.
  • Mix. Promote the lines with the highest margins; the blended margin follows.
  • Discounts and returns. They reduce net sales without reducing COGS. Check the effect with the discount calculator.

Gross margin is only the first line of profitability. To see what is left after operating costs, interest and tax, continue to the net profit margin calculator; for per-unit pricing use the margin calculator.

Frequently asked questions

How do you calculate gross margin?

Subtract cost of goods sold from revenue, divide by revenue and multiply by 100. $50,000 of sales with $31,000 of COGS gives a 38% gross margin.

What is the difference between gross profit and gross margin?

Gross profit is the dollar figure (revenue minus COGS). Gross margin is that figure divided by revenue, expressed as a percentage.

Is gross margin the same as markup?

No. Gross margin divides gross profit by revenue; markup divides it by cost. A 38% gross margin equals a 61.3% markup.

What is a good gross margin?

It depends on the industry, because each industry has different operating costs to pay from gross profit. Compare with the retail table above or with businesses like yours.

Does gross margin include shipping?

Freight to bring goods in is part of cost of goods sold. Shipping to customers is usually a selling expense, though some sellers include it in COGS; be consistent from period to period.

Sources

  1. Principles of Accounting, Volume 1: Financial Accounting, Chapter 6 key terms (gross margin, gross profit margin ratio) · OpenStax, Rice University, 2019
  2. Publication 334, Tax Guide for Small Business (chapters 6 and 7: cost of goods sold and gross profit) · Internal Revenue Service, reviewed April 30, 2026
  3. About Form 1125-A, Cost of Goods Sold · Internal Revenue Service, accessed 2026-11-13
  4. Annual Retail Trade Survey: 2022 (benchmarked), gross margin as a percentage of sales by kind of business · U.S. Census Bureau, August 31, 2026