COGS (Cost of Goods Sold): Formula, What to Include & Ecommerce Examples

COGS for ecommerce: the formula (beginning inventory + purchases − ending inventory), what to include vs exclude, landed cost, gross margin impact, and how product cost shapes unit economics.

Key takeaways

  • COGS is the direct product cost of units sold—not marketing, rent, or outbound shipping (for most DTC models).
  • Use landed cost per SKU (invoice + inbound freight + duty + direct packaging) for planning; use inventory roll-forward for accounting periods.
  • Gross margin from COGS is necessary but not sufficient: shipping, fees, and returns often erase a “good” product margin.
  • Hero SKUs with low COGS can subsidize accessories only if you model mix intentionally, not by accident in a blended average.
  • Rehearse COGS and margin trade-offs in the Ecommerce Simulator before you commit to a promo or supplier MOQ.

Definition

COGS (cost of goods sold) — the direct cost of the products you sold in a period: supplier invoices, manufacturing, inbound freight, duty, and packaging tied to units that left inventory. Revenue minus COGS is gross profit. COGS answers “what did the merchandise cost?” before shipping to customers, payment fees, ads, and overhead.

COGS formula

Period COGS = Beginning inventory + Purchases (and production) − Ending inventory

For day-to-day ecommerce planning, operators usually work in landed cost per unit:

Landed COGS per unit ≈ Product invoice + Inbound freight + Duty + Direct packaging

Gross margin % = (Revenue − COGS) ÷ Revenue

Example: you sell a SKU for $72 and landed COGS is $26.40 → gross profit $45.60 → gross margin 63.3%. That is merchandise margin only—outbound shipping, payment fees, and returns still sit between gross profit and contribution margin.

What to include vs exclude

Usually in COGSUsually outside COGS
Supplier product costPaid media and affiliates
Inbound freight and dutyOutbound shipping to customers
Direct manufacturing labor (if you produce)Payment processing fees
Packaging that ships with the unitWarehouse rent and salaries
Co-packer fees tied to units producedReturns processing (often in contribution)

The split matters because a store can show 60% gross margin and still lose money per order after $9 of net shipping and 3% payment fees. COGS is the foundation of gross margin; unit economics needs the full variable stack.

What the number hides / common mistakes

  • Stale supplier quotes — FX, freight, and MOQ discounts move COGS; using last year’s $18 cost on a $22 invoice makes every dashboard lie.
  • Blended average COGS — a hero SKU at 70% gross margin hides an accessory line at 35%. Promo bundles can pull COGS up while revenue looks flat.
  • Forgetting inbound freight — “$12 product cost” that is really $15 landed is a 25% planning error on contribution.
  • Confusing gross margin with contribution — celebrating COGS wins while free shipping eats the gain. Read gross margin next to contribution, not instead of it.
  • Inventory write-downs ignored — dead stock that never sold does not hit COGS until you write it off or sell at clearance; cash left earlier.
  • Mixing accounting methods — FIFO vs weighted average changes period COGS when costs are rising; finance and growth must use the same method in meetings.

Worked ecommerce example

A skincare DTC brand sells two SKUs in one month. 2,400 orders, blended AOV $68. Revenue $163,200. Below is merchandise COGS only (landed, per unit sold).

SKUUnits soldRevenueLanded COGS / unitCOGS totalGross margin %
Hero serum (30ml)1,800$126,000$19.20$34,56072.6%
Travel refill600$37,200$14.80$8,88076.1%
Blended2,400$163,200—$43,44073.4%

Blended gross profit = $119,760. Sounds strong—until variable fulfillment: outbound shipping net of customer-paid ($6.20/order average) = $14,880; payment fees ~2.9% = $4,733; expected returns 7% of revenue with partial recovery = ~$6,100. Contribution before ads ≈ $94,047, or ~57.6% of revenue—not 73.4%. If they spent $52,000 on acquisition for 2,100 new customers, CAC ≈ $24.80 while contribution per order ≈ $39.19—payback looks fine on paper only if repeat purchase shows up.

A 4% COGS reduction on the hero serum (negotiated freight + packaging redesign) saves $0.77 per unit × 1,800 = $1,386/month in gross profit—more durable than a 10% off promo that also trains customers to wait for discounts. That is the kind of lever you model in product profitability analysis.

For many branded DTC categories, landed COGS often lands near 25–45% of retail price before outbound shipping—wide band; replace with your supplier invoices and freight bills.

Source: Growthegy operator practice; see product profitability and margin guides (2026)

How to read COGS in the Ecommerce Simulator

In the Ecommerce Simulator, product cost (COGS) is an input that flows into gross margin and then contribution. Practical rhythm:

  1. Set AOV and COGS % (or dollar COGS) to match your hero SKU landed cost, not list price fantasy.
  2. Add shipping, fees, and refund assumptions—the simulator separates merchandise margin from what is left after variable fulfillment.
  3. Run margin-first: lower COGS 3 points and read contribution per order and payback before you touch ad budget.
  4. Compare a “supplier MOQ discount” scenario (lower COGS, higher cash tied in inventory) against status quo—COGS wins on paper can lose on cash if inventory turns slow.

COGS is not a slider you optimize in isolation. Pair simulator output with supplier and inventory management so a cheaper unit does not become twelve weeks of the wrong SKU in the warehouse.

Related terms

Back to the ecommerce glossary. COGS is the merchandise truth layer—keep landed cost current, model SKU mix, and never confuse a strong gross margin slide with a store that pays back CAC.

Frequently asked questions

What is COGS in ecommerce?

COGS (cost of goods sold) is the direct cost of the products you sold in a period: what you paid suppliers, manufacturing, inbound freight, duty, and packaging tied to units that left inventory. Revenue minus COGS is gross profit.

What is the COGS formula?

Period COGS = Beginning inventory + Purchases (and production) − Ending inventory. Per-unit COGS for planning is often landed cost per SKU: product invoice + inbound shipping + duty + direct packaging, allocated per sellable unit.

What should ecommerce COGS include?

Include product invoice cost, inbound freight, customs/duty, direct materials and manufacturing labor for owned production, and packaging that ships with the unit. Exclude marketing, rent, warehouse salaries, outbound shipping to customers, and payment fees—those sit in other P&L lines or contribution margin.

How does COGS affect gross margin?

Gross margin % = (Revenue − COGS) ÷ Revenue. A 3-point COGS improvement on a $72 AOV product is $2.16 more gross profit per order before shipping and fees. COGS is the largest lever for merchandise margin but not the full unit economics story.

Is outbound shipping part of COGS?

Most DTC operators treat outbound shipping as a variable fulfillment cost below gross margin (in contribution margin). Some accountants capitalize inbound freight into inventory COGS. Pick one convention and keep it consistent across SKUs and months.

How often should I update COGS?

Update landed cost when supplier invoices, freight rates, or FX move—at minimum quarterly, monthly if you reorder fast-moving SKUs. Stale COGS makes gross margin look healthy while contribution and cash tell a different story.

Related articles

Ecommerce Simulator

Practice traffic, conversion, pricing, and cash in a turn-based model—no account required.

Play the Ecommerce Simulator →