boringperformanceTHE ECOMMERCE MATHS DESK
← ALL CALCULATORS

16 Nov 2026 / BORING COMMERCE PERFORMANCE TEAM

Contribution margin formula for ecommerce

Contribution margin = net revenue − variable costs. Divide it by net revenue and multiply by 100 for the contribution margin ratio.

The contribution margin formula is net revenue minus variable costs. The contribution margin ratio is that figure divided by net revenue, multiplied by 100. Variable costs are the costs that rise with every order you ship.

For an online store, work it out per order. Start from revenue after discounts and GST, subtract product cost, then fulfilment, then the ad cost of winning the order. What is left pays for salaries, rent and software, and then becomes profit.

The contribution margin formulas

What you wantFormula
Contribution marginNet revenue − variable costs
Contribution margin ratio (percentage)Contribution margin ÷ net revenue × 100
Contribution margin per unitNet price per unit − variable cost per unit
Total contribution marginContribution per unit × units sold
Weighted average contribution marginSum of (each product's ratio × its share of net revenue)

Use revenue without GST. GST collected on a sale belongs to the government, and counting it inflates every ratio on the sheet. Use the price the customer actually paid after coupons and bundle discounts, and subtract refunds for the period.

A cost is variable when shipping one more order adds it. The product, its box, the courier charge and the gateway fee all qualify. The warehouse rent does not, unless you pay per order.

Contribution margin in ecommerce: three levels

Indian D2C teams usually split contribution into three levels, because each one answers a different question.

Contribution margin 1 (CM1) is net revenue minus product cost and packaging. It tells you whether the product is priced well. CM1 is close to gross margin.

Contribution margin 2 (CM2) subtracts fulfilment: outbound shipping, payment gateway fees, COD handling and the cost of returns and RTO. This is what an order leaves before you pay to acquire it. It is the number that sets your break-even ROAS.

Contribution margin 3 (CM3) subtracts marketing per order: ad spend, influencer fees and discount codes funded by marketing. It tells you whether the growth you are buying makes money.

A brand can have a healthy CM1 and still lose money at CM3. COD-heavy categories feel this most, because a returned COD parcel pays shipping twice and brings no revenue.

How to calculate contribution margin: a worked example

Take one order of a ₹1,499 product sold with a ₹150 coupon. After the coupon and GST, net revenue is ₹1,200. These cost inputs are an example; use your own.

LinePer orderRunning contributionRatio
Net revenue₹1,200₹1,200100%
Product landed cost₹360
Packaging₹30
CM1₹81067.5%
Outbound shipping₹90
Payment gateway fee and GST₹32
Returns and RTO allowance (8% of revenue)₹96
CM2₹59249.3%
Ad spend per order₹420
CM3₹17214.3%

The returns line is an allowance, not a cost on this order. Take last quarter's return and RTO cost, divide it by last quarter's net revenue, and apply that rate. A store with a 20% RTO rate on COD will carry a far higher line than one that ships mostly prepaid.

The gateway line applies only to prepaid orders. If 60% of your orders are prepaid, use 60% of the prepaid fee as the average per order, and add any COD charge your courier bills for the rest.

From contribution to profit

Multiply contribution per order by orders to get total contribution. At 1,500 orders a month, this store makes ₹8.88 lakh of CM2 and ₹2.58 lakh of CM3. If salaries, rent and software come to ₹2 lakh a month, operating profit is ₹58,000.

That last step is why contribution margin matters more than revenue. Doubling orders at the same CM3 doubles the ₹2.58 lakh while fixed costs stay near ₹2 lakh. Doubling orders at a CM3 of zero adds work and nothing else.

Use CM2 to set your ad budget

CM2 is the most an order can pay for advertising before it loses money. In the example, each order can carry up to ₹592 of ad cost. Spend more than that and every order sold is a loss.

Turn it into a ROAS target by dividing net revenue by CM2: ₹1,200 ÷ ₹592 gives a break-even ROAS of 2.03. Any campaign returning less than 2.03 on net revenue loses money on the first order. Our break-even ROAS page walks through the same sum, and the break-even ROAS calculator on Boring Commerce does it from your own cost lines.

The target ROAS you set in Meta or Google should sit above break-even, by enough to leave the CM3 you want. To keep ₹172 per order, ad cost must be ₹420 or less, which is a ROAS of 2.86 on net revenue.

Ad platforms report the order value your pixel sends, which on most Shopify setups includes GST, and they never take out returns. A platform ROAS of 3.0 can be well under 2.86 once you strip GST and take out returned orders. Compare like with like.

Contribution margin ratio across a product range

Most stores sell more than one product, and contribution varies a lot between them. The weighted average contribution margin shows what the whole range earns.

ProductCM2 ratioShare of net revenueWeighted
Hero product55%70%38.5%
Lower-priced add-on30%30%9.0%
Store47.5%

If a sale pushes the add-on to half of revenue, the store's ratio falls to 42.5% without any change in price or cost. Watch the mix when a campaign drives one product hard, and set targets per product where the gap is wide.

Mistakes that distort contribution margin

These are the errors we see most often when brands share a cost sheet:

  • Leaving GST in revenue. Every ratio looks better than it is.
  • Using the product's purchase price instead of landed cost. Freight, duty and inward handling are part of what the product costs you.
  • Ignoring RTO. A COD parcel that comes back costs forward and return shipping and earns nothing.
  • Putting all payment fees on every order. COD orders carry courier COD charges, not gateway fees. Split them.
  • Treating marketing as fixed. Ad spend scales with orders. Leave it out of CM2 and put it into CM3 so the levels stay comparable month to month.
  • Mixing periods. Revenue from one month and costs from another produce a number nobody can repeat.

Rebuild the sheet each month from the same exports, with the date range written at the top. A contribution margin you can reproduce is worth more than a precise one you cannot.

Want us to check the sheet? Book a free profit review. Bring your net sales, cost lines and ad spend for a recent month, and we will work out the ROAS and spend your contribution can carry.

Questions at the desk

What is the contribution margin formula?

Contribution margin equals net revenue minus variable costs. For an online order, variable costs are the costs that rise with each order: product, packaging, shipping, payment fees, returns and the ad cost of winning the order.

What is the contribution margin ratio formula?

Divide contribution margin by net revenue and multiply by 100. An order with ₹1,200 net revenue and ₹592 contribution has a 49.3% contribution margin ratio.

What is the contribution margin per unit formula?

Selling price per unit after discounts and GST, minus variable cost per unit. Multiply by units sold for total contribution margin.

How do you calculate weighted average contribution margin?

Multiply each product's contribution margin ratio by its share of net revenue and add the results. A 55% product with 70% of sales and a 30% product with 30% of sales give a weighted 47.5%.

Is contribution margin the same as gross margin?

No. Gross margin subtracts only the cost of goods. Contribution margin also subtracts shipping, payment fees, returns and, at the last level, marketing. Online, the gap between the two is often large.

NEXT CALCULATION

Keep the working connected.

PUT YOUR NUMBERS TO WORK

A formula is a start.
Your margins set the budget.

Bring your actual costs. The Boring Commerce performance team will work through the ROAS and spend your orders can carry.