Contribution Margin for Ecommerce: Formula, Example, and How to Calculate It for Shopify

Revenue tells you how much your ecommerce store sold. Profit tells you how much the business kept.

But there is another metric that helps connect the two: contribution margin.

Contribution margin shows how much revenue remains after subtracting the variable costs associated with generating those sales. That remaining amount can then contribute toward fixed operating costs and, once those costs are covered, profit.

For Shopify merchants, contribution margin can be particularly useful because a sale may involve much more than the product’s purchase cost. Payment processing, fulfillment, shipping, packaging, transaction fees, and other variable expenses can all affect how much a sale actually contributes to the business.

Simplified Overview

Contribution margin is the amount of revenue left after subtracting the variable costs included in your calculation.

Contribution Margin Formula

Contribution Margin = Net Sales − Variable Costs

To express contribution margin as a percentage:

Contribution Margin Ratio = (Net Sales − Variable Costs) ÷ Net Sales × 100

For example, if a Shopify store generates $100,000 in net sales and has $60,000 in variable costs:

Contribution Margin = $100,000 − $60,000 = $40,000

Contribution Margin Ratio = $40,000 ÷ $100,000 × 100 = 40%

That means the store retains $0.40 of every $1 in net sales after the variable costs included in the calculation.

The remaining contribution margin is then available to cover fixed costs such as salaries, rent, software, and other overhead. After those costs are covered, the remaining amount contributes to profit.

What Is Contribution Margin in Ecommerce?

Contribution margin is a profitability metric that measures how much sales revenue remains after variable costs are deducted.

The key word is variable.

A variable cost generally changes as sales or order volume changes. For an ecommerce business, this could include costs that are incurred because an order was sold, processed, shipped, or fulfilled.

For example, imagine a Shopify store sells a product for $100.

The merchant might incur:

$35 product cost
$5 payment processing
$7 fulfillment
$3 packaging and shipping-related costs

The total variable cost is:

$35 + $5 + $7 + $3 = $50

The contribution margin is therefore:

$100 − $50 = $50

The contribution margin ratio is:

$50 ÷ $100 × 100 = 50%

So, under this cost definition, the product contributes $50 per sale, or 50% of its selling price, toward fixed costs and profit.

This is why contribution margin can be more informative than revenue alone.

Two products can generate exactly the same sales but contribute very different amounts to the business.

Why Contribution Margin Matters for Shopify Stores

A Shopify store can generate significant revenue and still have weak profitability.

Consider two products:

 Product AProduct B
Selling price$100$100
Product cost$40$65
Payment fees$3$3
Fulfillment$7$7
Other variable costs$0$5
Contribution margin$50$20
Contribution margin ratio50%20%

Both products generate:

$100 in revenue

But Product A contributes $50 toward fixed costs and profit, while Product B contributes only $20 under the assumptions above.

This distinction becomes especially important when a merchant is:

  • deciding which products to advertise
  • evaluating discounts
  • comparing product profitability
  • setting prices
  • calculating break-even sales
  • evaluating customer acquisition costs
  • assessing advertising efficiency
  • determining whether revenue growth is actually improving profitability

Contribution margin is therefore not simply a financial reporting metric. It can also be a decision-making metric.

Contribution Margin Formula

There are two common ways to express contribution margin.

1. Contribution Margin in Dollars

The basic formula is:

Contribution Margin = Net Sales − Variable Costs

For example:

Net Sales = $50,000
Variable Costs = $30,000

Therefore:

$50,000 − $30,000 = $20,000 contribution margin

The store has $20,000 remaining after the variable costs included in the calculation.

2. Contribution Margin Ratio

The contribution margin ratio expresses contribution margin as a percentage of net sales.

Contribution Margin Ratio = Contribution Margin ÷ Net Sales × 100

Using the previous example:

$20,000 ÷ $50,000 × 100 = 40%

The contribution margin ratio is therefore 40%.

Another way to write the formula is:

