Advertisement
COGS Calculation: Complete Formula for Online Sellers | What is COGS?
Seller Bookkeeping

COGS Calculation: Complete Formula for Online Sellers

What is COGS? - Cost of Goods Sold is the direct cost of products you sell

Advertisement

Understanding Cost of Goods Sold (COGS)

COGS (Cost of Goods Sold) is the direct cost of the products you sell, excluding indirect expenses like rent, utilities, advertising, or salaries. For online sellers, COGS is the most critical accounting metric because it directly impacts profitability calculations, tax reporting, and pricing decisions. Yet many sellers underestimate or miscalculate COGS by forgetting hidden costs like inbound shipping, packaging, duties, or prep labor. This guide covers the exact COGS formula, what to include and exclude, calculation methods, and real-world examples so you can calculate accurate COGS for your business.

Understanding COGS enables accurate profit calculations, tax compliance, and better business decisions. Sellers who know their true COGS price products correctly, identify unprofitable SKUs, and report accurate income to tax authorities. Those who ignore COGS often underprice products, accidentally operate at losses, and face audit risk from misreported income. This comprehensive guide provides everything needed for accurate COGS accounting.

Key Insight: Most online sellers discover their true COGS is 20-40% higher than they initially calculated, primarily from forgotten inbound shipping, packaging, duties, and prep costs. Accurate COGS immediately improves profitability visibility and pricing accuracy.

The Core COGS Formula

COGS = Beginning Inventory + Purchases − Ending Inventory

This fundamental formula applies to all businesses using periodic inventory accounting. Let's break down each component:

Beginning Inventory

The value of unsold inventory at the start of your accounting period (month, quarter, or year). This equals the ending inventory from the previous period. For example, if you ended December with $10,000 in inventory, that's your January beginning inventory.

Purchases

The total cost of all inventory purchased during the accounting period, INCLUDING all acquisition costs: product cost, inbound shipping, tariffs/duties, packaging materials, labeling, and any direct labor for product preparation. This is often where sellers make mistakes by including only the supplier invoice price and forgetting freight and other costs.

Ending Inventory

The value of unsold inventory remaining at the end of your accounting period. Determine this through physical inventory count or perpetual inventory system records. This must be valued using a consistent method (FIFO, LIFO, or weighted average).

What to Include in COGS

Cost CategoryInclude in COGS?ExamplesWhy It Matters
Product Purchase PriceYES$5 unit cost from supplierFoundational COGS component
Inbound ShippingYESInternational freight, UPS to warehouseOften 15-30% of product cost
Tariffs & DutiesYESImport tax on products from ChinaCan add 5-25% to total cost
Packaging MaterialsYESBoxes, tissue, fillers, labels$0.50-3.00 per unit typically
Product LabelingYESCustom labels, price tags, barcode stickersOften overlooked, adds 5-20¢/unit
Direct LaborYES (if applicable)Time spent assembling or preparing productsOnly if you manufacture, not standard
Product Prep ServicesYESThird-party labeling, kitting, bundlingDirect product-related expense
FOB Cost (Landed Cost)YESAll above combined = your true unit costUse this for pricing and profitability

What NOT to Include in COGS

Critical to accurate accounting: these expenses are NOT COGS and should never be included in the COGS formula:

  • Advertising & Marketing: Google Ads, Facebook ads, sponsored products. These are operating expenses, not COGS.
  • Rent & Utilities: Warehouse rent, office electricity, internet. These are operating expenses.
  • Salaries & Wages: Employee salaries (unless directly manufacturing the product, which is rare for online sellers). This is an operating expense.
  • Office Supplies: Printer paper, pens, desk supplies. This is an operating expense.
  • Software & Tools: Accounting software, spreadsheet tools, apps. These are operating expenses.
  • Shipping to Customers: Postage or UPS to send products to buyers. This is a fulfillment cost, not COGS.
  • Platform Fees: Amazon referral fees, Shopify transaction fees, eBay fees. These are operating expenses (or cost of sales, depending on accounting method).
  • Professional Services: Accounting, legal, consulting fees. These are operating expenses.
  • Equipment & Furniture: Desks, computers, machinery (unless manufacturing product). These are capital/asset accounts, not COGS.

