Calculating contribution margin in e-commerce: formula + example (Shopify & co.)
The contribution margin shows what is left after all variable costs of an order. Here is the formula, a worked example and the most common mistake.
The contribution margin is the amount left after deducting the variable costs included in your chosen definition, available to cover fixed costs and generate profit. Formula: selling price minus included variable costs = contribution margin.
The formula, in full
- Selling price (gross; less VAT for the real calculation)
- minus cost of goods (COGS: purchase, freight, customs)
- minus packaging and handling
- minus shipping costs (outbound + return)
- minus payment fees (Stripe, PayPal, Klarna)
- minus platform/marketplace fees
- minus directly attributable advertising costs (Meta, Google, TikTok)
- = contribution margin per order
Illustrative example calculation
- Selling price, net: €84
- COGS: €28 · shipping: €5 · payment fee: €2 · advertising (attributable): €18
- Total variable costs: €53
- Contribution margin: 84 − 53 = €31 (≈ 37% contribution margin)
Leaving out directly attributable advertising costs. In the illustrative example the picture changes noticeably as soon as advertising, shipping and fees are included. Always state clearly which margin level you are using.
The contribution margin can differ per SKU and per order. A profit tool can calculate it from the shop, ad and fee data that is actually available; missing or estimated costs should stay visibly marked.