Quick Summary: The ecommerce contribution margin formula is net sales plus shipping revenue, minus COGS, ad spend, shipping and fulfillment, and merchant fees. What is left covers fixed costs and profit. A 4x ROAS can still lose money on this math, so this number, not platform ROAS, should decide how fast you scale.
- The ecommerce contribution margin formula: (net sales + shipping revenue) – COGS – ad spend – shipping and fulfillment – merchant fees.
- In our worked month, a 4.0x ROAS produced a $5,000 loss because break-even ROAS was 4.21x.
- 2025 median contribution margin was 29.7% under $10M, 27.3% from $10M to $50M and 13.0% above $50M.
- Shopify’s profit reports start from cost per item, so ad spend, fees and return costs need other data.
- Below 15% means fix costs before adding spend.
Ecommerce Contribution Margin Calculator
Calculate unit economics and profit after variable costs.
In this post
- What is contribution margin in ecommerce?
- The ecommerce contribution margin formula, line by line
- A worked example of how a 4x ROAS loses money
- Contribution margin vs gross margin vs ROAS
- What is a good ecommerce contribution margin?
- The costs everyone forgets, and what Shopify cannot show you
- From contribution margin to break-even ROAS to MER
- Common ecommerce contribution margin mistakes and the fixes
- How to improve ecommerce contribution margin
- Frequently asked questions
What is contribution margin in ecommerce?
Contribution margin in ecommerce is the money an order leaves after every variable cost, including the ad spend that won it. It sits above profit. It pays for fixed costs such as salaries, software and rent, and whatever remains after that is profit.
The textbook idea is sales revenue less variable costs. Variable costs rise and fall with orders, and for a store that pays for traffic, ad spend is one of them. Per order, the result sets a ceiling on what you can pay to win a sale. As a ratio, it lets you compare months and benchmarks.
Contribution margin is the money an order leaves after every variable cost, including the ad spend that won it.
The ecommerce contribution margin formula, line by line
The ecommerce contribution margin formula takes net sales plus shipping revenue, then subtracts COGS, ad spend, shipping and fulfillment, and merchant fees. Common Thread Collective published this version in March 2026. Divide the result by net sales plus shipping revenue to get the ratio.
Contribution margin = (Net sales + Shipping revenue) – COGS – Ad spend – Shipping and fulfillment – Merchant fees
Net sales means gross sales minus discounts, returns and refunds. A refunded order removes revenue but leaves most of its costs behind, so skipping that step flatters the result.
| Cost line | In the formula? | What to count |
|---|---|---|
| Net sales | Yes, as revenue | Gross sales minus discounts, returns and refunds |
| Shipping revenue | Yes, as revenue | What customers pay you for shipping |
| COGS | Yes | Product cost, packaging and inbound freight |
| Ad spend | Yes | Every paid channel, plus per-order creator or affiliate commissions |
| Shipping and fulfillment | Yes | Carrier cost, 3PL fees and return labels |
| Merchant fees | Yes | Shopify Payments, Stripe and PayPal fees |
| Retainers, salaries, software, rent | No | Fixed costs that sit below contribution margin |
Payment fees are variable because they scale with each order. Ad spend is variable too, even when you set budgets monthly. Finance teams draw the same line: paid media sits inside contribution margin, and fixed marketing sits in overhead.
A worked example of how a 4x ROAS loses money
In our example, a brand spends $100,000 on ads at a 4.0x ROAS and ends the month $5,000 below zero. The platform shows $300,000 of revenue above spend. The contribution margin formula shows a loss, because returns, shipping, fees and a 45% gross margin absorb it.
Kaaf Media Network, an ecommerce and retail marketing agency, built these figures to illustrate the math. They are not client data.
| Line | Amount | Note |
|---|---|---|
| Gross sales at list price | $430,000 | Before discounts |
| Discounts | -$30,000 | Promo codes and sale pricing |
| Order revenue | $400,000 | What the platform sees: $100,000 spend at 4.0x |
| Returns and refunds | -$60,000 | 15% of order revenue |
| Net sales | $340,000 | Order revenue minus returns |
| Shipping revenue | +$12,000 | Paid by customers |
| COGS | -$187,000 | 55% of net sales, a 45% gross margin |
| Ad spend | -$100,000 | All paid channels |
| Shipping and fulfillment | -$58,000 | Carrier, 3PL and return labels |
| Merchant fees | -$12,000 | Payment processing |
| Contribution margin | -$5,000 | -1.4% of net sales plus shipping revenue |
A 4x ROAS on a 20% gross margin with high shipping can lose money on every order.
The same math on one order
Spread across 4,000 orders, the average order is worth $100 at checkout and leaves $23.75 before ads. The brand pays $25.00 in ad spend to win it.
| Line | Per order |
|---|---|
| Order revenue | $100.00 |
| Average refund | -$15.00 |
| Net sales plus $3.00 shipping revenue | $88.00 |
| COGS | -$46.75 |
| Shipping and fulfillment | -$14.50 |
| Merchant fees | -$3.00 |
| Contribution before ad spend | $23.75 |
| Ad spend | -$25.00 |
| Contribution margin per order | -$1.25 |
The same month as CM1, CM2 and CM3
Finance teams often split contribution margin into three layers: CM1 after product cost, CM2 after shipping, fulfillment and fees, and CM3 after marketing. Our month reads CM1 $165,000 (46.9%), CM2 $95,000 (27.0%) and CM3 -$5,000 (-1.4%), each as a share of net sales plus shipping revenue. The formula in this guide ends at CM3.
Contribution margin vs gross margin vs ROAS
Gross margin counts only product cost. ROAS counts only the revenue each ad dollar brought in. Contribution margin counts every variable cost, so it is the only one of the three that shows whether an order paid you. Treat gross margin and ROAS as inputs to the contribution margin formula.
| Metric | Question it answers | What it misses |
|---|---|---|
| Gross margin | Does the product earn its price? | Shipping, fees, ad spend and return costs |
| ROAS | How much revenue did each ad dollar bring in? | Product cost, shipping, fees and returns |
| MER (marketing efficiency ratio) | How much store revenue does each marketing dollar bring in? | The same cost lines as ROAS, though no platform attribution is involved |
| Contribution margin | What is left after every variable cost? | Fixed costs |
The gap between gross margin and contribution margin is where the money goes. In Ecom CFO’s 2025 medians, gross margin was 70.5% for brands under $10M and 78.6% above $50M. Contribution margin was 29.7% and 13.0%.
ROAS measures how efficiently ads turned spend into revenue. Contribution margin measures whether any of it reached you.
Our 2026 Meta ROAS benchmarks show why a median near 1.9x is realistic and why headline ROAS rarely equals profit.
Why platform ROAS overstates brand search and retargeting
Platform ROAS credits every conversion an ad touched, including buyers who were already coming. Measured, an incrementality testing firm, finds that brands running rigorous tests often see 30% to 50% of attributed revenue in retargeting and brand search happen without the ads, according to an October 2026 Ecommerce Fastlane report. The same article says branded search ROAS commonly runs two to three times the measured incremental return.
In the contribution margin formula, use Shopify net sales as the revenue input, not Ads Manager conversion value. If purchase events are missing or duplicated, the math fails first, and our guide to Meta Conversions API event match quality covers that repair. Operators say the Ads Manager number is rarely the one that lands in the bank. Cost data closes that gap.
What is a good ecommerce contribution margin?
A common healthy range is 20% to 35% of net sales, and Common Thread Collective calls anything under 15% a danger zone. Medians in Ecom CFO’s 2025 data run from 29.7% for small brands to 13.0% for brands above $50M.
Ecom CFO’s full-year 2025 benchmark data covers 18 private DTC brands, so treat the medians as a reference and the sample as small.
| Revenue cohort | Median contribution margin | 5th to 95th percentile | Median ROAS |
|---|---|---|---|
| Under $10M | 29.7% | 23.7% to 40.8% | 7.25x |
| $10M to $50M | 27.3% | 17.9% to 34.8% | 3.60x |
| Over $50M | 13.0% | 11.2% to 35.4% | 3.17x |
Source: Ecom CFO, full-year 2025, benchmark page dated October 5, 2026. Its definition subtracts ad spend, merchant fees, pick-pack-ship and reverse logistics from gross profit, then divides by net revenue, which matches the contribution margin formula here. Large brands run thinner margins and make it up in volume.
Other sources set the floor in similar places. eightx calls a CM3 of 20% to 25% the minimum for sustainable growth. Definitions differ, so match yours before you compare. We read the evidence as three zones:
- Under 15%: fix cost lines before you add spend.
- 15% to 20%: add spend only on campaigns that clear break-even ROAS.
- Above 20%: you have room to test new channels and offers.
The costs everyone forgets, and what Shopify cannot show you

