Calculating the cost of goods sold (COGS) is the cornerstone of any profitability strategy in e-commerce. Without precise knowledge of what each product actually costs you, it's impossible to set consistent prices, measure real margins or identify products that are dragging down your profitability. Yet many e-commerce merchants limit themselves to the supplier purchase price and overlook a multitude of indirect costs that eat into their profits.
In this guide, we detail the complete method for calculating the cost of goods for your e-commerce products, with clear formulas, sector-specific examples and the mistakes to absolutely avoid.
What is the cost of goods sold?
The cost of goods sold represents the total of all expenses incurred to manufacture, purchase, store, ship and market a product. It goes beyond the simple supplier purchase price: it incorporates all direct and indirect costs required for a product to reach the end customer.
In e-commerce, calculating COGS is particularly complex because it includes costs specific to online selling: platform fees, payment commissions, logistics costs, return costs and customer acquisition costs.
This basic formula must be adapted to the e-commerce context by incorporating components specific to online selling. A poorly calculated COGS inevitably leads to inappropriate selling prices and illusory margins.
COGS vs. purchase price
The purchase price is the amount paid to the supplier. The COGS includes the purchase price plus all ancillary costs (logistics, packaging, commissions, etc.). The difference between the two can represent 30 to 60% of the total cost depending on the sector.
Components of e-commerce COGS
To obtain a reliable COGS, you need to identify and quantify each expense item. Here is a comprehensive table of the components to consider for an e-commerce business.
| Component | Description | Example Cost | Average Share |
|---|---|---|---|
| Product purchase cost | Price paid to supplier or manufacturing cost | EUR 10.00 / unit | 30 - 50% |
| Inbound shipping | Supplier delivery to your warehouse | EUR 0.50 - 2.00 / unit | 2 - 5% |
| Packaging | Box, padding, tape, label, insert | EUR 0.80 - 3.00 / parcel | 3 - 8% |
| Outbound shipping | Carrier (DHL, UPS, Royal Mail, etc.) | EUR 3.00 - 8.00 / parcel | 10 - 20% |
| Platform commissions | Marketplace fees (Amazon, eBay) or CMS subscription | 5 - 15% of revenue | 5 - 15% |
| Payment fees | Stripe, PayPal, credit card commissions | 1.4 - 2.9% + fixed | 2 - 3% |
| Marketing / acquisition cost | Cost per order (SEA, Social Ads, SEO) | EUR 3.00 - 15.00 / order | 10 - 25% |
| Return costs | Return shipping + reconditioning + value loss | EUR 5.00 - 15.00 / return | 2 - 8% |
| Customer support | Time spent, tools, partial refunds | EUR 0.50 - 2.00 / order | 1 - 3% |
| Storage / warehousing | Warehouse rent, 3PL, picking fees | EUR 0.30 - 1.50 / unit / month | 2 - 5% |
The share of each component varies considerably depending on the product type, average order value and logistics model. A EUR 15 product doesn't have the same cost structure as a EUR 150 product. That's why the calculation must be done product by product, not globally.
Direct costs vs. indirect costs
Direct costs are those directly attributable to a specific product: purchase cost, packaging, shipping. Indirect costs (rent, software subscriptions, salaries, global marketing) must be allocated across all products sold using appropriate allocation keys.
- Direct costs: purchase price, specific packaging, per-product shipping, sales commissions
- Indirect costs: warehouse rent, CMS subscription, salaries, fixed bank fees, marketing tools
- Indirect cost allocation can be done proportionally by revenue, volume or number of orders
How to calculate COGS step by step
Here is the detailed method for calculating the true COGS for each product in your e-commerce catalog. Follow these steps in order to ensure no expense item is overlooked.
List all purchase costs
For each product reference (SKU), identify the unit purchase price. Include customs duties and import taxes if you buy outside your region. Remember to recalculate regularly if your suppliers adjust their prices.
Calculate inbound logistics costs
Divide the total cost of each supplier delivery by the number of units received. If a container of 500 units costs EUR 1,200 in transport, the inbound logistics cost is EUR 2.40 per unit.
Evaluate preparation and packaging costs
Add up the cost of packaging materials (box, padding, tape, labels) and preparation time (picking, packing). If an employee prepares 30 parcels per hour at EUR 12/hr, the labor cost is EUR 0.40 per parcel.
Integrate shipping and payment fees
Note the average shipping cost per parcel from your carrier. Add payment commissions (typically 1.4% + EUR 0.25 for Stripe in Europe). These costs vary per order, so calculate them on a monthly basis then bring them down to a per-unit figure.
Allocate indirect costs
List all your monthly fixed costs (rent, subscriptions, salaries, marketing). Divide the total by the number of orders or units sold in the month to get an indirect cost per unit. Example: EUR 3,000 in fixed costs / 600 orders = EUR 5.00 per order.
Sum up to get the total COGS
COGS = purchase cost + inbound logistics + packaging + shipping + payment commissions + share of indirect costs. Compare this result to your pre-tax selling price to get your real net margin per product.
Practical tip
Create a spreadsheet with one row per SKU and one column per cost item. Update the data monthly to track changes in your COGS and detect drift. Even better, use a tool like Fullmetrix that automates this calculation in real time.
Concrete calculation examples
To illustrate the method, here are three detailed examples for products from different sectors. Each example shows how the real COGS can be very different from the simple purchase price.
Example 1: T-shirt sold online (fashion)
| Cost Item | Amount | % of Selling Price |
|---|---|---|
| Supplier purchase price | EUR 6.00 | 20.0% |
| Inbound shipping (per unit) | EUR 0.80 | 2.7% |
| Packaging (pouch + label) | EUR 1.20 | 4.0% |
| Customer shipping (relay point) | EUR 3.50 | 11.7% |
| Payment commission (Stripe 1.4% + EUR 0.25) | EUR 0.67 | 2.2% |
| Marketing cost (allocated CAC) | EUR 4.00 | 13.3% |
| Return rate (20% x EUR 8.00) | EUR 1.60 | 5.3% |
| Allocated indirect costs | EUR 2.50 | 8.3% |
| Total COGS | EUR 20.27 | 67.6% |
| Selling price incl. tax | EUR 30.00 | 100% |
| Real net margin | EUR 9.73 | 32.4% |
With a purchase price of EUR 6 and a selling price of EUR 30, you might think the margin is 80%. In reality, the true COGS is EUR 20.27, meaning a net margin of only 32.4%. The high return rate in fashion (20%) weighs heavily on profitability.
Example 2: Phone case (electronics / accessories)
Let's take the case of a phone case sold for EUR 19.90 on a proprietary e-commerce site.
- Purchase price: EUR 2.50
- Inbound shipping: EUR 0.30
- Packaging: EUR 0.90
- Outbound shipping: EUR 4.50
- Payment commission: EUR 0.53
- Marketing cost (SEA): EUR 3.20
- Returns (10% x EUR 6.00): EUR 0.60
- Indirect costs: EUR 1.80
- Total COGS: EUR 14.33
- Net margin: EUR 5.57 i.e. 28.0%
For this type of low-value product, shipping and marketing costs represent a disproportionate share of the COGS. Optimization involves negotiating carrier rates and improving conversion rates to reduce CPA.
Example 3: Face serum (cosmetics)
A premium face serum sold for EUR 45.00 on PrestaShop.
- Manufacturing cost (formula + bottle + labeling): EUR 8.00
- Inbound shipping: EUR 0.40
- Premium packaging (box + padding + insert): EUR 2.80
- Outbound shipping: EUR 4.80
- Payment commission: EUR 0.88
- Marketing cost (influencer + SEA): EUR 6.50
- Returns (5% x EUR 7.00): EUR 0.35
- Indirect costs: EUR 3.00
- Total COGS: EUR 26.73
- Net margin: EUR 18.27 i.e. 40.6%
Premium cosmetics offer the best net margin thanks to a higher average order value, low return rate and controlled manufacturing costs. This is a good example of a sector where calculating COGS reveals above-average e-commerce profitability.
Common mistakes in COGS calculation
Many e-commerce merchants make mistakes that skew their COGS calculation and lead to poor pricing decisions. Here are the most common pitfalls.
- Confusing purchase price with COGS: the purchase price represents on average only 30 to 50% of the total COGS
- Forgetting return costs: in fashion, the return rate can reach 25 to 30%, significantly impacting real margins
- Not including customer acquisition cost: marketing spend (SEA, Social Ads) must be allocated to each order
- Ignoring payment fees: Stripe or PayPal commissions of 1.4 to 2.9% add up across thousands of transactions
- Calculating a global average COGS instead of per product: each SKU has its own cost structure
- Not updating the calculation: carrier rates, supplier costs and CPAs evolve constantly
- Forgetting storage costs: a product sitting in stock for 6 months costs much more than a fast-moving product
- Not accounting for losses and breakage: damaged, expired or stolen products represent an invisible cost
Beware of illusory margins
A product purchased for EUR 10 and sold for EUR 40 doesn't have a 75% margin. Once all costs are factored in (logistics, marketing, returns, payments, overhead), the real net margin typically ranges between 15 and 35%. Never base your pricing decisions solely on the purchase price.
Automate COGS calculation with Fullmetrix
Manually calculating COGS for each product is tedious and error-prone, especially when your catalog exceeds a few dozen references. Fullmetrix fully automates this process by connecting directly to your online store.
Connect to your e-commerce CMS
Fullmetrix connects natively to PrestaShop, WooCommerce and Shopify. Once connected, all your sales, orders, products and cost data are synchronized automatically. No manual entry is required.
- PrestaShop: synchronization via official plugin, 2-minute installation
- WooCommerce: dedicated WordPress plugin with real-time synchronization
- Shopify: connection via the official Shopify API
Automatic calculation and per-product P&L
Fullmetrix automatically calculates the COGS for each product by integrating all components: purchase price, shipping costs, commissions, marketing costs and indirect charges. You get a P&L (profit and loss statement) per product, per category and for your entire store.
- Real-time view of net margin per product and per order
- Automatic detection of unprofitable products
- Track COGS changes over time
- Alerts when a COGS exceeds a defined threshold
- Data export for your accounting
Instead of spending hours on a spreadsheet, you have a dashboard that shows you at a glance which products actually generate profit and which ones need a price adjustment or supplier change.
FAQ on COGS calculation
What is the COGS formula for e-commerce?
The complete e-commerce COGS formula is: Purchase cost + Inbound logistics + Packaging + Shipping costs + Payment commissions + Marketing acquisition cost + Return costs + Share of indirect charges (rent, subscriptions, salaries). Each item must be calculated per unit sold to obtain a precise unit COGS.
What is the difference between COGS and purchase price?
The purchase price is only the amount paid to the supplier for the product. COGS is much broader: it includes the purchase price plus all costs necessary to sell and deliver the product to the end customer. In e-commerce, COGS is on average 2 to 3 times higher than the simple purchase price.
How to calculate COGS when selling on marketplaces?
On a marketplace like Amazon or eBay, the COGS calculation must include platform commissions (typically 8 to 15% of selling price), FBA or marketplace logistics fees, storage fees charged by the marketplace and potential advertising commissions (Amazon PPC). These additional items considerably reduce the margin compared to selling on your own website.
How often should COGS be recalculated?
Ideally, COGS should be recalculated every month. Supplier prices, transport costs, commissions and marketing performance are constantly evolving. A COGS calculated 6 months ago can be completely outdated. With a tool like Fullmetrix, this recalculation is automatic and continuous.
What is the average COGS in e-commerce?
There is no universal average COGS as it depends on the sector, product type and logistics model. However, as a general rule, COGS represents between 60 and 80% of the selling price in e-commerce. This means the real net margin typically ranges between 20 and 40%. High-margin sectors (cosmetics, digital) can achieve 50-60% COGS, while low-margin sectors (food, consumer electronics) often reach 80-90%.
Automatically calculate the COGS for each product
Connect your PrestaShop, WooCommerce or Shopify store and instantly get the real COGS, net margin and P&L per product.
Try Fullmetrix for free
