---
title: "How to calculate ecommerce profit margin"
author: "Performetic Ekibi"
url: "https://www.performetic.com/en/blog/ecommerce-profit-margin-unit-economics"
published: "2026-05-28T08:00:00.000Z"
updated: "2026-10-05T01:22:48.844Z"
---

# How to calculate ecommerce profit margin

> To calculate ecommerce profit margin correctly, remove sales tax or VAT from the price first, then subtract per order costs in layers: product and packaging, shipping, payment fees, returns and ad spend. What remains is contribution margin. Fixed costs are paid from it; if contribution margin is negative, more sales simply mean bigger losses.

## How do you calculate profit margin in ecommerce?

Real ecommerce profit margin is calculated by subtracting every variable cost per order from revenue excluding sales tax or VAT: product cost, packaging, shipping, payment fees, returns and ad spend. What is left is contribution margin. Gross margin alone is misleading, because ecommerce's biggest costs come after the cost of the product.

Plenty of brands think, "it costs us $40 and sells for $100, so our margin is great." Add shipping, fees, returns and ads, and the same product may be losing money. Unit economics shows what each order really leaves the business, and it is the foundation for pricing, discounting and ad budget decisions.

## What is the difference between gross margin and contribution margin?

**Gross margin** subtracts only the cost of goods sold (COGS) from revenue. **Contribution margin** is what remains after all variable costs tied to the order. In practice, tracking contribution margin in three layers is the clearest approach:

| Layer | Calculation | What it tells you |
|---|---|---|
| Contribution margin 1 (CM1) | Net revenue minus product and packaging cost | Profitability of the product itself |
| Contribution margin 2 (CM2) | CM1 minus shipping, payment fees and returns | Profitability after operations |
| Contribution margin 3 (CM3) | CM2 minus ad cost per order | Profit per order after marketing |

Fixed costs (salaries, rent, software subscriptions) are not part of these layers; they are paid from total CM3.

## Which costs should be included?

List every per order cost. The most often forgotten items are in bold:

1. Product cost (manufacturing or purchase price, plus any import and customs costs).
2. **Packaging materials** and inserts.
3. Shipping; if you offer free shipping, all of it is your cost.
4. **Payment processing fees**, often charged on the tax inclusive amount.
5. **Returns cost:** return shipping, unsellable items and handling time. Weight it by return rate to get an average per order.
6. Ad cost per order (total ad spend divided by orders).
7. **Platform or marketplace fees**, plus any per order app fees.

## Worked unit economics example

Example: a product sold for $120 including 20% VAT. All numbers are hypothetical.

| Item | Amount | Note |
|---|---|---|
| Price including VAT | $120 | What the customer pays |
| Net revenue excluding VAT | $100 | 120 / 1.20 |
| Product cost | $35 | |
| Packaging | $2 | |
| **CM1** | **$63** | 63% of net revenue |
| Shipping | $7 | Free shipping |
| Payment fee (3% of gross) | $3.60 | |
| Returns cost (average) | $2.50 | Weighted by return rate |
| **CM2** | **$49.90** | 49.9% of net revenue |
| Ad cost per order | $30 | |
| **CM3** | **$19.90** | 19.9% of net revenue |

A margin that looks like 63% at gross level falls to 19.9% after marketing. At 1,000 orders a month this brand produces $19,900 of contribution. With $15,000 of monthly fixed costs, operating profit is $4,900.

## How do discounts affect profit margin?

Discounts take a disproportionate bite out of contribution margin, because most costs stay fixed while revenue drops. Apply a 20% discount to the same example:

| Item | Full price | 20% off |
|---|---|---|
| Price including VAT | $120 | $96 |
| Net revenue excluding VAT | $100 | $80 |
| Product and packaging | $37 | $37 |
| Shipping, fees, returns | $13.10 | $12.38 |
| **CM2** | **$49.90** | **$30.62** |

