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:
- Product cost (manufacturing or purchase price, plus any import and customs costs).
- Packaging materials and inserts.
- Shipping; if you offer free shipping, all of it is your cost.
- Payment processing fees, often charged on the tax inclusive amount.
- Returns cost: return shipping, unsellable items and handling time. Weight it by return rate to get an average per order.
- Ad cost per order (total ad spend divided by orders).
- Platform or marketplace fees, plus any per order app fees.
What does a worked unit economics example look like?
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. Our what is ROAS article 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.
Building product level unit economics is the first step of our growth strategy work. If you want that table for your own products and an ad budget planned around it, the Performetic team offers a free growth analysis through our contact page.
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.
