On this page
What is COGS, and how do you calculate it?
Cost of goods sold — September
| Beginning inventory | 52,300.00 |
|---|---|
| Purchases, incl. inbound freight & duty | 24,890.40 |
| Goods available for sale | 77,190.40 |
| Ending inventory | (54,000.00) |
| Cost of goods sold | 23,190.40 |
| = 36.0% of net sales 64,490.00 | |
SAMPLE · DEMO STORE · NOT A CLIENT
Cost of goods sold (COGS) is what the products you sold in a period cost you to buy and get ready to sell. It is matched against the sales of those same products, so it changes with what went out the door, not with what you paid suppliers that month. The IRS puts it simply: if you make or buy goods to sell, you deduct the cost of goods sold from your gross receipts on Schedule C.[1] For an online store, that means the landed cost of every unit shipped to a customer, from every channel and every warehouse.
The cost of goods sold equation is: beginning inventory + purchases − ending inventory = COGS. Start with what was on the shelf when the month opened. Add everything you bought to sell. That total is what you could have sold. Take away what is still on hand at month end, and what is left is the cost of what actually went out the door.
The IRS sets out the same steps for the year on Schedule C, lines 35 to 42: beginning inventory, purchases, labor, materials and supplies, other costs, then ending inventory subtracted.[1] On Schedule C, freight-in is listed under line 39, other costs; either way it is part of cost of goods sold.[1] Treasury regulations add to the invoice price "transportation or other necessary charges incurred in acquiring possession of the goods"; we treat import duty, which has to be paid before you can take the goods, as one of those charges.[2] We run the formula every month, so margin is known month by month and not only at year end.
What counts in COGS for an online seller
Costs of getting a product ready to sell go into COGS. Costs of selling it, once it is ready, sit below gross profit as operating expenses.
| Cost | Where it goes |
|---|---|
| Product cost from your supplier | COGS |
| Inbound freight to your warehouse, a 3PL or a fulfillment center | COGS[1] |
| Import duty | COGS, as a charge of acquiring the goods[2] |
| Packaging that is part of the product | COGS[1] |
| Shipping boxes and mailers that are not part of the product | Shipping or selling expense[1] |
| Shipping to the customer | Selling expense |
| Marketplace referral and fulfillment fees, payment processing | Selling expense |
| Advertising, software and subscriptions | Operating expense[1] |
Where marketplace fulfillment fees belong is a judgment call that sellers make differently. Our books keep them below gross profit, with the other marketplace fees, so gross margin shows product economics and the fee line shows channel economics. Whichever you choose, use it every month. One more rule from the IRS: stock you take for personal or family use comes out of purchases, not into COGS.[1]
Why it goes wrong for sellers
The formula is simple. Seller books break it in four predictable places.
- 01
Purchases booked straight to COGS
A supplier payment goes to cost of goods sold the day it's paid, so any month you restock looks worse than it was and any month you sell down looks better.
- 02
Stock at Amazon never counted
Units in fulfillment centers are still yours. Leave them out of ending inventory and cost of goods sold is overstated by exactly their cost.
- 03
Freight and duty left out of product cost
When inbound freight sits in a general shipping expense, cost of goods sold looks lower and gross margin looks higher than it is.
- 04
Returns that never go back into stock
A returned unit that is put back on sale is inventory again. Book the refund but not the unit, and cost of goods sold stays too high.
What it costs to get wrong
Every one of those errors moves gross margin by the change in inventory. In our demo store, stock grew by 1,700.00 in September. Book purchases as COGS and that 1,700.00 disappears from profit.
| Line | Counted properly | Purchases booked as COGS |
|---|---|---|
| Cost of goods sold | 23,190.40 | 24,890.40 |
| Gross profit | 31,425.45 | 29,725.45 |
| Gross margin | 48.7% | 46.1% |
| Difference | 1,700.00 · 2.6 pts |
SAMPLE · DEMO STORE · NOT A CLIENT · gross profit after marketplace fees of 9,874.15
One month, a 2.6-point swing. The error flips direction every time you restock or sell down, so the margin you price and reorder on is not the margin you earn. It also reaches your tax preparer: the year-end inventory figure feeds Schedule C line 41.[1]
Gross margin vs net margin
Gross margin is net sales minus cost of goods sold, as a share of net sales; the IRS calls the dollar figure gross profit.[1] Net margin is what is left after every other cost as well: marketplace fees, advertising, software, wages, rent, interest and tax. Gross margin tells you whether the product makes money; net margin tells you whether the business does.
| Line | USD | % of net sales |
|---|---|---|
| Net sales | 64,490.00 | 100.0% |
| Cost of goods sold | (23,190.40) | 36.0% |
| Gross profit | 41,299.60 | 64.0% |
| Marketplace fees | (9,874.15) | 15.3% |
| Gross profit after marketplace fees | 31,425.45 | 48.7% |
SAMPLE · DEMO STORE · NOT A CLIENT
Net margin comes from taking the store's remaining operating costs off that 31,425.45. To see the same split on a single product, try the marketplace profit calculator.
When to get help
If your margin swings month to month without a reason you can name, or you have never counted the stock at Amazon, the formula is fine and the inputs are the problem. That is the work our monthly e-commerce bookkeeping does every month: purchases into inventory, every location counted, landed cost on every unit, and cost of goods sold that ties to the stock you hold.
Publication 334 also lets a business that qualifies as a small business taxpayer (average annual gross receipts over the 3 prior tax years of $31 million or less for tax years beginning in 2025, or $32 million for 2026, and not a tax shelter)[3] choose not to keep an inventory, using a method that still clearly reflects income.[1] Which method suits your return is a question for your tax preparer. Either way, books that track inventory give them the numbers to decide with.
[[FILL]]
Reviewed [[FILL: date]] by [[FILL: reviewer name]], [[FILL: credential, exactly as held]]
Written by [[FILL: author name]], e-commerce bookkeeper
Last updated [[FILL: date]] · Re-checked: yearly, or when a source changes
Sources
- Publication 334 (2025), Tax Guide for Small Business — How To Figure Cost of Goods Sold; Inventories · Internal Revenue Service fetched 7 Oct 2026
- 26 CFR 1.471-3(b), Inventories at cost (eCFR) fetched 7 Oct 2026
- Rev. Proc. 2025-32 (2026 inflation adjustments), §448(c) gross receipts test fetched 7 Oct 2026
- Publication 538 (01/2022), Accounting Periods and Methods — Inventories · Internal Revenue Service fetched 7 Oct 2026
General information about bookkeeping, not tax or legal advice for your situation.
How this answer was written, sourced and reviewed: editorial policy.