Contribution Margin Formula, Ratio and Calculator for Ecommerce

Contribution Margin Formula, Ratio and Calculator for Ecommerce

Contribution margin is what's left from each sale after you pay every cost that moves with that sale, including the ads that brought the customer in. It's the money that order contributes toward your fixed costs and your profit.

Contribution margin formula: Contribution margin = Revenue − Variable costs

Contribution margin ratio: Contribution margin ratio = (Revenue − Variable costs) ÷ Revenue

DTC per-order version: Contribution margin = Net revenue − COGS − Shipping and fulfillment − Payment fees − Returns − Direct marketing (ad spend per order)

Put your own per-order numbers into the calculator below. It runs the formula, the ratio, the four margins and your break-even ROAS. Further down: a worked example, how to read the ratio, how contribution margin differs from gross margin, and how it fits into four margins that show where your money goes.

Contribution margin calculator for ecommerce
Prefilled with the hypothetical order used in the examples below. Use averages per order over the same period. Nothing you type leaves your browser.

Product margin per order
Gross margin per order (CM2)
Contribution margin per order (CM3)
Contribution margin ratio
Break-even ROAS (1 ÷ gross margin ratio)
ROAS at this ad cost per order
Monthly contribution
Monthly profit after fixed costs
Orders per month to break even
Revenue per month to break even

Contribution margin formula (with example)

The textbook formula is short: revenue minus variable costs. Variable costs are the ones that rise and fall with each order. For a DTC brand that means the product itself, getting it to the customer, processing the payment, and the ad spend you can tie to the sale.

Hypothetical example: a brand sells one order for $100 in net revenue (after discounts and refunds). Per order it pays:

  • $25 in landed product cost (COGS)
  • $12 to ship and fulfill it
  • $3 in payment processing
  • $25 in direct ad spend

Contribution margin = $100 − ($25 + $12 + $3 + $25) = $35

So this order leaves $35 to cover rent, salaries, software and everything else that doesn't change with each order, and whatever is left after that is profit.

The calculator at the top of this page runs the same math with your numbers. If you sell on Shopify and want the platform and payment fees worked out per order, the Shopify profit margin calculator does that part.

See it with your own numbers. The Move the Needle Academy teaches DTC operators to turn margins like these into spend decisions. Explore the Academy →

Contribution margin ratio: formula and how to read it

The ratio turns the dollar figure into a percentage, so you can compare orders, products and months of different sizes.

Contribution margin ratio = Contribution margin ÷ Net revenue

Hypothetical example: using the order above, $35 ÷ $100 = 35%. For every dollar of revenue, 35 cents is left after variable costs and direct marketing.

How to read it:

  • It tells you what each new dollar of revenue is worth. At a 35% ratio, another $10,000 in sales adds about $3,500 toward fixed costs, assuming your costs per order hold.
  • It shows what a sales target is worth before you chase it. Divide your monthly fixed costs by the ratio and you get the revenue you'd need to break even. Hypothetical example: $20,000 in fixed costs ÷ 35% ≈ $57,000 in monthly revenue.
  • The trend matters more than any single month. A ratio that slides for several months in a row is a signal to find which cost layer moved.

A quick note on words: "profit" is the dollar amount and "margin" is the percentage. Contribution profit might be $35,000 while contribution margin is 35%. People use them interchangeably, but the distinction helps when you talk with a finance team.

How do you calculate contribution margin per unit?

Contribution margin per unit = Price per unit − Variable costs per unit. When an order holds more than one unit, split the per-order costs (shipping, payment fees and ad spend) across the units in it.

Hypothetical example: the $100 order above is two units at $50 each. Variable costs for the order are $65 ($25 COGS, $12 delivery, $3 payment fees, $25 ad spend), or $32.50 per unit. Contribution margin per unit = $50 − $32.50 = $17.50, and the ratio stays at 35%.

Per unit is the view for pricing a SKU or comparing products. Per order is the view for marketing decisions, because ads, shipping and payment fees are paid per order. If customers start buying more units per order, per-order costs get spread thinner and contribution per unit goes up, even though nothing about the product changed.

Contribution margin vs gross margin

The two get mixed up all the time. The difference is ad spend.

