Margin calculation is the foundation of any profitable e-commerce business. Without precise control over your margins, you're flying blind: your selling prices might be too low, your promotions might be eroding your profits without you knowing, and some products in your catalog might be losing money on every sale. Nearly 30% of e-commerce merchants don't accurately calculate their real margins, which partly explains the high failure rate in the sector.
In this comprehensive guide, we detail all the essential margin calculation formulas for e-commerce: gross margin, net margin, contribution margin, markup rate and margin rate. Each formula is illustrated with concrete numerical examples, accompanied by common mistakes to avoid and average margins by sector.
Types of margins in e-commerce
Before diving into calculations, it's essential to distinguish the different types of margins used in e-commerce. Each serves a different analytical purpose and enables specific decisions about your pricing strategy, marketing investments or product selection.
| Margin Type | Formula | What It Measures | Primary Use |
|---|---|---|---|
| Gross margin | (Selling price - Cost of goods) / Selling price x 100 | Direct product profitability | Pricing policy, supplier negotiation |
| Net margin | (Selling price - Total cost) / Selling price x 100 | Real profitability after all costs | Overall business profitability |
| Contribution margin | Selling price - Variable costs | Each sale's contribution to fixed costs | Product range decisions, prioritization |
| Markup rate | (Selling price - Cost of goods) / Cost of goods x 100 | Markup applied on purchase cost | Setting selling prices |
| Margin rate | (Selling price - Cost of goods) / Selling price x 100 | Margin share in selling price | Commercial profitability analysis |
Gross margin vs. net margin: the most common confusion
Gross margin only accounts for the product's purchase cost. Net margin includes all costs: shipping, packaging, payment commissions, platform fees, marketing and returns. An e-commerce merchant claiming 60% gross margin may actually have a net margin of only 10 to 15%. It's the net margin that determines your real profitability.
How to calculate gross margin in e-commerce
Gross margin is the first profitability indicator to master. It measures the difference between your selling price and your product's purchase cost. It's the starting point of any margin analysis, because if your gross margin is insufficient, no downstream optimization can save your profitability.
Let's take a concrete example. You sell a leather bag for 89.00 EUR (excl. tax). Your supplier charges you 32.00 EUR (excl. tax). Here's the gross margin calculation:
Identify the selling price (excl. tax)
Selling price = 89.00 EUR. This is the tax-exclusive amount you actually receive from the sale.
Identify the purchase cost (excl. tax)
Purchase cost = 32.00 EUR. This is the price paid to the supplier, excluding tax and inbound shipping.
Calculate the gross margin in value
Gross margin = 89.00 - 32.00 = 57.00 EUR. Each sale of this bag generates 57.00 EUR in gross margin.
Calculate the gross margin rate
Gross margin rate = (57.00 / 89.00) x 100 = 64.0%. This rate is excellent for a leather goods product.
With a gross margin rate of 64%, this leather bag leaves enough margin to cover indirect costs (shipping, marketing, commissions) while remaining profitable. Generally, a gross margin rate below 40% is risky in e-commerce, as indirect costs often represent 20 to 35% of the selling price.
How to calculate net margin in e-commerce
Net margin is the indicator that truly tells you how much you earn on each sale. Unlike gross margin, it includes all costs associated with selling a product: shipping, packaging, payment commissions, platform fees, customer acquisition costs and average return costs.
Let's return to our leather bag at 89.00 EUR (excl. tax) with a purchase cost of 32.00 EUR. Here's the detailed breakdown of additional costs to integrate for the real net margin:
| Cost Item | Amount | % of Selling Price |
|---|---|---|
| Product purchase cost | 32.00 EUR | 36.0% |
| Customer shipping | 5.50 EUR | 6.2% |
| Packaging (box + padding + label) | 2.30 EUR | 2.6% |
| Payment commission (Stripe 1.5% + 0.25 EUR) | 1.59 EUR | 1.8% |
| Platform / hosting fees (allocated) | 1.20 EUR | 1.3% |
| Marketing cost per order | 8.50 EUR | 9.6% |
| Average return cost (12% return rate) | 1.80 EUR | 2.0% |
| Total costs | 52.89 EUR | 59.4% |
| Net margin | 36.11 EUR | 40.6% |
Costs often forgotten in net margin calculation
E-commerce merchants frequently underestimate certain cost items: return costs (return shipping + refurbishment + value loss), marketplace commissions (8 to 20% on Amazon), customer service costs (time spent, partial refunds), storage costs for slow-moving products and fixed banking fees. These forgotten costs can represent 5 to 15% of the selling price and turn an apparent margin into a real loss.
Difference between markup rate and margin rate
The confusion between markup rate and margin rate is one of the most widespread errors among e-commerce merchants. These two indicators use the same base data (selling price and purchase cost) but are calculated differently and measure different things.
Let's take a concrete example. You buy a product for 40.00 EUR and sell it for 100.00 EUR. The margin in value is identical in both cases: 60.00 EUR. But the rates differ considerably:
- Markup rate = (100 - 40) / 40 x 100 = 150%. This means you apply a multiplier of 2.5 on your purchase cost.
- Margin rate = (100 - 40) / 100 x 100 = 60%. This means 60% of your selling price corresponds to margin.
- The markup rate is always higher than the margin rate for the same product.
- Markup rate is useful for setting prices from purchase cost (supplier approach).
- Margin rate is useful for analyzing profitability from revenue (commercial approach).
Tip for converting between markup and margin rates
To convert markup rate to margin rate: Margin rate = Markup rate / (1 + Markup rate). Example: a 150% markup gives a margin rate of 150 / (1 + 1.5) = 60%. Conversely: Markup rate = Margin rate / (1 - Margin rate). These conversion formulas prevent frequent calculation errors.
Average margins by e-commerce sector
Knowing the average margins in your sector is essential for evaluating your positioning. A gross margin rate of 40% can be excellent in electronics but mediocre in cosmetics. Here's a detailed overview of average gross margins by e-commerce sector.
| Sector | Average Gross Margin | Average Net Margin | Observations |
|---|---|---|---|
| Fashion and clothing | 50 - 65% | 10 - 20% | High returns (20-30%), strong promotional pressure |
| Beauty and cosmetics | 60 - 75% | 15 - 25% | High margins, strong loyalty, stable average order value |
| Electronics and tech | 15 - 30% | 3 - 8% | Low margins, intense competition, high volume |
| Food and gourmet | 30 - 45% | 5 - 12% | Logistics constraints, perishability, low average order |
| Home and decor | 45 - 60% | 10 - 18% | High shipping costs on bulky products |
| Health and wellness | 55 - 70% | 12 - 22% | Strict regulations, customer trust crucial |
| Sports and leisure | 40 - 55% | 8 - 15% | Marked seasonality, wide range |
| Jewelry and accessories | 60 - 80% | 20 - 35% | Low storage cost, high perceived value |
| Office supplies | 25 - 40% | 5 - 10% | Tight margins, recurring B2B orders |
| Toys and childcare | 35 - 50% | 8 - 14% | Seasonal peaks (Christmas), safety standards |
| Pet supplies | 35 - 50% | 8 - 15% | Recurring purchases, natural loyalty |
| DIY and gardening | 40 - 55% | 10 - 16% | Heavy products, high logistics costs |
Common mistakes in margin calculation
Many e-commerce merchants make errors that distort their margin calculations and lead to disastrous profitability decisions. Here are the most frequent pitfalls to avoid.
- Confusing markup rate and margin rate. A product bought for 40 EUR and sold for 100 EUR has a 150% markup but a 60% margin rate. Using one instead of the other distorts your entire pricing strategy.
- Calculating margin on the tax-inclusive price instead of tax-exclusive. VAT is not revenue, it's a tax remitted to the government. Always calculate margins on tax-exclusive prices.
- Forgetting return costs in net margin calculation. With a 20% return rate in fashion and an average cost of 12 EUR per return, that represents 2.40 EUR in additional cost per product sold.
- Ignoring marketplace commissions. Amazon charges 8 to 15% commission depending on category, plus FBA fees if using their logistics.
- Not including customer acquisition cost. If you spend 5,000 EUR on advertising for 500 orders, each order carries a 10 EUR marketing cost.
- Calculating an overall margin instead of per-product margin. Some products in your catalog may be sold at a loss without you knowing.
- Not updating costs regularly. Supplier prices, shipping rates and payment commissions change. A margin calculation from 6 months ago is probably outdated.
- Confusing gross margin with profit. Gross margin doesn't account for overheads (salaries, rent, subscriptions). A positive gross margin doesn't guarantee your business is profitable.
Fullmetrix: automatic margin calculation for your e-commerce
Manually calculating the margin of every product in your catalog is time-consuming and error-prone. Fullmetrix automates the entire margin calculation by connecting directly to your e-commerce stores (WooCommerce, PrestaShop, Shopify) and integrating all cost items: purchase cost, shipping, commissions, marketing and returns.
With Fullmetrix, you access a detailed profit and loss statement (P&L) by product, category and store. The tool calculates your gross margin, net margin and contribution margin in real time for every SKU in your catalog. You instantly identify the most profitable products and those dragging down your profitability.
- Automatic margin calculation by product, category and store
- Multi-store integration: WooCommerce, PrestaShop, Shopify in a single dashboard
- Detailed P&L including all costs: purchase, shipping, platform, payment, marketing, returns
- Automatic alerts when a product's margin drops below a defined threshold
- Margin trend tracking over time with complete history
- Data export for your accounting and in-depth analysis
FAQ: most frequently asked questions about margin calculation
How to calculate the margin on a product?
To calculate the margin on a product, subtract the purchase cost (excl. tax) from the selling price (excl. tax). Example: a product sold for 50.00 EUR with a purchase cost of 20.00 EUR generates a gross margin of 30.00 EUR, or a 60% gross margin rate. For net margin, also subtract all indirect costs (shipping, packaging, commissions, marketing).
What is the difference between margin and profit?
Margin measures the profitability of a product or commercial activity. Profit is the final result after deducting all charges, including overheads (salaries, rent, taxes, depreciation). You can have good gross margins on your products but negative profit if your structural costs are too high relative to your sales volume.
What margin rate should you aim for in e-commerce?
The ideal gross margin rate depends on your sector. In fashion, aim for 50 to 65%. In electronics, 15 to 30% is the norm. In beauty and cosmetics, gross margins of 60 to 75% are common. The key is that your net margin (after all costs) remains positive and sufficient to cover structural costs and generate profit. A net margin rate of 10 to 20% is considered healthy in e-commerce.
How to increase your margin in e-commerce?
Several levers can increase your margins: negotiate better supplier rates by increasing volumes, optimize logistics costs (order grouping, carrier selection), reduce return rates by improving product listings, decrease customer acquisition costs through SEO and loyalty programs, and increase average order value through cross-selling and upselling. Use a tool like Fullmetrix to identify low-margin products and prioritize your actions.
Should margin be calculated including or excluding tax?
Margin calculation should always be done excluding tax. VAT is a tax collected on behalf of the government and does not constitute revenue for your business. Calculating margin on the tax-inclusive price would give an artificially inflated result and distort your decisions. All margin indicators (gross, net, markup rate, margin rate) must be calculated on tax-exclusive amounts.