A 20% price cut reduces CM2 by roughly 39%. If ad cost per order stays the same, profit per order drops from $19.90 to $0.62. Since ad costs usually rise during sale periods too, discounted orders can easily lose money. Recalculate the contribution table at the discounted price before you set a discount level.

## How does contribution margin set your ad budget?

CM2 is the maximum you can spend on ads per order. In this example, any order that costs more than $49.90 to acquire loses money. To turn that limit into a ROAS target, use our [break even ROAS guide](/en/blog/break-even-roas-calculator-target-roas). Our [what is ROAS article](/en/blog/what-is-roas-how-to-calculate) explains what ROAS does and does not measure.

It also pays to calculate unit economics per product. Even if average contribution margin looks healthy, some products (heavy, bulky or with high return rates) may lose money systematically. Pushing them in ads quietly erodes total profit.

## How many orders do you need to cover fixed costs?

Once you know contribution margin, you can calculate how many orders per month keep the business from losing money:

**Break even orders = Monthly fixed costs / CM3 per order**

For the example brand: $15,000 / $19.90 = about 754 orders. Below 754 orders a month the business loses money; every order above that leaves $19.90 of profit. This makes growth targets concrete: hiring a new employee raises fixed costs and pushes the break even point up.

The same formula shows what happens when ad costs move. If ad cost per order rises from $30 to $35, CM3 falls to $14.90 and the break even point climbs to about 1,007 orders. A small rise in acquisition cost increases the orders needed to reach profit by roughly a third.

### How often should you update unit economics?

Carrier rates, supplier prices, exchange rates and ad costs change constantly. Recalculate your contribution table at least monthly, and always before major sale periods.

## How can you improve unit economics?

- Raise average order value so shipping and packaging spread across more items.
- Analyze return reasons; better size charts, photos and descriptions can lower return rates.
- Set your free shipping threshold based on contribution margin.
- Point ad budget toward products with high CM2.
- Renegotiate supplier and carrier terms as your order volume grows.

## Key takeaways

- Remove sales tax or VAT first; always calculate margin on net revenue.
- Track contribution margin in three layers: product, operations and marketing.
- Packaging, payment fees and returns are the most commonly forgotten costs.
- Discounts cut contribution margin far more than the headline discount rate.
- CM2 sets the maximum ad cost you can afford per order.

If you want to build product level unit economics and plan ad budgets around them, the Performetic team offers a free analysis through our [contact page](/en/contact).

## FAQ

### What is a good profit margin for ecommerce?

There is no universal good margin; it varies by category, price point and business model. What matters is that contribution margin after advertising covers your fixed costs and leaves profit. Calculate contribution margin in three layers for your own products, then work out how many orders you need to cover fixed costs.

### Should margin be calculated with or without VAT?

Without. VAT or sales tax is collected on behalf of the government and is not your revenue. Always calculate margin on net revenue. A product sold for $120 including 20% VAT brings in $100 of net revenue. Note that payment fees are often charged on the tax inclusive amount.

### How do you include returns in margin calculations?

Estimate the full cost of one return (return shipping, unsellable stock, handling time) and multiply it by your return rate to get an average per order. If a return costs $25 and your return rate is 10%, the returns cost per order is $2.50. Add that to every order's costs.

### What is the difference between contribution margin and net profit?

Contribution margin is what remains after subtracting only the variable costs tied to each order. Net profit is what remains after subtracting fixed costs such as salaries, rent and software, plus taxes, from total contribution. Without positive contribution margin, net profit is impossible no matter how much you sell.

## Sources

- [Shopify: How to Increase Profit Margin](https://www.shopify.com/blog/profit-margin)
- [Shopify: What Is Gross Margin?](https://www.shopify.com/blog/gross-margin)
- [Shopify: Cost of Goods Sold](https://www.shopify.com/blog/cost-of-goods-sold)
- [Shopify: Average Order Value](https://www.shopify.com/blog/average-order-value)
