UNIT ECONOMICS
How to Calculate Ecommerce Contribution Margin
Find what each order contributes after variable costs, without confusing contribution margin with gross margin or net profit.
- Published
- Reviewed
DIRECT ANSWER
The calculation in one paragraph
Contribution margin equals net sales minus variable costs. Contribution margin ratio equals contribution margin divided by net sales, multiplied by 100. For ecommerce, define net sales after discounts and expected returns, then include every cost that changes with the order—product, payment and marketplace fees, pick-and-pack, outbound shipping subsidy, variable packaging, and attributable acquisition cost.
Open the product profit and margin calculatorBuild net sales and variable cost on one basis
Choose a unit: one item, one order, one customer cohort, or one month. Revenue and costs must use the same unit and period. Gross order value is not automatically net sales; discounts, refunds, and returns reduce the revenue the order ultimately retains.
Shopify’s finance reports distinguish gross sales, discounts, returns, taxes, and net sales. Export definitions vary by platform, so document which fields are included. Taxes collected on behalf of authorities are generally not merchant revenue, and pass-through shipping charged to a buyer should be paired with the corresponding fulfillment cost.
Separate variable costs from fixed costs
A variable cost changes as orders or units change: landed product cost, transaction fee, marketplace commission, pick-and-pack charge, postage subsidy, variable packaging, royalty, and per-order support or acquisition cost when measured reliably. Monthly software, core salaries, and base rent are usually fixed inside their relevant operating range.
OpenStax defines unit contribution margin as selling price less variable cost per unit and explains that the remainder first covers fixed costs, then profit. That makes contribution margin a decision tool, not a claim about final profit. If a warehouse contract has fixed and per-order tiers, split the components instead of forcing the whole invoice into one bucket.
Use expected values for returns and acquisition
A return-heavy product can look attractive before its return probability, lost shipping, processing, and nonrecoverable product loss are included. Use a cohort that has matured past the return window. Expected return cost per order can be estimated as return rate multiplied by average net cost of a return, while returned revenue is handled consistently in net sales.
Blended advertising spend divided by all orders can hide channel or cohort differences. Use attributable acquisition cost for the decision you are making and run a sensitivity range when attribution is uncertain. Compare products by contribution dollars, percentage, and any scarce constraint such as fulfillment labor or inventory cash.
WORKED EXAMPLE
One-order contribution example
- Net sales: $80.00
- Landed product cost: $24.00
- Payment and marketplace fees: $6.40
- Fulfillment, packaging, shipping subsidy: $10.60
- Attributable acquisition cost: $18.00
$80.00 − ($24.00 + $6.40 + $10.60 + $18.00)$21.00 contribution; 26.25% contribution margin ratioThe $21 still has to cover fixed payroll, software, rent, overhead, and profit. If expected returns cost $4 per original order, contribution falls to $17.
Cost classification checkpoint
| Cost | Common treatment | Check |
|---|---|---|
| Landed product cost | Variable | Use unit actually sold |
| Payment/marketplace fee | Variable | Include percentage and fixed transaction parts |
| Warehouse subscription | Fixed | Separate per-order handling charge |
| Core team salary | Fixed in relevant range | Model step changes when volume requires hiring |
| Advertising | Depends on analysis | Use attributable or incremental spend consistently |
A practical workflow
- Choose the order, SKU, cohort, channel, and period being evaluated.
- Calculate net sales after discounts, cancellations, and expected or realized returns.
- List every variable cost using the same unit and period.
- Subtract variable costs, then divide by net sales for the ratio.
- Test return rate, ad cost, and shipping changes before setting price or scaling spend.
EDGE CASES
Frequently asked questions
Is contribution margin the same as gross margin?
No. Gross margin commonly subtracts cost of goods sold from revenue. Contribution margin subtracts all variable costs relevant to the analysis, which for ecommerce may include transaction, fulfillment, shipping, returns, and acquisition costs.
Can contribution margin be negative?
Yes. It means the measured sale does not cover its variable costs under the stated assumptions. Verify the data, then review price, discounting, shipping policy, channel fees, returns, and acquisition economics.
Should customer acquisition cost be included?
Include incremental acquisition cost when evaluating paid-channel or new-customer economics. For an organic repeat-order view, show it separately. State the attribution rule so unlike cohorts are not compared.