Most e-commerce profit margin calculations are wrong, not because the math is hard but because the cost categories left out are large. The store looks profitable in the dashboard and is bleeding money in real life. Below is the full margin formula with every line item that matters in 2026, plus a copyable template you can build into a spreadsheet today.

The full formula

Net profit per unit = Retail price - Platform fees - Payment processing fees - COGS - Inbound shipping and duty - Outbound shipping - Refund and replacement reserve - Allocated ad cost - Allocated overhead

Nine line items. Most beginner calculations have three. The other six are where the money quietly leaks.

Line by line

Retail price. What the customer pays before any discounts. Use the price you actually charge most of the time, not the list price.

Platform fees. Different per channel. Amazon referral fee is 15% in most categories. Etsy is 6.5% transaction plus $0.20 listing. Shopify itself does not take a per-sale fee but takes a monthly subscription which lands in overhead. eBay is 12-13%. TikTok Shop is currently 8%.

Payment processing. Roughly 2.9% + $0.30 per transaction across most processors in the US. Higher for international. Compounds across volume.

COGS (Cost of Goods Sold). What you actually pay the supplier per unit. Includes the product, supplier processing, any branding charges. Does not include shipping or duty - those are separate line items.

Inbound shipping and duty. The cost of getting inventory from supplier to your warehouse or to FBA. For dropshipping, the inbound is per-order and includes the new 2026 import duty on China-sourced packages.

Outbound shipping. What you pay to ship to the customer. For FBA, this is bundled into the pick-pack fee. For self-fulfilment or dropshipping, this is a real per-order cost.

Refund and replacement reserve. Allocate 3-8% of revenue depending on category. Apparel and fragile goods at the higher end. Home goods and accessories at the lower end. The reserve includes both the refund itself AND the lost product if not returnable.

Allocated ad cost. Total ad spend in the period divided by total units sold in the period. This is per-unit ad CAC. Most beginners track ad spend separately and then "discover" they are not profitable when accounting later.

Allocated overhead. Monthly fixed costs (Shopify subscription, software, packaging supplies, your wage at notional rate, fulfilment center fees if outsourced) divided by monthly units. Per-unit overhead.

The worked example - Amazon FBA

Stainless steel water bottle. Retail $34.99.

Platform fees (15% Amazon referral on $34.99): $5.25.

Payment processing: Amazon handles, included in referral fee.

COGS (factory price): $4.80.

Inbound shipping and duty (sea freight from China, ~$1.20 per unit landed): $1.20.

FBA pick-pack-ship (small standard): $3.75.

Refund reserve (5% on $34.99): $1.75.

Allocated ad cost (~$5 per unit average across organic + paid): $5.00.

Allocated overhead (apps, photos amortized, etc): $1.00.

Total costs: $22.75.

Net profit per unit: $12.24. About 35% margin.

That is a healthy product. Compare to a beginner calculation that might do "Retail $34.99 minus $4.80 COGS equals $30 profit." The real number is $12.24. The discrepancy hides why "profitable" businesses sometimes run out of cash.

The worked example - Shopify direct

Same water bottle, sold on Shopify with own ads.

Retail $34.99.

Platform fees: $0 (Shopify subscription is in overhead).

Payment processing (2.9% + $0.30): $1.31.

COGS: $4.80.

Inbound shipping (per unit, in bulk): $1.20.

Outbound shipping to customer (you cover): $5.50.

Refund reserve (5%): $1.75.

Allocated ad cost (Facebook + Google, $14 CAC): $14.00.

Allocated overhead (Shopify $39, apps $80, monthly volume 200 units = $0.60/unit): $0.60.

Total costs: $29.16.

Net profit per unit: $5.83. About 17% margin.

Shopify direct gives you more brand control but worse unit economics here because ad CAC is higher and outbound shipping is your cost. Same product, different platform, very different math.

The hidden costs most beginners miss

Chargebacks. About 0.3-1% of transactions become chargebacks. Each one costs $15-$25 in fees plus the lost product. Bake into the refund reserve.

Returns processing labour. The time you spend processing a return is real cost. At your hourly value, 15 minutes per return for a 5% return rate is meaningful.

Inventory holding costs. If you have $20,000 sitting in inventory, you have $20,000 not earning anything. The opportunity cost is real, even if it does not show up on the income statement.

Software subscriptions that grow with revenue. Klaviyo costs more as your list grows. ShipStation costs more as your shipments grow. These are usually 1-3% of revenue at small scale and worth tracking.

Taxes. State sales tax, federal income tax, self-employment tax. The take-home from a "$12.24 net per unit" is closer to $8-$10 after all of those.

True freedom is not in how much you make. It is in how much you keep and how peacefully you sleep at night.

The spreadsheet template

Build a sheet with the nine line items above as columns. Each row is a product. Update the numbers monthly. Track the trend.

Useful derived columns: gross margin % (price minus COGS, as % of price), contribution margin % (price minus variable costs, as % of price), net margin % (price minus all costs, as % of price). The three numbers tell three different stories.

Gross margin shows whether your product economics are healthy in isolation.

Contribution margin shows whether you can afford to spend on ads.

Net margin shows what is actually in your pocket.

Most beginners track only gross margin. Hence the surprise when the bank account does not match the spreadsheet.

The targets by model

For dropshipping in 2026, target net margin 12-20%. Below 10% is too thin to survive ad CAC fluctuations.

For Amazon FBA, target net margin 20-35% after all line items. The fees are real but the platform brings the traffic.

For Shopify direct, target net margin 15-30% because you carry the customer acquisition cost.

For digital products on Etsy, target net margin 60-80%. The COGS is near zero so the margin should be huge - if it is not, ads or platform fees are eating you.

For the broader unit economics layer, read dropshipping profit calculator: the honest math and customer acquisition cost in e-commerce. The full profit-engineering module - with my spreadsheet template - is in the course. Build the sheet today. Run the math on your last 30 days. The number that comes out may surprise you.