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.
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 Category | Include in COGS? | Examples | Why It Matters |
|---|---|---|---|
| Product Purchase Price | YES | $5 unit cost from supplier | Foundational COGS component |
| Inbound Shipping | YES | International freight, UPS to warehouse | Often 15-30% of product cost |
| Tariffs & Duties | YES | Import tax on products from China | Can add 5-25% to total cost |
| Packaging Materials | YES | Boxes, tissue, fillers, labels | $0.50-3.00 per unit typically |
| Product Labeling | YES | Custom labels, price tags, barcode stickers | Often overlooked, adds 5-20¢/unit |
| Direct Labor | YES (if applicable) | Time spent assembling or preparing products | Only if you manufacture, not standard |
| Product Prep Services | YES | Third-party labeling, kitting, bundling | Direct product-related expense |
| FOB Cost (Landed Cost) | YES | All above combined = your true unit cost | Use 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:
| Method | How It Works | Best For | Tax Impact |
|---|---|---|---|
| FIFO (First In, First Out) | Oldest inventory sells first. COGS reflects older (lower) prices. | Rising prices, want to minimize COGS | Higher 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 Cost | Average cost across all units in inventory. Simple to calculate. | Most common for online sellers, smooths price fluctuations | Middle-ground profit and taxes |
| Specific Identification | Track actual cost of specific units sold. | High-value items where you track individual unit costs | Most 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.