Step-by-Step COGS Calculation Example

Scenario: Ecommerce seller with product inventory for Q3 2025.

Step 1: Determine Beginning Inventory (July 1, 2025)

Value of unsold inventory at period start: $50,000

Step 2: Calculate Total Purchases During Q3

  • Product purchases: $120,000
  • Inbound shipping: $15,000
  • Tariffs: $8,000
  • Packaging materials: $12,000
  • Labeling services: $3,000
  • Total Purchases: $158,000

Step 3: Determine Ending Inventory (September 30, 2025)

Physical inventory count valued at cost: $45,000

Step 4: Apply COGS Formula

COGS = $50,000 + $158,000 − $45,000 = $163,000

Q3 COGS is $163,000. This represents the cost of inventory that was sold during Q3.

Inventory Valuation Methods

When you receive multiple shipments at different prices, how do you value inventory and COGS? Choose from these methods:

MethodHow It WorksBest ForTax Impact
FIFO
(First In, First Out)
Oldest inventory sells first. COGS reflects older (lower) prices.Rising prices, want to minimize COGSHigher profit reported, more taxes owed
LIFO
(Last In, First Out)
Newest inventory sells first. COGS reflects newer (higher) prices.Rising prices, want to maximize COGS (reduce taxes)Lower profit reported, fewer taxes owed
Weighted Average CostAverage cost across all units in inventory. Simple to calculate.Most common for online sellers, smooths price fluctuationsMiddle-ground profit and taxes
Specific IdentificationTrack actual cost of specific units sold.High-value items where you track individual unit costsMost accurate but complex

Choose one method and stick with it. Changing methods mid-year complicates accounting and may trigger IRS questions. Most online sellers use weighted average or FIFO.

Per-Unit COGS Calculation

For profitability analysis, calculate COGS per individual unit sold:

COGS Per Unit = Landed Cost Per Unit

Landed cost per unit = (Product cost + inbound shipping + tariffs + packaging + labeling) ÷ units received

Example: 1,000 units purchased at $8/unit = $8,000. Inbound shipping = $1,000. Tariff = $500. Packaging = $1,000. Total landed cost = $10,500. Cost per unit = $10.50.

Use per-unit COGS for pricing decisions, profitability analysis, and product-level reporting. See our complete COGS guide for detailed per-unit calculations.

Common COGS Mistakes

Using FOB price instead of landed cost: FOB (Free on Board) is just the supplier's price, not your true COGS. Landed cost (including shipping, tariffs, packaging) is what actually matters for profitability. Ignoring this 15-35% gap means underpricing products.

Forgetting inbound freight and tariffs: International shipping and import duties can add 20-30% to your product cost. If you're buying from China, Brazil, or India, these costs are substantial and must be included in COGS.

Including operating expenses in COGS: Advertising, rent, utilities, salaries, and platform fees are operating expenses, not COGS. Mixing them inflates COGS and distorts profitability reporting.

Not tracking inventory consistently: If you don't count ending inventory accurately, your COGS calculation is wrong. Use perpetual inventory systems (software) or conduct physical counts quarterly.

Changing inventory valuation methods mid-year: Switching from FIFO to weighted average mid-year creates accounting chaos and IRS questions. Choose a method at year-start and stick with it.

Tools for COGS Calculation

Spreadsheets (Excel, Google Sheets): Manual calculation using the formula. Free but time-consuming and error-prone.

Accounting Software (QuickBooks, Xero, Freshbooks): Automatically calculate COGS from inventory and purchase data. Integrates with banks and platforms. Best for most sellers ($15-100/month).