Gross margin Contribution margin
What's subtracted COGS, delivery and payment costs Everything in gross margin, plus direct marketing (ad spend, affiliates, performance creator fees)
What's left covers Marketing, operating costs and profit Operating costs and profit
Decision it informs Is the product and delivery model sound? How much room is there for marketing? Is the marketing paying its way? Can we afford to scale this spend?

At MTN we call gross margin CM2 and contribution margin CM3. When we say "contribution margin" on its own, we mean the after-marketing figure.

One caution: the "gross margin" on your accountant's income statement may not match either of these. More on that in the mistakes section below.

Why one margin number isn't enough

Ask three CFOs to define contribution margin and you'll likely get three different answers. If they're seasoned finance professionals, all three can be valid.

That makes sense once you know why, and a member of the Move the Needle community put it best: "Contribution margin is a managerial accounting measure, NOT a financial and bookkeeping accounting measure. It's not even defined under GAAP."

There's no standardized definition in any accounting rulebook. Contribution margin is a management tool, so the right definition depends on the decisions you're making. For a DTC brand those decisions are specific: Is the product viable? Is fulfillment eating the margin? Is the marketing efficient? Can we afford to scale?

Think of revenue as a pie that starts whole. As it moves through your business, slices get taken at four tables: product costs, delivery costs, marketing costs and operating costs. The margin at each table is how much pie is left.

Most brands think in one margin number, usually "gross margin". That hides where the problems are.

Hypothetical example: two brands.

  • Brand A has a 75% product margin but spends $15 shipping a $30 product.
  • Brand B has a 60% product margin but spends only $4 on shipping.

Both could land at similar bottom-line numbers, but their fixes are completely different. Brand A has a fulfillment problem and Brand B has a sourcing problem. A single margin number would never tell you that.

The Four Margins for DTC brands

This is how we break it down at Move the Needle: four layers, each building on the last. Together they show where every dollar goes.

Margin 1: Product margin

Product margin = Net revenue − COGS

Product margin is what's left after paying every cost to make the product ready for sale. Everything else builds on it.

COGS should include:

  • Supplier sourcing and procurement (raw materials or wholesale cost)
  • Manufacturing and labor
  • International freight to import goods (inbound freight, not last-mile delivery)
  • Customs, duties and tariffs
  • Broker fees to clear the border
  • Product packaging, labels and materials that are part of each unit (shipping boxes come later)

Keep inbound and outbound freight apart. Inbound freight is a product cost. Outbound shipping to the customer is a delivery cost. They belong in different layers.

Hypothetical example: you sell a product for $100 and your fully landed COGS is $25. Product margin = $100 − $25 = $75 (75%).

What it tells you: product margin is the ceiling. If it's weak, no amount of marketing or operational work makes up for it. Tight product margins can make DTC an uphill climb, and sometimes mean wholesale or other channels fit better.

Tariffs can shift this number fast. When COGS rises, product margin shrinks and everything downstream gets squeezed. Campaigns that were profitable last month can stop working, not because the marketing changed but because the economics under it did.

Margin 2: Gross margin (CM2)

Gross margin = Net revenue − (COGS + CoD + CoT)

Gross margin is what's left after paying to deliver the order and process the payment. It shows how efficient your supply chain, delivery and payment setup are.

Two variable cost layers sit between product margin and gross margin.

