Gross margin = (Revenue − COGS) ÷ Revenue × 100. You subtract the cost of goods sold (COGS) from revenue to get gross profit, then 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.

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, $24 per 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.

  1. Add up revenue. Total sales for the product or period, before any costs. Say $40 for one order.
  2. 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.
  3. Subtract to get gross profit. $40 − $16 = $24.
  4. Divide by revenue. $24 ÷ $40 = 0.60.
  5. 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. A dedicated COGS calculator helps you draw that line consistently across every SKU.

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.

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.

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. If you want to see how ad efficiency ties back to margin, the ROAS formula breaks down the break-even math: your break-even ROAS is 1 ÷ your margin ratio, so a thinner margin forces a higher ROAS just to avoid a loss. And a leaky checkout wastes the ad dollars you already spent, which is why your checkout conversion rate belongs in the same conversation.

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. It connects Shopify, Meta Ads, Google Ads, Printify, Printful, and Stripe, 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 operator, analyzes that live data and proposes moves you approve, executing the writes on the Shopify side; he reads your ad data but does not touch your ad account. It is not a dashboard you have to read — it does the reconciliation for you.

Once you can see profit per order, the next question is whether a customer earns back what you paid to acquire them. That is a lifetime-value question — walk it through with the LTV calculator. For the full map of how gross margin fits alongside COGS, ROAS, CAC, and net margin, start with the ecommerce metrics guide.

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?

It depends entirely on your business model, so treat any single benchmark with suspicion. A print-on-demand apparel store, a grocery reseller, and a software company have wildly different cost structures. What matters more than hitting a target number is whether your gross margin leaves enough room to cover shipping, fees, ads, and overhead and still keep a positive net margin. A 60% gross margin that shrinks to a 5% net margin after every cost is a business on a knife's edge.

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 60% 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.