Back

Gross Margin Formula: How to Calculate Gross Margin, What Moves It and How to Read a Change

Guide · · Published December 2026 · 8 min read

By Ashwin Gopinath, CEO

TL;DR

The gross margin formula is gross margin = (revenue - cost of goods sold) / revenue x 100. Revenue minus cost of goods sold is gross profit, in dollars. Gross margin is that profit as a percentage of revenue. A company with $2,000,000 of revenue and $1,300,000 of cost of goods sold has $700,000 of gross profit and a 35% gross margin. Five things move it: price, mix, unit cost, shrink and freight. This guide is published by Sentra, a management agent that does the work: it joins the ledger with email, chat and meetings, so when gross margin moves it explains the movement with sources.

The gross margin formula

Gross margin is revenue minus cost of goods sold, divided by revenue. The gross profit margin formula is the same calculation under a longer name.

MeasureFormulaUnit
Gross profitRevenue - cost of goods soldDollars
Gross margin(Revenue - cost of goods sold) / revenue x 100Percent of revenue
Gross margin per unit(Price - unit cost) / price x 100Percent of price
Markup(Price - unit cost) / unit cost x 100Percent of cost
Price for a target marginUnit cost / (1 - target margin)Dollars
  • Revenue is net sales: gross sales less returns, discounts and allowances.
  • Cost of goods sold is the direct cost of what was sold. For a product company that is materials, direct labor, production overhead and inbound freight. For a service or software company it is the cost of delivery, such as hosting and support staff.
  • Selling, marketing, administrative and research costs sit below gross profit and stay out of the formula.

How to calculate gross margin: a worked example

To calculate gross margin, subtract cost of goods sold from net revenue and divide the result by net revenue. The figures here are an example with round numbers.

LineCalculationResult
Net revenueGiven$2,000,000
Cost of goods soldGiven$1,300,000
Gross profit2,000,000 - 1,300,000$700,000
Gross margin700,000 / 2,000,000 x 10035%

The same sum works for one unit. A product that costs $65 and sells for $100 earns $35 of gross profit and a 35% gross margin. To find the price that gives a target margin, divide the unit cost by one minus the margin: 65 / (1 - 0.35) = $100.

Gross profit vs gross margin

Gross profit is a dollar amount and gross margin is a percentage of revenue. Gross profit says how much money is left to pay for everything below the line. Gross margin says how much of each sales dollar the company keeps, which makes periods, products and companies of different sizes comparable.

The two can move in opposite directions. Next quarter the example company sells more: revenue rises to $2,400,000 and cost of goods sold to $1,632,000. Gross profit rises to $768,000 while gross margin falls to 32%. The company earned more dollars and kept less of each one. Report both figures together.

Margin and markup

Margin divides gross profit by price, and markup divides it by cost. The $100 product with a $65 cost has a 35% margin and a 53.8% markup (35 / 65). Quoting one when the other was meant is a common source of pricing errors.

Gross margin is also different from contribution margin, which subtracts all variable costs, including variable selling costs, and leaves fixed production costs out.

What moves gross margin

Five things move gross margin: price, mix, unit cost, shrink and freight. A change in the headline figure is nearly always a combination of them.

DriverHow it moves the marginWhere the figure shows up
PriceDiscounts, promotions, rebates and list price changes alter revenue per unit with no change in costNet revenue per unit, discount and rebate accounts
MixSelling more of a lower-margin product, channel or customer lowers the blend even when no single margin changesSales by product, channel and customer
Unit costSupplier price changes, labor rates, yield and production volume change the cost of each unitPurchase price variance, standard cost updates
ShrinkTheft, damage, spoilage, write-offs and markdowns on old stock add cost with no matching saleInventory adjustments and write-down accounts
FreightInbound freight, duties and expedited shipping raise landed costFreight-in and landed cost accounts

Price has the largest effect per point. On a 35% margin, a 2% price cut moves the price from $100 to $98 against the same $65 cost. The margin falls to 33 / 98 = 33.7%, a loss of 1.3 points, and the company needs 6.1% more units to earn the same gross profit (35 / 33). Old stock sold at a markdown has the same effect, which our guide to excess inventory covers.

How to read a change in gross margin