Returns, discounts and non-ad variable costs are the lines most often missing from a margin report. Returns reverse revenue but not ad spend or outbound shipping. Shopify’s profit reports start from cost per item, so ad spend, payment fees and return costs have to come from other systems.
How returns change the number
A refund removes revenue, but most of the cost to win and ship the order stays on your books. Analytics vendor Saras Analytics reports that customers typically start returns 30 to 45 days after purchase, so a January cohort can look strong in February and weaker by March. Read each month again after 45 days, and hold back a return allowance until then. If returned items cannot be resold, add the write-off to COGS.
How discounts change the number
Discounts cut net sales while product cost stays fixed. In Shopify’s own example, a $20 shirt that costs $10 shows a 50% margin on the product page, and 33% in the profit report after a 25% discount. Marketplace figures behave the same way, since TikTok Shop GMV includes refunds and discounts.
What Shopify can and cannot show
Per the Shopify Help Center, profit reports cover only products and variants that had a cost recorded at the time of sale, and cost per item is a static value. The order-level report adds shipping and duty costs. The page lists no ad spend and no payment fees. Use Shopify for net sales and cost per item, and pull the rest from other systems.
How to calculate ecommerce contribution margin in Shopify
- Enter cost per item on every variant, including packaging and inbound freight.
- Pull net sales and shipping revenue for the month from Shopify.
- Add ad spend from every paid channel for the same dates.
- Add carrier, 3PL, return-label and merchant fees for the same dates.
- Apply the contribution margin formula, then divide by net sales plus shipping revenue.
- Run the month again after 45 days and compare the two readings.
From contribution margin to break-even ROAS to MER
Break-even ROAS is 1 divided by your contribution margin before ad spend, measured as a share of order revenue. In our example that share is 23.75%, so break-even ROAS is 4.21x. The brand runs at 4.0x, which is why it loses money.
That share is the CM2 line from the month above: $95,000 on $400,000 of order revenue. Every point of margin you lose raises the ROAS you need.
| Contribution before ad spend, share of order revenue | Break-even ROAS |
|---|---|
| 25% | 4.00x |
| 23.75% (our example) | 4.21x |
| 20% | 5.00x |
| 15% | 6.67x |
Deeper discounts, higher return rates and rising shipping costs push a brand down this table. Higher Q4 CPMs lower the ROAS you can deliver at the same time, and our guide to Q4 Meta CPM inflation covers that side.
If your contribution margin is negative, scaling ad spend makes you busier, not profitable.
How to set a maximum CAC from contribution margin
Your maximum ad cost per order equals contribution margin before ad spend per order. Here that is $23.75. The brand pays $25.00 in customer acquisition cost (CAC), so each order loses $1.25. New-customer orders can sit above this line only if repeat purchases repay the gap, and cohort data has to prove it.
Where MER fits
MER divides total store revenue by total marketing spend, and it does not depend on which platform claims credit for a sale. Break-even MER follows the same 1-divided-by-margin logic, applied to total revenue and total marketing spend.
Decision rule: do not raise spend on a channel until its ROAS clears break-even ROAS, and do not trust a channel’s ROAS until you have tested how much of it is incremental.
Common ecommerce contribution margin mistakes and the fixes
Most wrong contribution margin numbers trace back to three inputs: platform revenue used instead of store revenue, returns left out, and costs filed under the wrong heading. Each is fixed by changing the input, and none needs a new contribution margin formula.
| Mistake | What it does | Fix |
|---|---|---|
| Using Ads Manager revenue | Overstates revenue, because platforms credit sales that would have happened anyway | Use net sales from Shopify |
| Filing shipping and 3PL fees under overhead | Raises margin on paper | Put them inside the formula |
| Stale cost per item | Margin drifts when supplier prices change | Update the field whenever costs change |
| Averaging across the catalog | Hides products that lose money on every order | Calculate by product or category too |
A positive contribution margin can still sit inside an unprofitable business. In Ecom CFO’s 2025 data, median G&A took 22.4% of net revenue for brands under $10M, against a 29.7% median contribution margin. Median EBITDA margin landed at 7.2%.
How to improve ecommerce contribution margin
Work on cost lines before price. A price increase can cut conversion, while lower return rates, cheaper shipping and less wasted ad spend leave the customer’s price unchanged. Start with the lines that sit between your gross margin and your contribution margin.
- Cut avoidable returns by fixing size guides, photos and packaging on the SKUs with the highest return rates.
- Re-quote carrier and 3PL rates, and compare fulfillment zones against where orders ship.
- Move spend from campaigns below break-even ROAS to campaigns above it.
- Adjust price last, and only on products with low return rates and strong conversion.
When we plan Google Ads spend for a retail brand, break-even ROAS sets the floor for each campaign.
Frequently asked questions
Does shipping revenue count in the ecommerce contribution margin formula?
Yes. Add the shipping customers pay you to net sales, then subtract your real shipping and fulfillment cost. Leaving shipping revenue out while subtracting the full shipping bill understates margin. With free shipping, shipping revenue is zero and the full carrier cost stays in the formula.
How often should I recalculate contribution margin?
Monthly at minimum, and weekly if you scale ad spend quickly. Run each month again after 45 days, because returns arrive 30 to 45 days after purchase and change the first reading. Keep one template so every month uses the same cost lines.
How do I calculate maximum CAC from contribution margin?
Take contribution margin before ad spend for one order. That figure is your maximum ad cost per order. In the example above it is $23.75 on a $100 order. Go higher only if repeat purchases repay the gap in your cohort data.
What is contribution margin after marketing?
It is the layer after ad spend, often written as CM3. It starts from net sales plus shipping revenue and subtracts product cost, shipping and fulfillment, merchant fees and marketing. The ecommerce contribution margin formula in this guide ends at that figure.





