How To Calculate COGS For Online Stores: Methods, Examples And Inventory Accounting
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. Calculating COGS accurately requires consistent inventory valuation, careful capture of landed costs, and clear treatment of production-related expenses so the cost matched to sales reflects the true expense of goods sold.
Start with the fundamental equation: Beginning Inventory + Purchases (plus capitalizable costs) - Ending Inventory = COGS. The details of what qualifies as a purchase and how ending inventory is valued — FIFO, LIFO, or weighted average — determine the numeric result and its business implications.
Step-By-Step Calculation For A Typical Online Retailer
Follow these operational steps to compute COGS for a reporting period:
- Step 1 — Record Beginning Inventory: Use the ending inventory value from the previous period as your beginning inventory.
- Step 2 — Capture Purchases: Sum supplier invoices for stock purchased during the period, and add capitalizable landed costs such as inbound freight and import duties.
- Step 3 — Adjust For Returns And Credits: Subtract purchase returns, allowances, and discounts that reduce the net purchase cost.
- Step 4 — Count Ending Inventory: Perform a physical count or cycle counts and value ending inventory using the selected valuation method.
- Step 5 — Apply Formula: Plug values into Beginning Inventory + Net Purchases - Ending Inventory = COGS.
Example Calculation
Example numbers: Beginning inventory $10,000. Purchases $40,000. Inbound freight $1,500. Import duties $500. Purchase discounts $1,000. Ending inventory $12,000.
Net purchases = $40,000 + $1,500 + $500 - $1,000 = $41,000. COGS = $10,000 + $41,000 - $12,000 = $39,000. That $39,000 is the cost matched to sales during the period.
Valuation Methods And Practical Effects
Choose a valuation method with understanding of operational and tax consequences. FIFO often mirrors physical flow for many merchants and yields higher reported profit in inflationary periods. Weighted average dampens volatility and is easy to automate. LIFO may lower taxable income in rising-cost environments but has compliance limits and is less common in eCommerce.
Handling Returns, Damaged Goods, And Shrinkage
Shelve rules for returns: Returned items that are resellable return to inventory at their cost and reduce COGS through inventory adjustments when processed. Damaged or obsolete stock should be written down; that write-down is typically recorded as part of COGS or as a separate inventory obsolescence expense depending on policy. Shrinkage discovered during counts is charged to COGS or an inventory variance account to preserve matching.
Systems And Data To Support Accurate COGS
- Label: Use an integrated WMS or inventory module that stores per-SKU landed cost components and updates inventory valuation automatically on receipts and returns.
- Label: Configure your ERP or accounting system to post inventory and COGS journal entries when goods are shipped or sold, not when purchased.
- Label: Reconcile inventory GL accounts monthly to physical counts and correct discrepancies promptly to avoid mis-stated COGS.
When To Consult Accounting Or Tax Professionals
Large merchants, those with manufacturing, or businesses using complex transfer pricing and multiple warehouses should involve accountants when designing capitalization policies, selecting valuation methods, and interpreting tax rules. U.S. tax law contains specific rules on inventory capitalization and valuation that can materially change tax outcomes.
In short, the COGS calculation starts with beginning inventory, adds net purchases and capitalizable costs, then subtracts ending inventory. Consistent valuation, accurate landed-cost capture, and strong operational controls ensure COGS reflects the true expense of goods sold and supports reliable margin analysis.
Sources And Additional Reading (3)
- Cost of Goods Sold
“Cost of Goods Sold.” IRS, https://www.irs.gov/businesses/small-businesses-self-employed/cost-of-goods-sold.
- Cost Of Goods Sold (COGS)
“Cost Of Goods Sold (COGS).” Investopedia, https://www.investopedia.com/terms/c/cogs.asp.
- Financial Accounting Standards Board (FASB) — Home
“Financial Accounting Standards Board (FASB) — Home.” FASB, https://www.fasb.org/.
More from this term
Looking for a 3PL?
Compare warehouses on Racklify and find the right logistics partner for your business.