Racklipedia
Racklify
​
Fulfillment

What Is COGS? How Cost of Goods Sold Works For eCommerce Merchants

Updated September 25, 2026
Published September 25, 2026
William Carlin

COGS

Definition

Cost of goods sold (COGS) is the direct cost of producing the products a business sells, including materials, direct labor, and manufacturing overhead. It is deducted from revenue to calculate gross profit and supports inventory valuation and profitability analysis.

Overview

COGS is the abbreviation for Cost of Goods Sold. For eCommerce merchants, COGS measures the direct costs tied to producing or acquiring the items a store sells during a reporting period — the inventory costs that are expensed when a sale is recorded rather than when the cost is incurred.


Understanding COGS matters because it determines gross profit, tax liability, and pricing decisions. For an online store that buys finished goods from suppliers, COGS commonly includes purchase price, inbound freight, customs duties, and per-unit packaging used to deliver sellable inventory. For merchants manufacturing goods, COGS also includes direct labor and factory overhead allocated to the units sold.


What COGS Typically Includes


COGS captures costs that are directly attributable to making a product available for sale. Items normally included are:

  • Purchase Cost: The invoice cost of goods bought for resale, net of trade discounts.
  • Inbound Freight: Shipping charges to bring inventory to the warehouse when the merchant bears the cost.
  • Duties And Taxes: Import duties, customs fees, and non-recoverable taxes applied to imported inventory.
  • Direct Manufacturing Costs: For produced goods, raw materials and direct labor assigned to units sold.
  • Inventory Adjustments: Write-downs for obsolescence or shrinkage directly tied to inventory's cost basis.


What COGS Does Not Include


COGS excludes operating and overhead costs that are not incurred to produce or purchase the item. Common exclusions are:

  • Fulfillment And Shipping To Customer: Outbound shipping costs billed to deliver the product to the buyer (these are typically recorded as fulfillment or shipping expense).
  • Marketing And Advertising: Customer acquisition costs like paid ads and promotions.
  • General Overhead: Rent for non-manufacturing offices, administrative salaries, and software subscriptions unless directly tied to production.


Why COGS Matters For eCommerce


COGS is the first deduction from sales revenue and directly sets gross profit. Gross profit margin informs pricing, inventory purchasing cadence, and whether SKUs are profitable after accounting for marketing and fulfillment. Banks and investors use gross margin trends to assess business health. For tax reporting, proper COGS calculation can reduce taxable income in periods when inventory is matched correctly to sales.


How Merchants Calculate COGS


The standard formula is simple: Beginning Inventory + Purchases During Period - Ending Inventory = COGS. The complexity comes from how inventory and purchases are valued and which accounting method is used (FIFO, LIFO where permitted, or weighted average).

  • Beginning Inventory: Value of inventory on hand at the start of the reporting period.
  • Purchases: Net additions to inventory (invoices, inbound freight, import duties) during the period.
  • Ending Inventory: Value of inventory on hand at period end, calculated using the chosen valuation method.


Inventory Valuation Methods And Their Impact


Choice of valuation method affects COGS and profit. Common methods:

  • FIFO (First-In, First-Out): Assumes oldest inventory is sold first. In rising-cost environments FIFO typically shows lower COGS and higher profits.
  • LIFO (Last-In, First-Out): Assumes newest inventory is sold first; not permitted under IFRS and restricted under some tax regimes. LIFO can increase COGS when costs rise, lowering taxable income (U.S. tax rules apply specific conditions).
  • Weighted Average: Smooths cost fluctuations by averaging unit costs across the period.


Practical Example For An Online Merchandiser


A merchant begins the month with $20,000 of inventory. During the month they purchase $50,000 of stock and pay $2,000 in inbound freight and $1,000 in import duties. Ending inventory counted at period end is $18,000.


Using the formula: $20,000 + ($50,000 + $2,000 + $1,000) - $18,000 = $55,000 COGS. That $55,000 is the expense matched to sales for the period and will be subtracted from revenue to compute gross profit.


Operational Tips For Accurate COGS


  • Label: Reconcile inventory counts monthly — cycle counts reduce unexpected write-downs that distort COGS.
  • Label: Track landed cost per SKU in your inventory system to ensure inbound freight and duties are capitalized correctly into inventory value.
  • Label: Use consistent valuation methods and document the policy in your accounting manual; changes require disclosure and can affect comparability.
  • Label: Coordinate WMS and accounting systems so purchase receipts, returns, and shrinkage flow automatically into inventory accounts.


Tax And Reporting Considerations In The United States


For U.S. federal income tax, rules govern which costs may be included in inventory and how inventory is valued. Small businesses may use simplified methods in certain circumstances, but the IRS expects consistency and adequate records. Because COGS affects taxable income, merchants often consult accountants or tax advisors when choosing valuation and capitalization policies.


In short, the COGS line item measures the direct costs tied to goods sold and is central to margin analysis, pricing, and tax reporting. Merchants who track landed costs, choose a consistent inventory valuation method, and reconcile stock regularly will report more accurate COGS and clearer gross-profit metrics.

Sources And Additional Reading (3)

More from this term
Looking for a 3PL?

Compare warehouses on Racklify and find the right logistics partner for your business.