CoD (cost of delivery): everything involved in getting the order to the customer.

  • Outbound shipping and carrier fees
  • Fulfillment center costs (pick, pack and handling)
  • Shipping materials (boxes, mailers, wrap, tape, inserts)
  • Returns processing (return shipping, restocking, inspection, product that can't be resold)

CoT (cost of transaction): everything involved in processing the payment.

  • Payment processing fees (usually a percentage of the order plus a fixed fee per transaction; check your own processor's rate)
  • Buy now, pay later fees
  • Chargeback and fraud prevention costs

Keeping CoD and CoT separate matters because different things drive them. Delivery costs are about logistics: rates, packaging, 3PL terms. Transaction costs are about payment infrastructure: processor rates, payment method mix and chargebacks.

Hypothetical example: product margin is $75, cost of delivery is $12 and cost of transaction is $3. Gross margin = $75 − ($12 + $3) = $60 (60%).

What it tells you: this is where offering shipping at no charge shows its real cost. Every dollar of delivery cost comes out of your margin. A brand shipping a $30 product with $15 in delivery costs has lost half its product margin before a single ad dollar is spent.

Returns hit this layer hard. When an order comes back, you lose the sale, you've already paid outbound shipping, you pay for the return, and some returned product can't be resold. The cost compounds in ways a revenue line doesn't show.

This margin sets how much room there is for marketing. Hypothetical example: if gross margin is 55% and you want 15% for operations and 10% for profit, that leaves 30% for all marketing.

Margin 3: Contribution margin (CM3)

Contribution margin = Net revenue − (COGS + CoD + CoT + Direct marketing costs)

This is where marketing efficiency becomes clear. Contribution margin is what each dollar of revenue contributes toward your fixed operating costs and profit after you make, deliver and market the product.

Direct marketing costs include:

  • Ad spend across all channels (Meta, Google, TikTok and others)
  • Affiliate commissions
  • Influencer and creator fees when performance is directly measurable (tracked links, promo codes, direct attribution)
  • Any marketing spend with a specific CPM, CPC or direct return

These go in operating expenses instead:

  • Agency fees and retainers
  • SEO retainers and ongoing SEO services
  • Brand content without direct measurement
  • Influencer partnerships aimed at awareness rather than direct response
  • Marketing tools and software subscriptions
  • Marketing team salaries

The test: can you measure a direct return or a cost per result from this spend? If yes, it's a direct marketing cost. If no, it's an operating expense.

Hypothetical example: gross margin is $60 and direct marketing is $25. Contribution margin = $60 − $25 = $35 (35%).

What it tells you: for every $100 in revenue, $35 is left to cover operating expenses and profit. A strong contribution margin means your supply chain and your marketing are tuned to work together. Once you know this number, you can work out your break-even ROAS, and the ROAS calculator shows where each campaign lands against it.

Margin 4: Net profit margin

Net profit margin = Net revenue − (COGS + CoD + CoT + Direct marketing costs + OpEx)

Net profit margin is the final score: what's left after every cost in the business.

Operating expenses (OpEx) include:

  • Personnel: salaries, wages, employee taxes, contractors
  • Technology: software subscriptions and tools
  • Facilities: office or warehouse rent, utilities, insurance, overhead
  • Professional services: legal, accounting, consulting
  • Indirect marketing: agency retainers, SEO, content production, branding
  • Business operations: R&D, samples, travel, supplies

Hypothetical example: contribution margin is $35 and operating expenses per $100 of revenue are $20. Net profit margin = $35 − $20 = $15 (15%).

What it tells you: this is the overall health of the business, the scorecard for how all the parts turn into profit or loss.

The margin cascade: how it all flows together

Hypothetical example: the full waterfall for one quarter.

Line Amount Margin
Net revenue $100,000 100%
− COGS $25,000
= Product margin $75,000 75%
− Cost of delivery $12,000
− Cost of transaction $3,000
= Gross margin (CM2) $60,000 60%
− Direct marketing $25,000
= Contribution margin (CM3) $35,000 35%
− Operating expenses $20,000
= Net profit $15,000 15%

You started with $100,000 in revenue and ended with $15,000 in profit. Each layer took its slice, and now you can see who took what.

Reading the margin story

Each combination of margins tells a different story about the business. Once you can read them, the diagnosis gets fast:

  • High product margin, low gross margin: delivery is eating profit. Look at shipping, fulfillment and return rates.
  • High gross margin, low contribution margin: customer acquisition is too expensive for the margin you have. The supply chain is solid.
  • High contribution margin, low net profit: overhead is too high. Product and marketing economics work.
  • Low product margin: sourcing, pricing or product-market fit comes first, before anything else.

This changes the conversation from "our ROAS is too low" to "this is where the money goes and what we'll fix".

What's a good contribution margin?

There's no universal number, and anyone who gives you one without knowing your business is guessing. What counts as workable depends on a few things:

  • Gross margin. The more you keep after product, delivery and payment costs, the more room you have to spend on marketing and still have money left.
  • Repeat purchases and lifetime contribution. A brand whose customers reorder often can accept a thin, or even negative, contribution on the first order, because later orders cost little to win. A brand that sells once per customer has to earn its money on that first order. The customer lifetime value calculator shows how much repeat orders add.
  • Ad costs. When acquisition gets more expensive, the same product earns less contribution per order.
  • Cash position. A brand with cash in the bank can choose a lower margin to grow faster. A bootstrapped brand that funds next month's ads from this month's sales needs more margin per order to keep going.
  • Growth stage. Spending into acquisition on purpose lowers contribution margin today. That can be a sound choice, as long as you know you're making it.

Hypothetical example: two brands both run a 20% contribution margin. One sells a consumable that customers reorder every few weeks and has six months of cash. The other sells a one-time purchase and funds ads week to week. The same 20% means something very different for each.

The useful question is whether your contribution margin covers your fixed costs at the volume you can reach, and whether the cash timing lets you get there.

How to calculate your four margins (step by step)

  1. Start with net revenue. Pull net revenue (after discounts and refunds, not gross) from your ecommerce platform for the last 90 days.
  2. Calculate COGS. Include fully landed product cost: supplier cost, manufacturing, inbound freight, customs and duties, broker fees and product packaging. If you know landed cost per unit, multiply by units sold. If you only have a COGS percentage, apply it to net revenue. Inbound freight and duties are the costs most often left out.
  3. Add up cost of delivery. Average shipping, fulfillment or 3PL fees, shipping materials and returns processing.
  4. Add up cost of transaction. Payment processing, buy now pay later fees and chargebacks. It feels small per order, but at scale it adds up.
  5. Total direct marketing. All ad spend, affiliate commissions and any marketing spend with a measurable return. If you can't measure a direct return, it goes in OpEx.
  6. Add up operating expenses. Salaries, rent, software, professional services, indirect marketing and other fixed costs.
  7. Run the waterfall. Start at net revenue, subtract each layer, and note the margin at each step.

Build it in a spreadsheet and update it at least quarterly. COGS changes with suppliers and volume, shipping rates change, return rates shift with new products and seasons, and marketing efficiency moves. The brands that keep it current make better calls.

See it with your own numbers. The MTN Starter Toolkit runs the Four Margins waterfall for you. Plug in your data and get your diagnostic in under 10 minutes, no spreadsheet skills required.

Get the Starter Toolkit →

Common mistakes with contribution margin

1. Using your accountant's gross margin

Statements from your CPA or bookkeeper group expenses for tax compliance, not operating decisions. The "gross margin" on your income statement probably doesn't include shipping, returns or processing fees the way you need it to.

That's not your accountant's fault. Financial statements serve a different purpose, but using that number for marketing or scaling decisions leads you astray. Build your four-margin waterfall separately as a management tool.

2. Not separating direct marketing from OpEx

If your agency retainer, SEO services and Meta ad spend sit in one "marketing" bucket, your contribution margin stops meaning anything. Spend with a measurable return belongs in direct marketing. Longer-term investments belong in OpEx.

Hypothetical example: $10,000 a month in Meta ads with measurable conversions is direct marketing. A $5,000 a month SEO retainer for long-term organic growth is an operating expense. They sit in different layers and tell you different things.

3. Ignoring the impact of returns

A strong product margin doesn't mean healthy unit economics if a large share of orders come back. The $0 DTC unit economics course walks through where the money from an order goes once everyone's been paid. Each return costs you the outbound shipping, the return processing and any product you can't resell. Track returns inside cost of delivery so the cost shows up where it happens.

4. Not updating the numbers

Margins don't stand still. COGS changes when you switch suppliers or negotiate volume pricing. Shipping rates change, sometimes mid-year. Tariffs can move overnight. Payment fees change as you grow or switch providers.

Recalculate at least once a quarter. A number set once and forgotten leads to decisions on outdated math.

5. Using one blended number across all products

Hypothetical example: a lightweight $120 product and a heavy $40 product will have very different margins at every layer, because shipping, return rates and marketing costs differ. A blended contribution margin can say the business is fine while one product line drags everything down.

Calculate your four margins by product category at minimum. The diagnosis changes when you can see which products contribute and which consume.

What each margin tells you to optimize

Each margin layer is a lever. When someone asks how to improve profitability, the answer depends on which layer is weakest:

  • Product margin is a sourcing lever. Supplier negotiation, volume pricing, reshoring or offshoring, or reformulating the product.
  • Gross margin is a delivery lever. Better shipping rates, lighter packaging, a different 3PL, a changed shipping threshold, fewer returns through better product pages and sizing guides, or lower processing rates at volume.
  • Contribution margin is a marketing efficiency lever. Better creative, sharper targeting, channel mix and tighter media buying. Your break-even ROAS targets come from here.
  • Net profit margin is an operations lever. Lower overhead, renegotiated contracts, automation and careful hiring.

The four margins show you where to look, and just as useful, where not to. If product margin is 80% and gross margin is 45%, better ad creative won't fix it. Delivery costs are the bottleneck.

Contribution margin and cash flow

There's another dimension most brands overlook: timing.

Margins tell you how much you keep from each dollar. They don't tell you when the money arrives versus when you spend it. You pay for inventory and ads before customers pay you, and that gap, the cash conversion cycle, decides whether you can fund the growth your margins allow.

Hypothetical example: a brand with a 35% contribution margin and a 90-day cash conversion cycle might scale more slowly than a brand with a 25% margin and a 30-day cycle. The margin math is better, but the cash isn't there to reinvest.

The same timing question applies to acquisition. Your CAC payback period shows how long new customers take to repay what you spent to win them.

I cover the inventory side in Cash Conversion Cycle for Ecommerce: Formula, Calculator and How to Shorten It.

Related: Ecommerce Financial Projections Template: 12-Month Forecast

FAQ

What is the contribution margin formula?

Contribution margin = Revenue − Variable costs. For a DTC brand, variable costs per order are COGS, shipping and fulfillment, payment fees, returns and direct marketing such as ad spend. What's left is the money each order contributes toward fixed costs and profit. Divide it by revenue to get the contribution margin ratio.

How do you calculate contribution margin ratio?

Contribution margin ratio = (Revenue − Variable costs) ÷ Revenue. Hypothetical example: an order brings in $100, and variable costs including ad spend total $65, so the ratio is 35%. Each extra dollar of revenue adds about 35 cents toward fixed costs, as long as costs per order stay the same.

What is the difference between contribution margin and gross margin?

Gross margin subtracts product, delivery and payment costs. Contribution margin subtracts all of that plus direct marketing. Gross margin tells you whether the product and delivery model work and how much room there is for marketing. Contribution margin tells you whether the marketing pays its way. At MTN, gross margin is CM2 and contribution margin is CM3.

Is ad spend included in contribution margin?

Yes, in the DTC version we use. Ad spend, affiliate commissions and performance creator fees go in, because they move with sales and have a measurable return. Agency retainers, SEO services and marketing tools don't. They are operating expenses. Some textbook definitions leave marketing out, so check which version a number uses before comparing.

What is a good contribution margin for ecommerce?

There's no universal good number. A workable contribution margin depends on your gross margin, how often customers reorder, what acquisition costs you, how much cash you hold and whether you're investing in growth on purpose. The better question is whether it covers your fixed costs at a volume you can reach, with cash timing you can fund.

Should I calculate contribution margin per order or per unit?

Per order is usually more useful for DTC, because shipping, payment fees and ad spend happen per order, not per unit. Per unit helps when comparing products or pricing a single SKU. Many brands track both: per order for marketing decisions and per product category to spot which lines contribute and which consume.

How do you calculate contribution margin per unit?

Take the price of one unit and subtract the variable costs for that unit. For costs paid per order, such as shipping, payment fees and ad spend, divide by the number of units in the order first. Hypothetical example: a $100 order of two $50 units with $65 in variable costs leaves $17.50 per unit.

The bottom line

Contribution margin isn't defined under GAAP, and there's no single right definition. That's why a formula alone isn't enough.

The four margins (product margin, gross margin, contribution margin and net profit margin) let you see where the business leaks money and what to do about it. High product margin with low gross margin points to delivery. High gross margin with low contribution margin points to acquisition cost. Once you can read these, you'll look at the same numbers as everyone else and see something different.

Calculate your four margins, build the waterfall and update it quarterly. Every growth decision you make sits on top of it.

Try it with the Starter Toolkit: the same Four Margins in a plug-and-play diagnostic that takes under 10 minutes.

Want to go deeper? The Move the Needle Academy teaches DTC operators to turn these numbers into growth decisions, one practical course at a time. To see how it compares with other options, read our guide to choosing an ecommerce finance course.

Nick Miller

Nick Miller

Co-author of Beyond ROAS. Fractional Head of Growth, $200M+ in managed ad spend, and formerly led the paid media team at the Tier 11 agency. I help DTC brands grow on profit, not ROAS.