Read a change in gross margin by splitting it into its drivers, in points and in dollars, before discussing any of them. One margin point is 1% of revenue, so the size of each driver is easy to state in money.

Take the quarter above. Gross margin fell from 35% to 32% on $2,400,000 of revenue. Three points of margin is $72,000 of gross profit: at 35% the company would have earned $840,000, and it earned $768,000. An example split of that gap looks like this.

DriverMargin pointsGross profit
Promotional discount on two product lines-1.0-$24,000
Mix shift toward a lower-margin channel-0.8-$19,200
Supplier cost increase-0.6-$14,400
Expedited inbound freight-0.4-$9,600
Shrink and write-offs-0.2-$4,800
Total-3.0-$72,000

Then sort the drivers by what happens next.

  • One-off or recurring. An expedited shipment may end this month. A supplier price increase stays until someone renegotiates or reprices.
  • Chosen or unplanned. A promotion that was approved and hit its volume target is a decision working as intended. Shrink is a loss.
  • Owned by whom. Price belongs to sales or pricing, unit cost to procurement, freight to logistics and shrink to operations. Each line needs one name.

The method is the same as a price, volume and mix variance analysis, applied to margin. A month-over-month flux analysis of the cost accounts shows which lines to open first.

Common mistakes

  • Confusing margin with markup. A 50% markup is a 33.3% margin.
  • Using gross sales. Returns, discounts and rebates come off revenue first.
  • Changing what sits in cost of goods sold. Moving freight or warehouse labor in or out changes the margin with no change in the business. Note any reclassification beside the figure.
  • Reading the blend only. A steady company margin can hide one product line falling and another rising.
  • Stopping at the split. The bridge says which driver moved and by how much. It still needs the reason and an owner.

Where the explanation for the number lives

The ledger shows that gross margin moved, and the reason usually sits in email, chat and meetings. In the example, the ERP holds every figure in the bridge: the discount, the channel mix, the higher purchase price, the freight invoice and the write-off. The supplier's email announcing the increase, the chat thread where the promotion was extended by two weeks and the meeting where operations approved air freight to cover a late order all sit somewhere else.

Sentra is a management agent that does the work. It reads the ERP, CRM and BI tools alongside email, chat, meetings and documents, and joins the two: the systems of record say what happened, and the conversations say why. For gross margin, Sentra writes the explanation for each line of the bridge with a link to its source, puts it in the pre-read for the monthly review, and sends each driver to the person who owns it. At Lenskart, reports showed a top product line about 95% stocked while Sentra measured 12.8% availability on the shelves, the pattern our guide to stockouts and phantom inventory describes.

A named person approves anything Sentra drafts or raises before it reaches anyone else. Every line cites its source, and each reader sees only what they could already open in the source system.

To see Sentra explain a gross margin change in your own numbers, book a demo.

FAQ

What is the gross margin formula?

Gross margin = (revenue - cost of goods sold) / revenue x 100. With $2,000,000 of revenue and $1,300,000 of cost of goods sold, gross margin is 700,000 / 2,000,000 = 35%.

How do you calculate gross margin?

Take net revenue, subtract cost of goods sold to get gross profit, then divide gross profit by net revenue and multiply by 100. Use net revenue, after returns, discounts and allowances.

What is the difference between gross profit and gross margin?

Gross profit is a dollar amount: revenue minus cost of goods sold. Gross margin is gross profit as a percentage of revenue. $700,000 of gross profit on $2,000,000 of revenue is a 35% gross margin.

Is gross profit margin the same as gross margin?

Yes. Gross profit margin, gross margin and gross margin percentage are names for the same ratio: gross profit divided by revenue.

What is the difference between margin and markup?

Margin is gross profit divided by price. Markup is gross profit divided by cost. A product that costs $65 and sells for $100 has a 35% margin and a 53.8% markup.

What is a good gross margin?

It depends on the industry and the business model, so the useful comparisons are your own history, your plan and direct competitors with a similar cost structure. A margin that holds steady while revenue grows is a healthier sign than a high figure in one period.

Why would gross margin fall when sales rise?

Because the extra sales cost more to win or to supply. The usual causes are discounts, a shift in mix toward lower-margin products or channels, higher supplier or freight costs, and write-offs. Split the change into those drivers to see which one applies.