Inventory Management Systems (TrackStock, Finale, Cin7): Specialized inventory tracking. Calculate COGS in real-time as inventory moves. Best for high-volume sellers ($50-300/month).

Our Free COGS Calculator: Use our COGS calculator for quick calculations or to verify your manual calculations.

Using COGS for Pricing and Profitability

Once you know accurate COGS, calculate gross profit margin:

Gross Profit = Revenue − COGS
Gross Profit Margin % = (Revenue − COGS) ÷ Revenue

For example: If you sell a product for $50 and COGS is $15, gross profit is $35 and gross margin is 70%. After operating expenses (fees, ads, rent, etc.), your net profit will be lower. See our Amazon profitability guide for complete profitability calculations.

COGS Calculation Facts

20-40%

Typical COGS underestimation due to forgotten costs

7

Major components in complete COGS per unit

4

Inventory valuation methods (FIFO, LIFO, WAC, SI)

15-30%

Typical inbound shipping as percentage of COGS

Quarterly

Recommended inventory count frequency

One

Inventory method must be chosen yearly and consistent

Frequently Asked Questions About COGS

What's the difference between COGS and cost of sales?

COGS is the direct cost of products you sell (materials, labor, shipping to warehouse). Cost of sales includes COGS plus platform fees and fulfillment costs. For accounting purposes, COGS and cost of sales are often used interchangeably, but technically cost of sales is broader. Use COGS for accounting/tax; use "all-in cost" or "cost of sale" when calculating true product profitability including fees.

Should advertising be included in COGS?

No. Advertising is an operating expense, not COGS. COGS is only the direct cost of producing/acquiring the product. Advertising is separate. However, when calculating true profitability per product, allocate advertising spend to that product. For tax purposes, advertising is deductible as an operating expense, separate from COGS.

How do I count ending inventory accurately?

Physical count (count all units you have on hand) or perpetual inventory system (software that tracks inventory movements in real-time). For small businesses: quarterly physical counts. For larger businesses: perpetual system with monthly or quarterly reconciliation to physical counts. Value ending inventory at cost (using FIFO, LIFO, or weighted average method).

Is inbound shipping part of COGS?

Yes, absolutely. Inbound shipping (freight from supplier to your warehouse) is part of landed cost and must be included in COGS. This is where most sellers make mistakes. Shipping can add 15-30% to your product cost. Include international ocean freight, air freight, trucking to warehouse, and any pickup fees. Don't include shipping to customers—that's a fulfillment expense.

What's the difference between FIFO and weighted average?

FIFO: oldest (cheapest) inventory sells first, so COGS is lower and profit higher. Weighted average: you calculate the average cost of all inventory and use that for COGS. In rising-price environments, FIFO results in higher profit; weighted average is in between. Most online sellers use weighted average because it's simpler and smooths out price volatility. Choose one method and stick with it all year.

Should I include packaging in COGS?

Yes. Packaging materials (boxes, tissue, fillers, labels) used to package products for sale are part of COGS. Calculate packaging cost per unit: total packaging spend ÷ units packaged. Even $0.50/unit packaging adds up quickly across thousands of units. Don't include packaging for customer shipments beyond the product packaging—that's fulfillment cost.

What about tariffs and import duties?

Include import tariffs and duties in landed cost/COGS. When importing from China, India, or elsewhere, customs duties are a real cost. Allocate total tariffs across the shipment: total duties ÷ units = tariff per unit. For example: $2,000 tariff ÷ 1,000 units = $2/unit in tariff cost. This is especially critical for products with high tariff rates (electronics, textiles, etc.).

How often should I update my COGS?

Calculate COGS monthly for financial statements and profitability tracking. When supplier prices change or you receive new shipments at different costs, recalculate COGS using the same valuation method. For tax purposes, calculate COGS annually for year-end financial statements and tax return. More frequent updates (monthly) help you catch pricing issues and optimize profitability.