Gross margin = (Revenue − COGS) ÷ Revenue × 100. Subtract the cost of goods sold (COGS) from revenue to get gross profit, divide by revenue, and multiply by one hundred to express it as a percentage. If you sell a product for forty dollars and it costs sixteen dollars to make, your gross margin is sixty percent. It tells you what share of each sales dollar is left after the direct cost of the product — before you pay for shipping, ads, fees, or rent.
What is the gross margin formula?
Gross margin measures how much of every revenue dollar survives after you pay for the product itself. It is the cleanest read on whether a product is priced above what it costs to make.
The formula has two forms, and they give the same answer:
- As a dollar amount (gross profit):
Gross profit = Revenue − COGS - As a percentage (gross margin):
Gross margin % = (Revenue − COGS) ÷ Revenue × 100
COGS is the direct cost of the goods you sold — the raw materials, the blank product, the manufacturing or print cost. It does not include shipping to the customer, payment fees, advertising, salaries, or software. Those come out later, which is exactly why gross margin alone can flatter a business that is actually losing money on each sale.
As Polar Analytics notes, the margin sitting in your accounting software is almost never the margin you actually keep — discounts, returns, refunds, and free-shipping subsidies quietly chip it down, and most stores never see the gap.
Gross margin formula with a worked example
Say you run a print-on-demand shirt store. You sell one tee for $40, and the blank garment plus printing costs you $16.
Walk it through:
- Gross profit:
$40 − $16 = $24 - Gross margin:
$24 ÷ $40 × 100 = 60%
So sixty cents of every sales dollar is left after the shirt is made. That $24 is not profit you keep — it is the pool you draw from to cover everything else: the carrier, the card processor, the ad that found the buyer, and your fixed overhead.
You can run the same math across a whole month. If you did $40,000 in revenue and your product cost was $16,000, gross profit is $40,000 − $16,000 = $24,000, and gross margin is $24,000 ÷ $40,000 × 100 = 60%. The percentage holds whether you look at one order or a thousand, as long as your cost ratio stays put.
Gross profit vs. gross margin
People use these two terms loosely, but they are not the same thing.
- Gross profit is a dollar figure:
Revenue − COGS. In the example,$24per order. - Gross margin is a ratio, gross profit as a percentage of revenue:
60%.
Gross profit tells you how much you made above product cost. Gross margin tells you how efficient the pricing is, which lets you compare a $12 mug against a $90 hoodie on equal footing.
How to calculate gross margin step by step
You need only two numbers: revenue and COGS. Here is the sequence.
- Add up revenue. Total sales for the product or period, before any costs. Say
$40for one order. - Add up COGS. Every direct cost of producing what you sold — for print-on-demand, that is the base garment plus the print charge. Say
$16. - Subtract to get gross profit.
$40 − $16 = $24. - Divide by revenue.
$24 ÷ $40 = 0.60. - Multiply by one hundred.
0.60 × 100 = 60%.
The hardest part is step two. If you sell online, COGS scope drift is the classic error: is the supplier's flat fulfillment fee part of COGS or a separate shipping line? Either choice is defensible, but you have to pick one and hold it, or your margin will wobble for no real reason. According to Polar Analytics, for ecommerce, true COGS often includes inbound freight and transaction fees — a wider scope than most sellers apply by default.
Gross margin benchmarks for ecommerce and POD in 2026
Benchmarks matter only if you compare yourself to the right model. Based on TrueProfit's analysis of more than 5,000 ecommerce stores, a gross margin in the 60–70% range is what makes profitable scaling possible. Flowium's 2026 ecommerce research puts the healthy range at 50–70%, depending on business model, with the following guidance:
- 70%+ — excellent; strong pricing power and room to absorb ad cost increases.
- 60–70% — solid; supports reinvestment and scaling.
- 50–60% — healthy but may constrain growth.
- Below 50% — growth can quickly become financially unstable.
For print-on-demand specifically, your COGS is the base cost from Printify or Printful — no warehousing or inventory holding cost. That structural advantage means a well-priced POD store should aim for the upper half of the 50–70% range. The catch: dropshipping and POD margins, according to TrueProfit's data, can erode fast if ad performance drops or competition raises costs.
Gross margin is only the first number. According to Farabiu's 2026 benchmark research, gross margins typically cluster at 55–70% for ecommerce, but the gap between gross and net margin is "the most important number on your P&L" — because advertising, shipping, and platform fees are what decide whether a store actually makes money. See our net profit margin benchmark guide for where POD stores actually land after every cost.
Gross margin vs. net margin vs. contribution margin
Gross margin is the first of three margins, and the friendliest. Each one subtracts more cost, so each one is smaller and more honest about what you actually keep.
- Gross margin subtracts only COGS. Example:
($40 − $16) ÷ $40 = 60%. - Contribution margin subtracts all variable costs — COGS plus shipping, payment fees, pick-and-pack, and (in its strictest form) the ad spend to win the order.
- Net margin subtracts everything, including fixed costs like rent, salaries, and software.
Watch what happens to that same $40 order as the costs pile on. Say shipping is $5, the card fee is 4% of $40 = $1.60, and pick-and-pack labor is $1.40. Your contribution margin before ads is $40 − $16 − $5 − $1.60 − $1.40 = $16, a ratio of $16 ÷ $40 = 40%. Then say you spent $10 in ads to land the sale: $16 − $10 = $6, or a $6 ÷ $40 = 15% margin after ads.
The 60% gross margin quietly became 15% once real selling costs entered. That gap is the whole reason gross margin can mislead. Gross margin tells you whether a product is worth making; contribution margin tells you whether it is worth selling through this channel at this ad cost. According to EcomCalcTools' 2026 benchmarks, a SKU can look healthy at a strong gross margin and still lose money after customer acquisition cost, returns, fulfillment, and payment fees — making SKU-level contribution margin the number to check before scaling ads.
Margin vs. markup (the pricing mistake to avoid)
Margin and markup describe the same dollar gap between price and cost, but against different bases. Confusing them is one of the most common — and expensive — pricing errors.
- Markup is the gap over cost:
Markup % = (Price − Cost) ÷ Cost × 100. For the shirt:($40 − $16) ÷ $16 × 100 = 150%. - Margin is the gap over price:
Margin % = (Price − Cost) ÷ Price × 100. For the shirt:($40 − $16) ÷ $40 × 100 = 60%.
Same $24 gap. A 150% markup equals a 60% margin. If a supplier quotes you "150% markup" and you record it as a 150% margin, you will badly overstate your profitability. When you set prices, decide which base you are working from and label it.
How gross margin affects your break-even ROAS and ad spend
Gross margin is not just a reporting metric — it sets a hard ceiling on how much you can spend acquiring customers. Your break-even ROAS is 1 ÷ your gross margin ratio. At a 60% gross margin, break-even ROAS is 1 ÷ 0.60 = 1.67×. At a 40% gross margin, it jumps to 1 ÷ 0.40 = 2.5× — meaning thinner margins force higher ROAS targets just to avoid losing money, before a single fixed cost is counted.
This is why pricing changes and ad scaling decisions belong in the same conversation. If you raise the price of a shirt from $40 to $45 and keep the same $16 cost, gross margin moves from 60% to about 64%, and break-even ROAS drops. That extra headroom can be the difference between a profitable Meta campaign and one that burns cash. For a deeper dive on this math, see how increasing average order value shifts the break-even equation, or explore CRO techniques that improve the revenue side without touching ad spend.
A leaky checkout wastes ad dollars you have already spent, which is why your checkout completion rate belongs in the same margin conversation.
Why gross margin alone can lie about profit
Here is what the top pages on this topic tend to skip: a healthy gross margin does not mean you are making money. It only means your price sits above your product cost. Everything between gross margin and the bank — shipping, fees, returns, and especially ad spend — decides whether the order was actually profitable.
Ad spend is usually the largest hidden cost. That is why a return-on-ad-spend number can look great while the order loses money. The catch is that these numbers live in different tools. Product cost sits in your supplier account, fees in your processor, ad spend in two ad platforms, and revenue in your store. Stitching them into a real per-order profit figure by hand is slow and error-prone.
That is the gap PodVector closes for print-on-demand sellers on Shopify. It connects Shopify, Meta Ads, Google Ads, Printify, and Printful into a live data warehouse, then computes the true per-order profit — revenue minus product cost, shipping, fees, and the ad spend that won each order — instead of stopping at gross margin. Victor, its AI employee, reads that live data, proposes moves you approve, and executes the approved writes on the Shopify side. He reads your ad platform data but does not touch ad accounts. It is not a dashboard you have to interpret — Victor surfaces the action and waits for your go-ahead.
For POD sellers specifically, Victor can reprice products to a target margin in bulk, adjust free-shipping thresholds, and create or update discount rules — all Shopify-side — based on the margin picture the warehouse reveals. See how the full workflow fits together in the PodVector for print-on-demand overview, and how it pairs with your Printify setup in the Printify seller setup guide.
Once you can see profit per order, the next question is whether a customer earns back what you paid to acquire them. For the full map of how gross margin fits alongside COGS, ROAS, CAC, and net margin, see our net profit margin benchmark.
FAQs
What is the gross margin formula?
Gross margin equals revenue minus cost of goods sold, divided by revenue, times one hundred: Gross margin % = (Revenue − COGS) ÷ Revenue × 100. For a $40 product that costs $16 to make, that is ($40 − $16) ÷ $40 × 100 = 60%. The dollar version, Revenue − COGS, gives you gross profit — $24 in that example.
What is a good gross margin?
For ecommerce, a gross margin in the 60–70% range supports profitable scaling, according to TrueProfit's analysis of more than 5,000 stores. Below 50% and growth becomes financially unstable quickly. For print-on-demand, your structural advantage — no warehousing or inventory — means you should realistically target the upper half of that range. What matters more than hitting a universal number is whether your gross margin leaves enough room to cover shipping, fees, ads, and overhead and still land a positive net margin.
Is gross margin the same as gross profit?
No. Gross profit is a dollar amount — Revenue − COGS, or $24 on that $40 order. Gross margin is that profit as a percentage of revenue — $24 ÷ $40 × 100 = 60%. Use gross profit to see total dollars earned above product cost, and gross margin to compare efficiency across products with different prices.
What is the difference between gross margin and net margin?
Gross margin subtracts only the direct cost of the product (COGS). Net margin subtracts everything — COGS plus shipping, fees, advertising, salaries, rent, and software. Gross margin is always the larger, friendlier number; net margin is the one that says whether the whole business made money. A strong gross margin can easily land at a single-digit net margin once every cost is counted.
Does gross margin include shipping and advertising?
No. Shipping, payment fees, and advertising are not part of COGS, so they do not touch gross margin. They come out at the contribution-margin and net-margin stages. This is the key limitation of gross margin: it can look healthy while ads and shipping quietly turn each order into a loss. To judge whether an order actually paid off, you need contribution margin or true per-order profit, not gross margin alone.
How do I convert markup to margin?
Use Margin = Markup ÷ (1 + Markup). A 150% markup (1.5 as a decimal) converts to 1.5 ÷ 2.5 = 0.60, or a 60% margin. Going the other way, Markup = Margin ÷ (1 − Margin), so a 60% margin is 0.60 ÷ 0.40 = 1.5, a 150% markup. Both describe the same $16-cost, $40-price product.
What gross margin do I need before scaling ads?
Your break-even ROAS is 1 ÷ gross margin ratio, so the lower your margin, the higher the ROAS you must hit before a single fixed cost is covered. As a practical rule, EcomCalcTools' 2026 benchmarks suggest targeting at least 30% contribution margin — after shipping, processing fees, and ad spend — before aggressively scaling ad budgets. If your gross margin is too thin to leave 30% after variable costs, fix the margin first: reprice, renegotiate supplier costs, or raise your average order value before turning up spend.