Contribution Margin Ratio = (Net Sales − Variable Costs) ÷ Net Sales × 100

A 40% contribution margin ratio means that, under the chosen cost definition, the business retains $0.40 from each $1 of net sales to contribute toward fixed costs and profit.

Contribution Margin Per Unit

Contribution margin can also be calculated for an individual product or order.

Formula

Contribution Margin Per Unit = Selling Price Per Unit − Variable Cost Per Unit

Suppose a Shopify merchant sells a product for $80.

The variable costs per unit are:

Product cost: $25
Payment fee: $3
Fulfillment: $8
Packaging: $2

Total variable cost:

$25 + $3 + $8 + $2 = $38

Contribution margin per unit:

$80 − $38 = $42

Contribution margin ratio:

$42 ÷ $80 × 100 = 52.5%

This means each $80 sale contributes $42 toward the business’s fixed costs and, after those are covered, profit.

This unit-level calculation is useful when comparing individual products, variants, bundles, or offers.

How to Calculate Contribution Margin for a Shopify Store

To calculate contribution margin for a Shopify store, follow these steps.

Step 1: Calculate Net Sales

Start with the sales revenue relevant to the period or products you’re analyzing.

For profitability analysis, net sales can be more useful than simply looking at gross sales because discounts, returns, and refunds can affect the amount of revenue the business actually retains.

For example:

Sales calculation Amount
Gross Sales $120,000
Discounts -$8,000
Returns & refunds -$7,000
Net Sales $105,000

Your contribution margin calculation should use a clearly defined sales figure and apply the same methodology consistently.

Step 2: Identify Your Variable Costs

This is the most important part of the calculation.

There is no single universal list of variable costs for every ecommerce business.

Instead, identify the costs that change with sales or order volume and decide which ones your business includes in its contribution-margin definition.

Potential ecommerce variable costs can include:

Product costs / COGS
Payment processing fees
Fulfillment fees
Per-order shipping costs
Packaging costs
Marketplace transaction fees
Sales commissions
Other transaction-based costs
Certain marketing or acquisition costs, depending on the purpose of the analysis

Shopify’s current ecommerce material gives examples such as packaging, shipping, and payment processing fees as variable costs.

Important:

Do not assume every expense is automatically a variable cost.

For example, a monthly software subscription may stay the same whether you receive 100 orders or 1,000 orders. That makes it different from a payment-processing fee that increases as transaction volume increases.

The exact classification depends on your business model and the purpose of your analysis.

Step 3: Add Your Variable Costs

Suppose a Shopify store has:

Net Sales: $100,000
Product Costs: $35,000
Fulfillment: $8,000
Payment Processing: $3,000
Packaging: $2,000
Other Variable Costs: $2,000

Total variable costs:

$35,000 + $8,000 + $3,000 + $2,000 + $2,000 = $50,000

Step 4: Calculate Contribution Margin

Now subtract variable costs from net sales.

Contribution Margin = Net Sales − Variable Costs

$100,000 − $50,000 = $50,000

The store’s contribution margin is therefore:

$50,000

Step 5: Calculate the Contribution Margin Ratio

Now divide contribution margin by net sales.

$50,000 ÷ $100,000 × 100 = 50%

The store has a:

50% Contribution Margin Ratio

In simple terms, the store retains $0.50 from each $1 of net sales after the variable costs included in this calculation.

Contribution Margin and Break-Even Analysis

One of the most useful applications of contribution margin is calculating your break-even point.

Contribution margin tells you how much each sale contributes toward fixed costs.

Once you know that amount, you can calculate how much you need to sell to cover those fixed costs.

Break-Even Units

Break-Even Units = Fixed Costs ÷ Contribution Margin Per Unit

Suppose:

Fixed costs = $20,000
Selling price = $100
Variable cost per unit = $60

Contribution margin per unit:

$100 − $60 = $40

Break-even units:

$20,000 ÷ $40 = 500 units

