COGS Formula: How to Calculate Cost of Goods Sold | Inventory Hero
·5 min readAccounting
COGS Formula: How to Calculate Cost of Goods Sold
The COGS formula is beginning inventory plus purchases minus ending inventory. What counts, what does not, and a worked example for Amazon FBA sellers.
Cost of goods sold equals beginning inventory plus purchases minus ending inventory, all measured at cost. Beginning inventory is the value of stock you started the period with, purchases are what you added at landed cost, and ending inventory is what remains at period end. The result is the cost of the units that actually sold during the period, which flows to your profit and loss.
What is included in COGS for an Amazon seller?
COGS includes the direct cost of the units you sold: the landed product cost (factory price plus freight, duties, and inbound shipping). It excludes overhead like software, salaries, and rent, and it excludes unsold inventory, which stays on the balance sheet as an asset. Per-unit Amazon fees are sometimes tracked separately as selling costs rather than in COGS; be consistent about where you put them.
Andrew Erickson is the founder of Inventory Hero. He has spent years working with Amazon FBA sellers on demand forecasting, restock planning, and the cash flow side of running a private-label brand. Inventory Hero exists because every spreadsheet-based inventory system he tried eventually broke — usually right before Q4.
Per-unit COGS is the landed cost of that unit: the factory or manufacturing cost plus its share of freight, duties, and inbound shipping. When you have bought the same SKU at different costs, your valuation method (FIFO or weighted average) decides which cost applies to each unit sold. Per-unit COGS times units sold should reconcile to the period COGS from the formula.
Read article
The COGS formula is beginning inventory plus purchases minus ending inventory, all measured at cost. The short version: it gives you the cost of the units that actually sold in a period, it counts only direct product cost (not overhead or unsold stock), and for Amazon sellers the cost to use is landed cost, not the bare invoice. This is a practical overview, not tax advice. Below is the formula, what counts, and a worked example.
Subtracting what is left from what you had plus what you added leaves what sold, which is exactly COGS. It is the same identity that ties inventory accounting together.
Say for a quarter you start with 20,000 dollars of inventory, buy 50,000 dollars more, and finish with 25,000 dollars on hand:
COGS = 20,000 + 50,000 - 25,000 = 45,000
Your COGS for the quarter is 45,000 dollars. If your sales for the quarter were 90,000 dollars, your gross profit is 90,000 minus 45,000, or 45,000 dollars, a 50 percent gross margin. Notice the 50,000 dollars you spent on purchases is not your COGS: of the 70,000 dollars of inventory available (20,000 beginning plus 50,000 purchased), only 45,000 sold, and the remaining 25,000 sits in ending inventory as an asset.
In COGS: the landed cost of units sold, factory price plus freight, duties, and inbound shipping.
Not in COGS: overhead like software, salaries, rent, and general marketing; those are operating expenses below gross profit.
Not in COGS: unsold inventory, which stays on the balance sheet until it sells.
A judgment call: per-unit Amazon fees (referral, fulfillment). If you fold them into COGS, your gross margin effectively becomes a contribution margin, handy for per-SKU decisions but no longer comparable to a standard benchmark gross margin. If you keep them in a separate selling-costs line below gross profit, gross margin stays standard and you read per-unit profitability underneath it. For most FBA sellers the cleaner choice is to keep Amazon fees out of COGS in their own line, so gross margin means the same thing it does everywhere else; whichever you pick, be consistent.
Getting the boundary right is what keeps your gross margin meaningful, mixing overhead into COGS makes healthy products look weak.
The period formula gives the total; per-unit COGS is the landed cost of each unit sold. Concretely, a unit with an 8.00 dollar factory price, 0.60 in freight, and 0.20 in duty has a landed COGS of 8.80 dollars, not the 8.00 on the invoice; the landed cost calculator builds that number for you. Using the bare 8.00 invoice would understate COGS by 0.80 a unit and overstate your profit by the same amount on every sale. When you have bought the same SKU at different costs over time, your valuation method, FIFO or weighted average, decides which cost applies to each sale. As a check, per-unit COGS times units sold should reconcile to the period COGS from the formula; if they diverge, your valuation or your ending inventory is off.
This per-unit view is what you actually manage on: knowing a SKU's true landed COGS is what lets you price it, judge its margin, and decide whether it is worth reordering.
There are two ways COGS actually gets computed, and they should agree:
The period formula (beginning plus purchases minus ending) computes COGS once at period close, from your inventory values. It is simple but only as current as your last count.
Perpetual COGS records each unit's cost to COGS at the moment it sells, so you have a running figure any day. This needs a system that carries cost per unit, which is why most FBA sellers, moving high volume, run perpetual.
They are two routes to the same number: run perpetually through the period, then reconcile to the formula at close using a physical count. If the two disagree, the gap is shrinkage or an error, real information you want to catch. Managing on perpetual COGS also means you can see a SKU's margin today instead of waiting for quarter-end, which is the difference between reacting and planning.
The formula leans entirely on an accurate ending inventory, because that is the term you measure rather than derive:
Overstate ending inventory and COGS comes out too low, inflating profit and your tax bill.
Understate ending inventory and COGS comes out too high, understating profit.
Either error flows dollar for dollar into your bottom line, which is why a real physical count and reconciliation matter. For FBA, your unit count comes from the Manage FBA Inventory or Inventory Ledger report in Seller Central, valued at landed cost. The formula is simple; the discipline is in the inputs. See calculating ending inventory for that half of the work.
The COGS formula is beginning inventory plus purchases minus ending inventory, giving the direct cost of what sold, at landed cost, excluding overhead and unsold stock. It drives your gross profit and taxable income, so its accuracy rides on an accurate ending inventory and a consistent valuation method. Compute it every close, reconcile per-unit to period, and keep the boundaries clean. For the wider system, see Amazon seller accounting and inventory accounting.