Inventory and cost of goods sold for online sellers

For product sellers, cost of goods sold is usually the largest number on the tax return, and the easiest to get wrong. This guide explains the formula, what belongs in inventory cost, and how to handle lost, damaged and reimbursed stock.

By Hamza Fida, Chartered Accountant. Reviewed by Awais Jameel, Chartered Accountant. Checked against official sources on . 2 minute read.

Short answer

Cost of goods sold for ecommerce is the cost of the items you actually sold in the year: opening inventory plus purchases and landed costs, minus closing inventory. Inventory cost includes the product price, inbound freight, duties and prep. Stock still unsold at year end is an asset, not an expense, and is deducted when it sells.

At a glance

Formula
Opening inventory + purchases - closing inventory
Landed cost
Product price, inbound freight, duties, prep
Unsold stock at year end
An asset, not a deduction
Common method
First in, first out
Lost or damaged stock
Written off, less any reimbursement
Where reported
Schedule C Part III, or Form 1125-A
Inventory and cost of goods sold for online sellersSteps: 1. Start with opening inventory; 2. Add purchases and landed costs; 3. Subtract closing inventory; 4. The result is cost of goods sold.THE PROCESS AT A GLANCEInventory and cost of goods sold for onlinesellers1Start with openinginventoryThe value of stock on hand atthe start of the year, whichis last year's closing figure2Add purchases andlanded costsEverything you paid to getproducts ready for saleduring the year3Subtract closinginventoryThe cost of stock still onhand at year end, from acount or marketplace reports4The result is cost ofgoods soldDeducted from sales to arriveat gross profitChecked against official sourcesTax BakersInventory and cost of goods sold for online sellersSteps: 1. Start with opening inventory; 2. Add purchases and landed costs; 3. Subtract closing inventory; 4. The result is cost of goods sold.THE PROCESS AT A GLANCEInventory and cost of goods soldfor online sellers1Start with opening inventoryThe value of stock on hand at the start ofthe year, which is last year's closingfigure2Add purchases and landed costsEverything you paid to get products readyfor sale during the year3Subtract closing inventoryThe cost of stock still on hand at year end,from a count or marketplace reports4The result is cost of goods soldDeducted from sales to arrive at grossprofitChecked against official sourcesTax Bakers
The process at a glance: 1. Start with opening inventory; 2. Add purchases and landed costs; 3. Subtract closing inventory; 4. The result is cost of goods sold.

How is cost of goods sold calculated?

  1. Start with opening inventory

    The value of stock on hand at the start of the year, which is last year's closing figure.

  2. Add purchases and landed costs

    Everything you paid to get products ready for sale during the year.

  3. Subtract closing inventory

    The cost of stock still on hand at year end, from a count or marketplace reports.

  4. The result is cost of goods sold

    Deducted from sales to arrive at gross profit.

What goes into inventory cost?

Include in inventory costExpense separately
Product price paid to the supplierMarketplace selling fees
Freight and shipping to your warehouse or the fulfillment centerShipping to customers
Import duties and customs brokerageAdvertising
Prep, labeling and packaging needed before saleStorage fees after goods are ready

Dividing the total landed cost of a shipment by the units in it gives a cost per unit, which is the number you need for every sale.

See import duties for e-commerce sellers for the customs side.

Which inventory method should you use?

First in, first out assumes the oldest units are sold first, which matches how most sellers actually ship stock and is simplest to support. Specific identification tracks each unit's actual cost and suits high-value items. Other methods exist but need more work. Use one method consistently. Small businesses that meet the IRS gross receipts test have simplified options for inventory, including following the method used in their books.

How do you count closing inventory?

Count stock you hold yourself at year end. For stock at a marketplace fulfillment center, use its inventory reports as of December 31, and include units in transit that you own. Value everything at cost, not at selling price.

What about lost, damaged and reimbursed stock?

  • Lost or damaged units leave inventory and their cost is written off.
  • Reimbursements from the marketplace for lost or damaged units are income, or reduce the write-off.
  • Returned units that can be resold go back into inventory; unsellable returns are written off.
  • Obsolete stock can be written down when it is disposed of or sold for less.

Where does it go on the return?

Sole proprietors and single-member LLCs use Part III of Schedule C. Partnerships and corporations use Form 1125-A. See Schedule C and Amazon FBA taxes.

For dropshipping and print on demand, see dropshipping profit tracking.

Want your inventory accounting right?

We build your landed cost per unit, reconcile stock counts to marketplace reports, and calculate cost of goods sold for your return.

Questions people ask

How do I calculate cost of goods sold for an online store?

Opening inventory, plus purchases and landed costs, minus closing inventory at cost.

Is inventory deductible when I buy it?

No. It is deducted as cost of goods sold when it is sold. Unsold stock at year end is an asset.

Is inbound shipping part of cost of goods sold?

Yes. Freight to your warehouse or the fulfillment center is part of inventory cost. Shipping to customers is a separate expense.

How do I treat Amazon reimbursements for lost inventory?

The lost units leave inventory and their cost is written off, and the reimbursement is income or reduces the write-off.

Sources

Every fee, date and rule on this page was taken from these official and primary sources.

  1. IRS Publication 334: Tax Guide for Small Business
  2. IRS Publication 538: Accounting Periods and Methods
  3. IRS: About Schedule C (Form 1040)
  4. IRS: Form 1125-A, Cost of Goods Sold

Rules and fees change. If you are reading this long after September 30, 2026, confirm the figures with the source before you rely on them.

More in Online sellers

This guide is general information. It is not tax or legal advice for your situation.