All articles

Contribution Margin and Contribution Margin Ratio: Formulas and Examples for Online Stores

Contribution margin is revenue minus variable costs, and the contribution margin ratio is that margin as a percentage of revenue. The guide covers the formulas, a worked online store example excluding VAT (in DKK), the CM1 to CM3 levels, break-even ROAS and the formulas for Excel and Google Sheets.

Contribution Margin and Contribution Margin Ratio: Formulas and Examples for Online Stores

Contribution margin is revenue minus variable costs: the amount your sales contribute towards covering fixed costs and making a profit. The contribution margin ratio is that amount as a percentage of revenue: contribution margin / revenue × 100.

A quick example with round numbers: an online store has revenue of DKK 100,000 excluding VAT in a month and variable costs of DKK 60,000. The contribution margin is 100,000 - 60,000 = DKK 40,000, and the ratio is 40,000 / 100,000 × 100 = 40%. We are OkayScale, a Shopify agency in Denmark, so the examples are in Danish kroner and built around an online store. The store and its numbers are made up and run through the whole guide. In Danish the two terms are dækningsbidrag and dækningsgrad.

What is contribution margin?

Contribution margin is what is left of a sale once the costs caused by that sale are paid. You can calculate it for the whole business, a product group, an order or a single product.

Variable costs follow sales: the goods themselves, shipping, packaging and payment fees. Fixed costs such as salaries, rent and subscriptions are there no matter how much you sell, and they are paid out of the contribution margin.

Contribution margin formula

Contribution margin = revenue minus variable costs

Per unit, the formula is selling price minus variable costs per unit. If the store sells a product for DKK 400 excluding VAT and the variable costs add up to DKK 240, the contribution margin is 400 - 240 = DKK 160 per unit.

What is the contribution margin ratio?

The contribution margin ratio is the contribution margin expressed as a percentage. It shows how much of every krone or dollar of revenue turns into contribution margin, and it makes products with different prices comparable.

Contribution margin ratio formula

Contribution margin ratio = contribution margin / revenue × 100

Per unit, the formula is contribution margin per unit / selling price × 100. For the product above that is 160 / 400 × 100 = 40%. Out of every DKK 100 of revenue excluding VAT, DKK 40 is left for fixed costs and profit.

What is a good contribution margin ratio?

A good contribution margin ratio depends on your industry and on your fixed costs, so we don't quote a typical number. The glossaries of two Danish accounting tools, Dinero and Billy, both say that 10% or under is regarded as low across industries, but neither points to data.

A better question is whether the contribution margin can pay your fixed costs. Break-even revenue is fixed costs divided by the ratio. With fixed costs of DKK 35,000 a month and a ratio of 40%, the store needs 35,000 / 0.40 = DKK 87,500 in revenue excluding VAT before it makes money.

Calculate contribution margin and margin ratio

Contribution margin
DKK
Contribution margin ratio
%
Break-even ROAS

How to calculate contribution margin step by step

  1. Work without VAT or sales tax. The tax is not your income. In Denmark prices include 25% VAT, so a product at DKK 500 in the store is 500 / 1.25 = DKK 400 excluding VAT. If you use the price including VAT, the ratio comes out too high.
  2. Find the variable costs per unit or per order: everything that only costs money because the product is sold.
  3. Subtract them from the selling price. The result is the contribution margin in kroner.
  4. Divide the contribution margin by the selling price and multiply by 100. That is the ratio in percent.

