Learn · COGS & inventory
How do you find cost of goods sold (COGS)?
Short answer
Find cost of goods sold with this formula: COGS = beginning inventory + purchases during the period - ending inventory. It captures only the cost of the units you actually sold, including landed cost (product cost plus inbound freight, duties, and prep), not your unsold stock.
Key takeaways
- •Marketplace fees, FBA fulfillment, storage, and advertising stay out of COGS because they are selling expenses that sit below the gross margin line.
- •The periodic method reveals COGS only at period end, while perpetual tracking posts each unit's cost as it sells and keeps margin current daily.
- •FIFO expenses the oldest cost layer first, so a period of rising costs shows higher gross profit than weighted average, which smooths the increase.
- •QuickBooks Online values inventory on FIFO while QuickBooks Desktop has historically used average cost, so identical data can produce different COGS.
- •Ending inventory has to include units in transit and units sitting at a prep center, all valued at cost rather than at retail price.
By Marcus Brandt · Head of Seller Accounting
Updated July 30, 2026
Cost of goods sold (COGS) is the direct cost of the products you sold during a period. You don't add up every invoice you paid suppliers; you isolate the cost of the units that left your shelves. The standard formula does this for you: take what you started with, add what you bought, and subtract what's left at the end. Whatever's left over is what you sold.
The formula is short. Getting the inputs right is the actual work. Each of the three numbers (beginning inventory, purchases, ending inventory) has to be valued consistently and at true cost, and that's where most seller books go wrong, usually by valuing purchases at the supplier invoice alone and forgetting freight and duties.
This article walks through the formula, a worked example, what belongs in COGS and what doesn't, where each input actually comes from, the cost-flow methods that decide which cost you assign to each sale, and the mistakes that make COGS (and therefore your taxes and margins) wrong.
The COGS formula
COGS belongs to cost accounting, whose definition is refreshingly plain: trace costs back to the things that caused them. Everything below is that one idea applied to inventory. The accounting formula is the same whether you sell on Amazon, eBay, or your own store. It works because every unit you bought either got sold or is still in inventory, so subtracting ending inventory leaves exactly the cost of what sold.
All four inputs must be valued at cost, never at retail price. For Amazon sellers, "cost" means landed cost: the product price plus inbound freight, import duties, and prep or labeling, divided across the units in that shipment.
One subtlety hides in the word "sold". The formula technically computes the cost of goods that are no longer in your inventory, which includes units that were lost, damaged, or given away as well as units that sold. In practice that's fine for small write-offs, but if Amazon loses a meaningful chunk of your FBA stock, those units inflate COGS unless you break them out as a separate shrinkage or loss line. Sellers who track this separately often discover reimbursable losses they'd otherwise have silently expensed.
- •COGS = Beginning inventory + Purchases - Ending inventory
- •Beginning inventory = cost value of stock on hand at the start of the period
- •Purchases = cost of all new inventory bought during the period (at landed cost)
- •Ending inventory = cost value of stock still on hand at the end of the period
A worked example
Say you run a single ASIN over one quarter. These numbers are illustrative, not real Amazon figures:
You start the quarter with $10,000 of inventory. During the quarter you buy another $25,000 of product (landed). At the end you count $8,000 of stock still sitting in FBA and your prep center. Plug those in: COGS = $10,000 + $25,000 - $8,000 = $27,000. That $27,000 is the cost of the units you sold this quarter. The remaining $8,000 stays on your balance sheet as an asset until it sells.
Now extend the example one step. Suppose that $25,000 of purchases was really a $22,000 supplier invoice plus $2,000 ocean freight plus $1,000 in duties and prep. If you'd only counted the invoice, your COGS would come out $3,000 too low, your gross profit $3,000 too high, and you'd think the product earns more per unit than it does. Multiply that distortion across a year of shipments and you're making restock and pricing decisions on fiction.
- •Beginning inventory: $10,000
- •Plus purchases: $25,000
- •Minus ending inventory: $8,000
- •= COGS: $27,000
See it in BeanHawk
True COGS and live inventory value
BeanHawk keeps a perpetual, landed-cost valuation of every SKU — so your COGS is real, your margins are honest, and your balance sheet reflects what's actually on the shelf.
- ✓Landed cost per unit — freight, duties, prep — not just the invoice price
- ✓COGS recognized as units sell, not when you pay a supplier
- ✓Inventory value and 30-day COGS per SKU, exportable to your ledger
What to include (and exclude)
COGS is only the direct cost of getting product ready to sell. Include the unit cost from your supplier, inbound freight to the warehouse, customs duties and tariffs, and prep, labeling, or kitting. These together are your landed cost per unit. If you assemble or bundle anything yourself, add the labor and overhead of doing it, which is what conversion cost in accounting refers to: the cost of converting components into a finished sellable unit.
Leave Amazon's selling fees, FBA fulfillment fees, storage fees, and PPC out of COGS. Those are selling expenses that hit your profit and loss below the gross-margin line, not part of product cost. Keeping them separate is what lets you see true gross margin versus the drag from marketplace fees. Because those fees move and vary by category and size, verify them against Amazon's current fee schedule rather than assuming a fixed rate. A quick way to model the fee side per unit is a free Amazon FBA fee calculator, which you can run alongside your landed cost to see the full picture.
Getting COGS right at the SKU level is hard when shipments arrive in batches at different costs. BeanHawk tracks perpetual per-SKU landed cost so your COGS reflects the actual cost layers behind each unit sold, not a rough blended guess.
To pressure-test your numbers on a specific product, run it through the free Amazon FBA fee calculator and see profit per unit after fees.
Where each input actually comes from
Beginning inventory is easy: it's last period's ending inventory. If this is your first period, it's whatever you can document you owned at cost when the business started. The chain matters, because an error in one period's ending count flows straight into the next period's COGS.
Purchases come from your supplier invoices plus every cost of getting the goods to sellable condition: freight invoices, customs broker charges, duty payments, prep center bills. Keep these attached to the shipment they belong to, so you can compute a landed cost per unit for that batch rather than a vague annual total. The sales side has its own source document per channel: a date-range report in Seller Central for Amazon, and for eBay, the Sold tab in Seller Hub with a date filter. Note that how to find sold listings on eBay for competitor pricing research is a different exercise from exporting your own sold record, and only your own record belongs in a COGS calculation.
Ending inventory is the hard one. You either count it (a periodic physical count of what's on hand, valued at cost) or you track it perpetually, meaning your system decrements inventory unit by unit as sales come in, so the ending balance is always current. For FBA sellers a pure physical count is impractical, since your stock sits in Amazon's warehouses. You'll lean on Amazon's inventory reports for unit counts, then apply your own cost records to value them. Amazon tells you how many units are there; only your records know what they cost. Whatever you land on becomes the inventory's book value on your balance sheet, and the formula accounting uses for it is cost minus any write-downs, never the price you hope to sell it for. Stock that's gone stale or unsellable gets written down, which reduces book value and increases the cost charged against the period.
Periodic vs perpetual: two ways to compute it
The formula above is the periodic method: you only learn your COGS at the end of the period, after valuing ending inventory. It's simple and it's what many small sellers do at tax time. The trade-off is that you fly blind between counts. If margins slipped in February, a December calculation won't warn you.
The perpetual method records COGS at the moment of each sale. Every order posts a small entry moving that unit's cost out of inventory and into COGS, so your gross margin is accurate every day of the year. This is how proper amazon fba accounting systems work, and it's the only practical way to see profit per SKU per month rather than one blended annual number.
Honest trade-off: perpetual tracking is only as good as your cost data. If you can't reliably assign a landed cost to each batch, a careful periodic calculation in a spreadsheet beats a perpetual system fed with garbage. Start with clean landed costs per shipment, then graduate to perpetual tracking once the inputs are trustworthy.
FIFO, weighted average, and which cost each sale carries
When every shipment costs the same, COGS math is trivial. It never stays that way. Freight rates move, suppliers reprice, tariffs change, so your March batch might cost $9.50 landed per unit while your July batch costs $11.20 (hypothetical numbers). When a unit sells, which cost do you charge to COGS?
FIFO (first in, first out) assumes the oldest units sell first, so sales draw down the $9.50 layer before touching the $11.20 layer. Weighted average blends all layers into one running average cost per unit and charges that. Both are legitimate; what matters is picking one method and applying it consistently, because switching methods period to period makes your margins incomparable and can raise questions at tax time. Ask your accountant which fits your situation before you standardize.
Your software may have already decided for you. QuickBooks Online values inventory on FIFO, while QuickBooks Desktop has historically used average cost, so two sellers on the same brand of ledger can produce different COGS from identical data. Sellers weighing QuickBooks Online vs Desktop on cost and features often miss that the costing method differs too, and it's the difference that shows up in your gross margin. Check which method your version uses before you compare last year's numbers to this year's.
The practical implication for sellers: in a period of rising costs, FIFO shows higher gross profit (you're expensing cheap old layers) while weighted average smooths the increase. Neither changes your actual cash position, only when the cost shows up on paper. Know which method your software uses so you can interpret your own margin reports.
Common mistakes that break COGS
The same errors appear again and again in seller books. Each one distorts both your margin view and your tax return:
- •Expensing inventory when purchased instead of when sold. A big Q4 restock makes December look catastrophic and January look brilliant, and both are wrong.
- •Valuing purchases at the supplier invoice only, leaving freight, duties, and prep scattered in random expense accounts instead of in landed cost.
- •Ignoring Amazon-lost or damaged units, which quietly inflate COGS. Break them out, and file for reimbursement where Amazon is responsible.
- •Using retail value for ending inventory. Every input must be at cost, or the formula produces nonsense.
- •Forgetting inventory in transit or at a prep center. Units you own but haven't received into FBA still belong in ending inventory.
- •Mixing personal-use or giveaway units into sold units without a separate line, which muddies margin per SKU.
Tracking COGS with software instead of spreadsheets
A spreadsheet handles the periodic formula fine for one supplier and a handful of SKUs. It starts failing when shipments overlap, costs vary batch to batch, and you sell across channels. At that point the question isn't whether to automate but which tools to trust.
One category to rule out first: job cost accounting software. It shows up in searches next to inventory tools because both allocate pooled costs, but it's built for contractors tracing labor and materials to a project, and a project isn't a SKU that sits on a shelf for six months. Sellers need cost layers per batch, not jobs.
Two categories do the work. Ecommerce inventory management software (or dedicated amazon inventory management software) tracks units and cost layers per SKU, so ending inventory and per-unit landed cost are always known. Then your amazon seller accounting software or connector posts COGS to the ledger as units sell. Some tools do both; many sellers pair a connector with quickbooks for amazon sellers so the COGS entries land in QuickBooks automatically each settlement.
Whatever you pick, apply one test: after a month of sales, can it show you gross margin per SKU using real landed costs, and does the inventory balance on your balance sheet match what's physically in FBA plus your prep center? If either answer is no, you're still guessing, just with more expensive tools. Good ecommerce accounting is defined by that reconciliation, not by the software's feature list.
Frequently asked questions
- What is included in cost of goods sold?
- COGS includes the direct cost of the products you sold: the supplier unit cost plus inbound freight, import duties, and any prep or labeling. For Amazon sellers this is your landed cost per unit. It excludes marketplace fees, fulfillment fees, storage, and advertising, which are selling expenses rather than product cost.
- How do I calculate COGS as a percentage of sales?
- Divide COGS by net sales for the same period and multiply by 100. Net sales is gross sales minus returns, refunds, and discounts, so use that rather than gross, or the ratio flatters you. Using the worked example above, $27,000 of COGS against $60,000 of net sales gives a COGS percentage of 45%, which means a 55% gross margin. Watch the trend more than the number: a COGS percentage of sales that creeps up month over month usually means freight or supplier costs rose and your prices didn't.
- Is cost of goods sold an expense?
- Yes, COGS is an expense, but a special one. It only becomes an expense at the moment a unit sells; until then the inventory sits on your balance sheet as an asset. On the income statement, COGS is subtracted from revenue to give gross profit, above your operating expenses.
- What is the difference between cost of goods sold and cost of sales?
- They are essentially the same figure for a product business. "Cost of sales" is the term some companies and service businesses use, while "cost of goods sold" is standard for sellers of physical products. Both measure the direct cost of what was sold during the period.
- Where do you find cost of goods sold?
- COGS appears on your income statement (profit and loss), directly under revenue. You won't find it pre-calculated in Seller Central; you derive it from your own inventory records using beginning inventory, purchases, and ending inventory, or your accounting software computes it as units sell.
- Is cost of goods sold a debit or a credit?
- COGS is a debit. As an expense account, it increases with a debit. When a sale is recorded, you debit COGS and credit your inventory asset account for the cost of the units sold, which moves the cost off the balance sheet and onto the income statement.
- Does QuickBooks calculate COGS automatically?
- Partially. QuickBooks can post COGS when you sell tracked inventory items, but it doesn't know about your Amazon sales, landed costs, or FBA stock on its own. Most sellers pair it with an amazon quickbooks integration that records COGS per settlement using real per-SKU costs. Without that layer, QuickBooks only knows what you manually tell it.
- How do I calculate COGS for Amazon FBA specifically?
- Same formula, with two FBA twists. First, ending inventory includes units in Amazon's warehouses, in transit to FBA, and at your prep center, all at landed cost. Second, units Amazon lost or damaged shouldn't stay in COGS; break them out as shrinkage and pursue reimbursement where Amazon is at fault. Amazon's inventory reports give you unit counts; your own records supply the costs.
- What's the best software for tracking COGS as an Amazon seller?
- Look for per-SKU landed cost tracking, perpetual COGS posting as units sell, and clean sync into QuickBooks or Xero. BeanHawk does this with per-batch cost layers, and A2X paired with a separate inventory tool is a common alternative. Compare them on one question: can each show gross margin per SKU with real landed costs, reconciled to your balance sheet? A spreadsheet is genuinely fine below a few SKUs; software earns its fee once batches and channels multiply.
Keep learning
Related answers
See what Amazon owes you — free
Connect your seller account and get a free reimbursement audit. No credit card, keep 100% of what you recover.