Contribution Margin Calculator for Ecommerce: The Real Formula DTC Brands Need (2026)
May 20, 2026 · By Ishant Sharma
Contribution margin is the percentage of revenue left over after every variable cost of producing and delivering an order. It is the number that determines whether ad campaigns are profitable. It is the number that determines how aggressively you can scale. It is the foundation of break-even ROAS, target ROAS, CAC-to-LTV, and every other unit economics metric. And it is the number almost every Shopify brand reports incorrectly because their accounting software hands them gross margin and calls it contribution margin.
This guide walks through the right formula for contribution margin in an ecommerce context, the dozen variable costs that have to come out of revenue, how contribution margin differs from gross margin (and why the difference matters more than people think), and how to use the number for scaling decisions. I have been running paid ads for ecommerce brands every day for over a decade through Hustle Marketers, a Google Partner, Meta Business Partner, and Microsoft Advertising Partner agency. The pattern of inflated contribution margin destroying ad efficiency is the most common pre-engagement mistake I see.
What contribution margin actually is
Contribution margin is revenue minus every variable cost that scales with the order. It is what is left to "contribute" to fixed costs (rent, salaries, software, agency fees) and profit. Expressed as a percentage:
Contribution Margin % = (Revenue - Variable Costs) / Revenue
Per-order example. If your AOV is 60 dollars and your variable costs per order are 42 dollars, your contribution margin per order is 18 dollars and your contribution margin percentage is 30 percent.
The 30 percent number is what you plug into the break-even ROAS formula (1 / 0.30 = 3.33x). It is what you compare against CAC for sustainability checks. It is what every downstream profitability metric depends on. Get it wrong and everything downstream is wrong in the same direction.
Contribution margin vs gross margin
These two get confused constantly. They are not the same.
Gross Margin = (Revenue - COGS) / Revenue. Gross margin subtracts only Cost of Goods Sold. It is what Shopify Better Reports and most accounting software call "margin" by default. For a 60-dollar AOV with 24-dollar COGS, gross margin is 60 percent.
Contribution Margin = (Revenue - All Variable Costs) / Revenue. Contribution margin subtracts COGS plus every other variable cost: payment fees, shipping, fulfillment, refunds, discounts, affiliate commissions, marketplace fees, apps, and more. For the same brand, contribution margin is typically 25-40 percent, not 60 percent.
The gap between gross margin and contribution margin on a typical Shopify store is 20 to 35 percentage points. That gap is the entire difference between "campaigns look profitable" and "we are actually making money". For more on this specifically, see our deep-dive on why Shopify gross margin is lying to you.
The twelve variable costs that go into contribution margin
This is the full list of variable costs that should come out of revenue before you compute contribution margin. Most calculators include three to five of these. The honest answer requires all twelve, in roughly the order of how much they typically matter for DTC.
1. Cost of Goods Sold. Product cost plus inbound freight plus any per-unit manufacturer fee. Pull current supplier invoices, not last year's. Weight by sales volume per SKU.
2. Payment processing fees. Shopify Payments is 2.9 + 0.30 on Basic and Shopify plans, 2.7 + 0.30 on Advanced, 2.5 + 0.30 on Plus. Stripe, PayPal, and other processors carry similar rates plus a Shopify transaction fee on top if you do not use Shopify Payments. On a 60-dollar order this is roughly 2 dollars.
3. Net shipping cost. Shipping paid to carrier minus shipping revenue collected from customer, per order. Free shipping at 50-dollar threshold with an 8-dollar carrier cost: 8 dollars per order above the threshold. Flat 5 dollar shipping with 8-dollar cost: 3 dollars per order. Always net, never gross.
4. Fulfillment cost. Pick, pack, label, packaging materials. 3PL invoices give you a clean per-order number, typically 2.50-5 dollars. In-house operations have to allocate labor and warehouse cost.
5. Refunds and return shipping. Refund rate applied as a percentage haircut to revenue, plus the cost of processing returns (return label if you cover it, restock labor, write-off on damaged returns). Apparel and supplements run 5-8 percent refund rate. Beauty often 12-18 percent.
6. Discount stack. Welcome offers, abandoned cart codes, win-back, influencer codes, subscription discounts, BFCM promos, auto-applied bundle discounts. Total discount across 90 days divided by gross subtotal gives blended discount rate. Most operators underestimate this by half.
7. Affiliate commissions. ShareASale, Impact, GoAffPro. Commission rate times affiliate-attribution percentage gives blended affiliate cost as percentage of revenue. A 10 percent commission on 12 percent of orders: 1.2 percent of revenue.
8. Chargebacks and dispute fees. Lost order plus 15-25 dollar dispute fee. At 0.3 percent dispute rate on 60-dollar AOV: 18 cents per order plus 6 cents in dispute fees.
9. Marketplace fees. If you sell on Amazon, eBay, Walmart Marketplace, TikTok Shop, those platforms take 8-15 percent. If marketplaces are a meaningful share of revenue, blend the fees into contribution margin.
10. App stack per-order costs. Klaviyo and Postscript bill by active contacts and messages. SMS has hard per-send costs. Recharge bills per subscription order. Customer service apps bill per ticket. Sum monthly invoices, divide by orders, treat as variable.
11. Subscription processing fees. If you run subscriptions, the per-subscription order fee from Recharge or Skio is a variable cost. Typically 1 percent of subscription revenue.
12. Sales tax leakage. Only relevant in tax-inclusive pricing markets (most of EU, UK, Australia, some US flat-rate). If a 60-dollar product price includes 20 percent VAT, actual revenue is 50 dollars and contribution math starts there.
A calculator that includes only the first four costs is going to overstate contribution margin by 5 to 15 percentage points. That overstatement is the most common reason brands run unprofitably while their dashboards say they are winning.
The real formula, end to end
Contribution Margin per Order = AOV - COGS - Payment Fees - Net Shipping Cost - Fulfillment Cost - (Refund Rate × AOV) - (Discount % × AOV) - (Affiliate % × AOV) - (Dispute Rate × AOV + Dispute Fee × Dispute Rate) - (Marketplace Fee % × AOV) - App Cost per Order - Subscription Fee per Order - Tax Adjustment
Contribution Margin % = Contribution Margin per Order / AOV
Worked example: supplement brand
Round numbers for clarity. A Shopify supplement brand with:
- AOV: 60 dollars
- COGS: 24 dollars per order
- Payment fees: 2.04 (Shopify Payments Basic)
- Net shipping: 4 (charges 5, pays 9)
- Fulfillment: 3 (3PL)
- Refund rate: 5 percent
- Discount rate: 8 percent of revenue
- Affiliate: 0.5 percent of revenue
- Dispute rate: 0.3 percent
- Marketplace fees: 0 (Shopify-only)
- App stack: 0.45 per order
- Subscription fee: 0.20 per order (40 percent subscription orders at 0.50 fee)
- Tax adjustment: 0
Contribution per order: 60 - 24 - 2.04 - 4 - 3 - (0.05 × 60) - (0.08 × 60) - (0.005 × 60) - (0.003 × 60 + 0.05 × 0.003) - 0 - 0.45 - 0.20 - 0 = 60 - 24 - 2.04 - 4 - 3 - 3 - 4.80 - 0.30 - 0.18 - 0 - 0.45 - 0.20 = 18.03 dollars per order.
Contribution margin: 18.03 / 60 = 30.05 percent.
Compare to gross margin: (60 - 24) / 60 = 60 percent.
The gap is 30 percentage points. Brands plugging gross margin (60 percent) into the break-even ROAS formula get 1.67x. Real break-even from contribution margin (30 percent) is 3.33x. Every campaign between 1.67x and 3.33x is making money on the gross-margin view and losing money in reality.
From the agency: a 60 percent margin that was actually 30
One of the most consistent patterns we see at Hustle Marketers is brands telling us their margin is sixty percent or higher and then discovering the real number is half that. A DTC apparel client this year reported 62 percent margin from Shopify Better Reports. When we built the twelve-cost contribution margin formula against their last 90 days of orders, real contribution came in at 31 percent.
The 31 percentage point gap broke down predictably. Payment fees took 3.1 percent of revenue (they were on Shopify Basic with a high-volume non-Shopify processor stacking transaction fees). Net shipping took 5.2 percent (they were subsidizing free shipping over 75 dollars on a category where average carrier cost was 11 dollars). Fulfillment took 4.1 percent. Refunds and return processing took 8.4 percent, which is typical for apparel. The discount stack came to 7.8 percent including welcome, BFCM, and an automatic loyalty discount nobody had reviewed in two years. The remaining 2.4 percent was payment dispute fees, affiliate, and app stack.
We did not change the cost structure overnight. We did stop targeting acquisition campaigns to the 62 percent number and start targeting them to the 31 percent number. Three months later, ad-driven contribution dollars had grown 34 percent on flat ad spend, simply by setting honest targets. The brand later moved to Shopify Plus to drop the payment fee, raised the free shipping threshold, and reviewed the loyalty discount, which added another 4 to 5 contribution-margin percentage points over the following two quarters.
Contribution margin by product
The blended contribution margin number is useful for portfolio decisions. Per-product contribution margin is useful for SKU decisions.
Different SKUs have different COGS, different fulfillment complexity (a single bottle versus a 4-pack), different refund rates, different shipping cost (lightweight versus bulky). The blended number masks the fact that some SKUs run at 45 percent contribution margin and others run at 18 percent. When you set ad targets at the blended 30 percent, you under-promote your high-margin SKUs and over-promote your low-margin ones.
The practical move is to compute contribution margin per SKU once a quarter, then run product-specific ad campaigns with product-specific ROAS targets based on per-SKU contribution margin. A 45 percent margin product has a break-even of 2.22x. A 18 percent margin product has a break-even of 5.56x. Same brand, same dashboard, totally different acquisition economics.
When the framework breaks
Contribution margin is the right unit economics frame for most ecommerce. It has edges where it breaks.
Heavy bundle and discount dynamics. When customers stack codes, subscribe-and-save, and add bundles in the same cart, average contribution per order on those carts is very different from list-price contribution. The math still works, it just requires pulling real orders rather than list-price assumptions.
Subscription-dependent unit economics. If your business model is acquire-at-loss-on-first-order and monetize-on-subscription, first-order contribution margin will be negative. You have to compute LTV-adjusted contribution margin over a cohort to make sense of the business.
Wholesale and B2B orders. Different cost structure entirely. Compute B2B contribution margin separately from DTC contribution margin.
Pre-product-market-fit brands. When sales volume is low and refund rates are noisy, single-month contribution margin is unstable. Use 90-day rolling average and accept that the number is approximate until volume stabilizes.
How to use contribution margin operationally
Once you have the number, here is what it informs.
Break-even ROAS. 1 / contribution margin percentage. The floor for ad efficiency.
Target ROAS. Break-even ROAS times platform bias factor (1.0 to 2.5 depending on channel). What you actually punch into Google or Meta. See our target ROAS calculator guide for the platform-by-platform math.
CAC-to-LTV ratio. LTV is contribution margin per order times expected number of orders per customer. Target CAC under one-third of LTV.
Product margin gating. Refuse to scale any SKU whose contribution margin is below a threshold. We typically gate at 25 percent for DTC clients.
Pricing decisions. A 5-dollar price increase, if you can hold conversion rate constant, drops directly into contribution margin. Compare the contribution margin uplift to the conversion-rate haircut you actually see. Most price increases pay for themselves at the margin level even with double-digit conversion-rate drops.
Channel allocation. Channels with higher attributed customer LTV justify higher CAC. Channels with lower retention should run at lower CAC. Contribution margin is the bridge between channel cost and channel value.
The audit checklist
Before trusting any contribution margin number, audit these eight points.
- COGS updated to current supplier invoices, not last year's.
- Refund rate computed from 90-day order data, not estimated.
- Net shipping (after shipping revenue) calculated per order.
- Discount stack pulled from real order export including automatic discounts.
- Payment fee matched to your current Shopify plan tier.
- App stack monthly invoices divided by monthly orders.
- Affiliate and influencer payments counted, not just paid ads.
- Tax handling consistent (always exclude tax from revenue when computing margin).
A calculator that does not let you input the last five items cannot give you a real contribution margin number.
Frequently asked questions
Is contribution margin the same as gross profit margin? No. Gross margin subtracts only Cost of Goods Sold. Contribution margin subtracts COGS plus every other variable cost (payment fees, shipping, fulfillment, refunds, discounts, affiliate, marketplace, apps). Gross margin is an accounting metric. Contribution margin is the operational metric for ad targeting and unit economics.
What is a good contribution margin for ecommerce? There is no universal answer. Apparel typically runs 30-45 percent contribution margin. Supplements 25-40 percent. Beauty 30-50 percent. Electronics 10-20 percent. Subscription boxes 25-40 percent. A "good" contribution margin is the one that produces a break-even ROAS your acquisition channels can clear with room for fixed costs.
Should I include fixed costs in contribution margin? No. Contribution margin is variable costs only. Fixed costs (rent, salaries, software, agency retainers) get covered by the total contribution margin across all orders, not allocated per order. Mixing fixed costs into contribution margin produces "fully-allocated margin", which is useful for P&L view but not for ad targeting decisions.
How is contribution margin different in subscription versus one-time purchase? For one-time purchases, contribution margin is computed on first order only. For subscriptions, you can compute first-order contribution margin (often negative due to acquisition discount) and LTV-blended contribution margin (positive, weighted across the expected subscription life). Use first-order for strict ad targeting, LTV-blended for portfolio profitability.
How often should I recalculate contribution margin? On triggers: COGS change, shipping rate change, plan tier change, app stack change, AOV shift over 10 percent, refund rate trending up, new channel added. Most healthy brands recompute monthly with deep audit quarterly.
Why does my Shopify dashboard show higher margin than my contribution margin? Shopify shows gross margin (revenue minus COGS only). Your contribution margin subtracts every other variable cost too, which is 15 to 30 percentage points more than Shopify shows. The dashboard is correct for accounting; the contribution margin number is correct for ad targeting.
Should welcome discounts go in contribution margin or in CAC? Pick one and apply consistently. We prefer including them in contribution margin (treats them as a cost of the order they reduce) because that approach scales cleanly with order volume. Brands that prefer to treat welcome discounts as acquisition cost pull them out of contribution margin and into CAC. Both work as long as you do not double-count.
The bottom line on contribution margin
Contribution margin is the foundation of every other profitability metric in DTC. Get it right and break-even ROAS, target ROAS, CAC payback, and channel allocation all flow correctly. Get it wrong, almost always by treating gross margin as contribution margin, and every downstream decision is built on an inflated number that gradually shrinks profitability while the dashboards claim everything is fine.
The math is not hard. The work is in pulling the twelve variable costs out of real order data instead of estimating them. Brands that do this once and then re-audit on triggers run more profitably than brands that build acquisition programs on top of Shopify's "gross margin" field.
If you want contribution margin per product, per channel, and per workspace computed automatically from live Shopify and ad-account data, BreakevenHQ does that in three minutes from store connect. For the agency-side view of running campaigns against contribution margin instead of gross margin, see Hustle Marketers.
Ishant Sharma is the founder of Hustle Marketers, a Google Partner, Meta Business Partner, and Microsoft Advertising Partner agency, and BreakevenHQ, break-even analytics for DTC brands across every channel and every product. He is certified in Google Ads (Search, Display, Shopping, and Video), Meta Blueprint Media Buying Professional, and Microsoft Advertising, and has been running paid ads for ecommerce brands every day for over a decade.