Here is an order with one product. The customer pays DKK 500 and gets free shipping. The payment fee is the standard online card rate for Shopify Payments on the Basic plan in Denmark, 1.9% + DKK 1.80 (Shopify's Danish pricing page, 11 November 2026). We calculate the fee on the DKK 500 the customer pays. Card rates differ by country and plan, so use your own.

LineDKK excl. VATShare of selling price
Selling price (DKK 500 incl. VAT)400.00100%
Cost of goods sold170.0042.5%
Shipping paid by the store40.0010.0%
Packaging8.702.2%
Payment fee (1.9% of DKK 500 + DKK 1.80)11.302.8%
Returns and exchanges, average per order10.002.5%
Total variable costs240.0060.0%
Contribution margin160.0040.0% (ratio)

Returns and exchanges are averaged across all orders: if an exchange costs DKK 100 in shipping and handling, and one order in ten is exchanged, that is DKK 10 per order. Refunded amounts come out of revenue before you calculate. The example has no refunds, so 250 orders in a month give the numbers from the introduction: DKK 100,000 in revenue, DKK 60,000 in variable costs and DKK 40,000 in contribution margin.

Contribution margin for an online store: which costs belong in it?

The variable costs of an online store are typically:

  • Cost of goods sold: what you paid for the products you sold.
  • Shipping: the part of the carrier's charge that you pay and the customer doesn't.
  • Packaging and pick and pack: boxes, padding and labels, plus the warehouse's fee per order.
  • Payment fees: the percentage and the fixed fee per payment.
  • Returns and exchanges: averaged per order.
  • Commission: to a marketplace or anyone else who takes a percentage of the sale.

CM1, CM2 and CM3

Advertising is where the textbook and ecommerce practice part ways. In Danish textbooks and accounting glossaries, marketing is a fixed cost that is deducted after the contribution margin. In an online store, ad spend follows orders so closely that many deduct it as a level of its own. That is why ecommerce teams often work with three levels. In Denmark they are called DB1, DB2 and DB3, and English-speaking teams often write CM1, CM2 and CM3. The store in the example spends DKK 25,000 a month on ads, or DKK 100 per order.

LevelCalculationPer order in the exampleShare of selling price
CM1 (DB1)Revenue minus cost of goods sold400 - 170 = DKK 23057.5%
CM2 (DB2)CM1 minus shipping, packaging, payment fees and returns230 - 70 = DKK 16040.0%
CM3 (DB3)CM2 minus advertising160 - 100 = DKK 6015.0%

This is a common convention, not a law or an accounting standard, and the labels vary. The Danish encyclopedia lex.dk uses DB-II for the margin after direct sales promotion costs, so the second level can mean before or after marketing. CM2 in the table is roughly the textbook contribution margin, where all variable costs are deducted. Write down what your levels contain and keep them the same from month to month. How costs are grouped in your actual accounts is your accountant's decision.

Break-even ROAS: how much can an order cost in ads?

ROAS is revenue divided by ad spend. Break-even ROAS is the ROAS where the ads use up the entire contribution margin:

Break-even ROAS = 1 / contribution margin ratio

Use the ratio before advertising (CM2) as a decimal. In the example that is 1 / 0.40 = 2.5. Every krone of ad spend has to bring in at least DKK 2.50 in revenue excluding VAT, and an order can cost at most DKK 160 in ads. The store spends DKK 100 per order, so its ROAS is 400 / 100 = 4.0, and DKK 60 per order is left for the other fixed costs.

  • Check the VAT. If the revenue in your ad platform includes 25% VAT, multiply the threshold by 1.25: 2.5 × 1.25 = about 3.1.
  • Use the right level. Calculated from CM1 the threshold looks like 1 / 0.575 = 1.74. At a ROAS between 1.74 and 2.5 the store loses money on every order, even though the number looks fine.
  • POAS. Some teams track POAS, where the contribution margin before advertising is divided by ad spend. Break-even is then 1.

We run Meta Ads for Shopify brands, from creative strategy to campaign management, with proper pixel setup and conversion tracking. Without a correct purchase value in your tracking, you can't compare your ROAS with your break-even.

Contribution margin vs gross profit, markup and net profit

  • Gross profit is revenue minus cost of goods sold, which is CM1 in the table: DKK 230 per order, or a gross margin of 57.5%. The contribution margin is lower because the other variable costs are deducted as well.
  • Markup is the profit as a percentage of the cost, not of the selling price. DKK 230 on top of a cost of DKK 170 is a markup of 135%, but only 57.5% of the selling price.
  • Net profit is what is left when the fixed costs are paid too. In the example: DKK 40,000 in contribution margin minus DKK 25,000 for ads and DKK 10,000 for other fixed costs leaves DKK 5,000. A positive contribution margin is not the same as a profit.

How to raise your contribution margin

  • Price: Raise the price by 5% (from DKK 500 to 525 in the store) and the contribution margin goes from DKK 160 to just under DKK 180 per order, about 12%, if sales hold. Give a 10% discount and it drops to about DKK 121, and you need roughly a third more orders to earn the same.
  • Purchase price: Every krone you save with your supplier goes straight into the contribution margin. A 5% lower purchase price is DKK 8.50 more per order.
  • Free shipping threshold: Free shipping costs DKK 40 out of a DKK 400 order. A threshold a little above your typical order can get more customers to add one more product to the cart.
  • Bundles: Shipping, packaging and the fixed payment fee are paid per order, not per product. Two units in one order with a 10% discount give DKK 720 excluding VAT and DKK 302.40 in contribution margin, if shipping, packaging and returns cost the same per order as before. The ratio goes from 40% to 42%. See the guide to product bundles in Shopify.
  • Conversion rate: If you get 20% more orders from the same traffic and the same ad budget, CM3 in the example goes from DKK 15,000 to DKK 23,000 a month. When we do conversion rate optimization, we typically find the gains on product pages, mobile, cart and checkout, navigation and speed. See also how to measure your conversion rate.
  • Payment fees: DKK 11.30 per order is 2.8% of revenue excluding VAT. Compare rates in the guide to payment providers for Shopify.

Calculating contribution margin in Excel or Google Sheets

Put the labels in column A and the numbers in column B. The formulas use a period as the decimal separator.

CellContentNumber or formula
B1Selling price incl. VAT500
B2Selling price excl. VAT=B1/1.25
B3Cost of goods sold170
B4Shipping40
B5Packaging8.7
B6Payment fee=B1*1.9%+1.8
B7Returns and exchanges10
B8Contribution margin=B2-SUM(B3:B7)
B9Contribution margin ratio=B8/B2 (format the cell as a percentage)
B10Break-even ROAS=1/B9

B8 returns 160, B9 returns 40% and B10 returns 2.5. To go from a target margin to a price, the formula is selling price excl. VAT = cost / (1 minus target gross margin). A cost of DKK 170 and a target gross margin of 57.5% (CM1) give 170 / (1 - 0.575) = DKK 400 excluding VAT, or DKK 500 in the store.

Contribution margin in Shopify: where are the numbers?

Enter the product's cost in the Cost per item field on the product. Shopify then shows Profit and Margin in the same place, calculated as (price minus cost) / price × 100, and the product is included in the profit reports under Analytics > Reports. Two things are worth knowing (Shopify Help Center on cost per item and profit reports, 11 November 2026): if your store's prices include tax, which is the normal setup for a Danish store, Shopify does not show Profit and Margin for products you charge tax on. And the Gross profit by product report only deducts the cost from net sales. It corresponds to CM1, not to the full contribution margin.

Frequently asked questions

What is contribution margin?

Contribution margin is the part of revenue that is left once the variable costs are deducted. It has to cover the fixed costs, and what is left after that is the profit.

How do you calculate contribution margin?

You calculate contribution margin by subtracting the variable costs from revenue, both excluding VAT or sales tax. Per product it is the selling price minus the variable costs per unit. A product at DKK 400 excluding VAT with DKK 240 in variable costs has a contribution margin of DKK 160.

What is the contribution margin ratio formula?

Contribution margin ratio = contribution margin / revenue × 100. With a contribution margin of DKK 160 and a selling price of DKK 400 excluding VAT, the ratio is 160 / 400 × 100 = 40%.

What is the difference between contribution margin and gross margin?

Gross margin only deducts the cost of the goods sold. Contribution margin also deducts the other variable costs, such as shipping, packaging, payment fees and returns. A product sold for DKK 400 with DKK 170 in cost of goods and DKK 70 in other variable costs has a gross margin of 57.5% and a contribution margin ratio of 40%.

Next step

Book a no-obligation call. Tell us where you are today and what you want to achieve, and you'll get an honest take on the next step.

Read next

09.11.2026 What is Shopify? How the platform works and what it costs (2026) 06.11.2026 When Does Your Online Store Really Need Replatforming? 04.11.2026 How to Build Shopify Landing Pages That Sell