How is cost of goods sold calculated?
Start with opening inventory
The value of stock on hand at the start of the year, which is last year's closing figure.
Add purchases and landed costs
Everything you paid to get products ready for sale during the year.
Subtract closing inventory
The cost of stock still on hand at year end, from a count or marketplace reports.
The result is cost of goods sold
Deducted from sales to arrive at gross profit.
What goes into inventory cost?
| Include in inventory cost | Expense separately |
|---|---|
| Product price paid to the supplier | Marketplace selling fees |
| Freight and shipping to your warehouse or the fulfillment center | Shipping to customers |
| Import duties and customs brokerage | Advertising |
| Prep, labeling and packaging needed before sale | Storage 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.
- IRS Publication 334: Tax Guide for Small Business
- IRS Publication 538: Accounting Periods and Methods
- IRS: About Schedule C (Form 1040)
- 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.
Related guides
More in Online sellers
This guide is general information. It is not tax or legal advice for your situation.