The business needs to sell approximately 500 units to cover $20,000 in fixed costs under these assumptions.

Shopify’s current break-even guidance uses the same contribution-margin concept for calculating break-even units and sales dollars.

Break-Even Sales

You can also calculate break-even sales revenue.

Formula

Break-Even Sales = Fixed Costs ÷ Contribution Margin Ratio

Using the previous example:

Fixed costs:

$20,000

Contribution margin ratio:

40%

Therefore:

$20,000 ÷ 0.40 = $50,000

The store needs approximately $50,000 in sales to cover its fixed costs.

Contribution Margin by Product

Contribution margin becomes even more useful when calculated at the product level.

Imagine a Shopify store sells three products:

ProductNet SalesVariable CostsContribution MarginCM Ratio
Product A$20,000$8,000$12,00060%
Product B$20,000$12,000$8,00040%
Product C$20,000$16,000$4,00020%

All three products generate the same revenue.

But Product A contributes three times as much contribution margin as Product C.

This illustrates an important ecommerce principle:

Revenue ranking and profitability ranking are not necessarily the same.

A product that generates the most sales is not automatically the product that creates the most value for the business.

Product-level contribution margin can help merchants investigate questions such as:

  • Which products generate the most contribution?
  • Which products have high revenue but weak margins?
  • Which products can support more advertising spend?
  • Which products are heavily affected by fulfillment costs?
  • Which products become less profitable after discounting?
  • Which products should be bundled?
  • Which products deserve closer pricing analysis?

Contribution Margin and Discounts

Discounts can have a significant impact on contribution margin.

Consider a product with:

  • Original price: $100
  • Variable costs: $50

At full price:

$100 − $50 = $50 contribution margin

Contribution margin ratio:

50%

Now suppose the merchant offers a 20% discount.

New selling price:

$80

If variable costs remain $50:

$80 − $50 = $30 contribution margin

Contribution margin ratio:

$30 ÷ $80 = 37.5%

The discount reduced contribution margin per sale from:

$50 → $30

That is a 40% reduction in contribution margin dollars, even though the selling price only fell by 20%.

This is why discounting should be evaluated not only by its effect on conversion rate and revenue, but also by its effect on contribution.

What Is a Good Contribution Margin for Ecommerce?

There is no single contribution-margin percentage that is universally “good” for every ecommerce business.

The appropriate level depends on factors such as:

  • Product category
  • Product costs
  • Pricing
  • Fulfillment model
  • Shipping costs
  • Return rates
  • Payment fees
  • Advertising costs
  • Customer acquisition costs
  • Fixed operating expenses
  • Business model

Shopify notes that contribution-margin ratios vary by industry and that many businesses operate below 50%.

Instead of asking only:

“Is my contribution margin good?”

ask:

“Is my contribution margin sufficient to cover the costs that come after it?”

For example, a store might have a 40% contribution margin.

If its remaining fixed and operating expenses consume 30% of sales, there may be room for profit.

If those expenses consume 50%, the business may still operate at a loss.

The contribution margin therefore needs to be evaluated alongside the rest of the store’s economics.

How GoProfit Can Help Shopify Merchants Analyze Profitability

For Shopify merchants, calculating contribution margin manually can become difficult when sales, product costs, advertising, fulfillment, payment fees, and other expenses are spread across different reports.

The challenge isn’t simply knowing how much the store sold.

It’s understanding what those sales actually contributed after the costs associated with generating them.

GoProfit brings Shopify sales and profitability data together with cost and advertising data, allowing merchants to move beyond revenue-only reporting and analyze the relationship between sales, costs, advertising, and profit.

For example, a merchant can use profitability reporting to investigate:

Net sales
COGS
Product profitability
Advertising spend
ROAS
Net profit
Profit margin
Fulfillment costs
Processing fees
Other expenses

That creates a more complete view of how sales translate into actual business profit.

See your Shopify profitability in one place → GoProfit