Learn · COGS & inventory

how is cost of goods sold calculated

Short answer

Cost of Goods Sold (COGS) = Beginning Inventory + Purchases (or Production Costs) − Ending Inventory. For Amazon sellers, this means unit cost, inbound freight, duties, and prep/labeling fees rolled into inventory value, expensed only when the unit actually sells.

Key takeaways

  • Buying inventory is not an expense: the cash becomes a balance sheet asset and only moves to the income statement as COGS when the unit sells.
  • Amazon referral, fulfillment, and storage fees plus advertising are operating expenses rather than inventory cost, and folding them into COGS makes gross margin useless.
  • Freight and duty on a container holding several SKUs have to be allocated by unit count, weight, volume, or value, with the chosen basis applied consistently.
  • Overstating ending inventory shrinks COGS and inflates reported profit, while understating it makes the business look less profitable than it really is.
  • Revaluing old stock at the newest supplier price overstates the inventory asset and understates COGS on units you actually bought cheap.
Marcus Brandt, Head of Seller Accounting at BeanHawk

By Marcus Brandt · Head of Seller Accounting

Updated July 30, 2026

Cost of Goods Sold looks like a simple formula until you try to apply it to a real Amazon business with FBA fees, returns, damaged units, and inventory sitting across multiple warehouses. Getting it right matters. COGS drives your gross margin, your tax bill, and whether you actually know if a SKU is profitable.

This guide walks through the formula, what actually belongs in inventory cost for an ecommerce seller, a worked example with clearly hypothetical numbers, and the mistakes that quietly wreck margin reporting. If you sell through FBA, the details matter more than the arithmetic. Landed cost, reimbursements, and settlement timing all pull real-world COGS away from what a textbook example suggests, and they're the reason amazon fba accounting is its own discipline rather than generic small-business bookkeeping.

The Core COGS Formula

At its foundation, COGS is calculated with one equation: Beginning Inventory + Purchases − Ending Inventory = COGS. This tells you the cost of everything that left inventory and was sold during the period, as opposed to what you spent on inventory or what's still sitting on shelves.

For a private-label Amazon seller, 'Purchases' isn't just the unit cost from your factory invoice. It should include everything required to get that inventory into a sellable state: manufacturing cost, inbound freight and customs duties, and any prep, labeling, or poly-bagging fees paid before the unit is available for sale. FBA storage fees, referral fees, and advertising spend are NOT part of COGS. Those are operating expenses that show up further down the P&L.

One idea trips up almost every new seller: buying inventory is not an expense. The day you wire your supplier, nothing hits your profit and loss statement. That cash converts into an asset called inventory, which sits on your balance sheet until units sell. Only at the moment of sale does the cost of that specific unit move from the balance sheet to the income statement as COGS. This is why a seller can spend heavily on a restock, show a great profit month on paper, and still feel broke. Profit and cash flow measure different things, and COGS is the bridge between them.

The formula also explains why ending inventory accuracy matters so much. Overstate ending inventory and COGS shrinks, which inflates profit and your tax bill's starting point. Understate it and you look less profitable than you are. Every miscount flows straight through the equation.

  • Beginning Inventory: value of stock on hand at period start
  • + Purchases: unit cost + freight + duties + prep fees
  • − Ending Inventory: value of stock still on hand at period end
  • = Cost of Goods Sold

Why Per-Unit Costing Matters More Than the Formula

The formula above works at the aggregate level, but real accounting happens per SKU. You need a landed cost per unit (total cost to get one unit sellable, divided by unit count) so that every sale recognizes the correct expense, and every unsold unit stays correctly valued as an asset on the balance sheet.

This is where most seller books break down. Freight bills arrive separately from PO invoices, prep fees get missed, and multi-SKU shipments don't automatically allocate landed cost by unit. If landed cost is wrong, COGS is wrong for every single sale of that batch, which quietly distorts margin reporting for months.

Allocation is the fiddly part. When one container holds four SKUs, the freight and duty bill has to be split across them on some defensible basis: by unit count, by weight, by cubic volume, or by value. A pallet of pillows and a pallet of phone chargers shouldn't absorb ocean freight the same way. Most sellers allocate by value or weight, document the choice, and apply it consistently. The method matters less than picking one and sticking with it.

It also matters for reimbursements. Since 2025, Amazon reimburses lost or damaged FBA inventory based on the seller's manufacturing/sourcing cost rather than retail price, and Amazon will use its own cost estimate unless you've supplied your actual cost. If your books don't have an accurate per-unit landed cost on file, you're at the mercy of Amazon's estimate, which is frequently lower than what you actually paid. Clean amazon bookkeeping literally changes how many dollars Amazon owes you when a warehouse loses your stock.

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
See inventory accounting →
app.beanhawk.com/inventory/valuationBeanHawkDashboardReimbursementsBooksInventoryChannelsJRJordan R.Owner · Pro planInventory & true COGSSTOCK VALUE$20,030landed-cost basisUNITS ON HAND3,037across 42 SKUsCOGS (30d)$29.2kfrom units soldValuation by SKUExport →SKUON HANDLANDEDVALUECOGS 30dWireless earbuds1,240$8.10$10,044$14.9kYoga mat — teal612$6.40$3,917$5.2kSteel water bottle980$3.85$3,773$6.1kLED desk lamp205$11.20$2,296$3.0k

A Worked Example With Real Mechanics

Say you order 1,000 units of a kitchen gadget from your supplier at $6.00 per unit, so the factory invoice is $6,000. Ocean freight for the shipment runs $800, customs duties come to $400, and your prep center charges $300 for labeling and poly-bagging. The numbers are hypothetical; the mechanics aren't.

Total landed cost for the batch is $6,000 + $800 + $400 + $300 = $7,500, which works out to $7.50 per unit. That $7.50 is the number that matters, not the $6.00 on the invoice. A seller who prices and measures margin off the invoice cost alone thinks they have $1.50 more per unit than they actually do.

Now run the period. You started the quarter with 200 units already in stock, valued at $7.20 each from an earlier batch, so beginning inventory is $1,440. Your new purchase adds $7,500. During the quarter you sell 900 units. Under the weighted average method, total cost is $1,440 + $7,500 = $8,940 across 1,200 units, or $7.45 per unit. COGS is 900 × $7.45 = $6,705, and ending inventory is 300 × $7.45 = $2,235. Check it against the formula: $1,440 + $7,500 − $2,235 = $6,705.

If those 900 units sold at $19.99 each, revenue is roughly $17,991 and gross margin before Amazon fees is $11,286, about 63%. Referral and fulfillment fees then come out as operating expenses. Running the same math with the wrong cost basis ($6.00 instead of $7.45) would overstate gross profit by more than $1,300 in a single quarter on a single SKU. Multiply that across a 40-SKU catalog and your P&L becomes fiction.

COGS Methods: FIFO, Weighted Average, and Why It Matters

There are a few accepted methods for valuing inventory and calculating COGS, and the one you choose affects both your reported margin and your tax liability, especially when unit costs change over time.

FIFO (first-in, first-out) assumes the oldest inventory sells first. It's common for sellers whose product costs rise over time, since it keeps older, cheaper costs in COGS and newer costs in ending inventory. Weighted average smooths cost fluctuations across all units in stock, which is simpler to manage across frequent restocks but less precise when input costs swing.

Rerun the example above under FIFO and you can see the difference. The first 200 units sold carry the old $7.20 cost ($1,440), and the next 700 carry the new $7.50 cost ($5,250), for COGS of $6,690. Ending inventory is 300 units at $7.50, or $2,250. That's $15 less COGS than weighted average produced. Trivial here, but when costs jump 20% between batches, the gap between methods gets material fast, and it moves both your margin dashboard and your taxable income.

Whichever method you use, the IRS expects consistency and documentation. Inventory costing isn't something you can switch quarter to quarter without a real reason. The IRS instructions for Form 1125-A lay out the accepted inventory valuation methods and what supporting detail is expected if you're ever asked to substantiate COGS on a tax return.

The Cost Accounting Vocabulary Behind COGS

A few terms show up the moment you read about this seriously, and each takes about ten seconds to understand. Start with the cost accounting definition most textbooks give: the practice of capturing what it truly costs to produce and deliver each unit, so the people running the business can price and plan. Financial accounting reports outward, to the IRS and to lenders. Cost accounting reports inward, to you. COGS is the line where the two meet.

Conversion cost in accounting means direct labor plus manufacturing overhead, the cost of turning raw materials into a finished product. Buy finished goods from a factory and you're paying their conversion cost inside your unit price without ever seeing it itemized. Assemble bundles yourself, kitting two SKUs into a gift set, and your own labor and workspace become conversion cost, which belongs in the landed cost of that bundle rather than buried in general overhead.

Job cost accounting software solves a neighboring problem: accumulating costs per job or per production batch, the way a contractor or custom manufacturer needs. Most product sellers don't need a dedicated job costing system, but the idea transfers cleanly. Your production runs are the jobs. Holding costs at the batch level (this container, this PO, this run) is what makes per-unit landed cost defensible instead of an average of averages.

Timing: When Should COGS Actually Hit Your Books?

COGS belongs in the same period as the revenue it produced. That's the matching principle, and it's the whole point of accrual accounting. A unit that sells on March 30 creates March COGS at its landed cost, even if Amazon doesn't pay out the settlement until mid-April and you don't restock until May.

Cash-basis sellers often skip this and expense inventory when they pay for it. It feels simpler, but it makes every month with a big PO look like a disaster and every month without one look like a windfall. You can't judge a product line, set ad budgets sensibly, or compare months against each other when purchase timing drives the P&L. Lenders and buyers of ecommerce businesses will also insist on accrual numbers, so switching later means rebuilding history.

Settlement reports make the timing problem worse because Amazon's two-week payout cycles don't align with calendar months. A monthly close needs sales and COGS cut at month-end, not at settlement date. Pair that with a periodic inventory reality check: reconcile what your books say you hold against FBA inventory reports, count anything stored at home or a 3PL, and book shrinkage when units have genuinely vanished. Small discrepancies compound quietly until year-end becomes archaeology.

Where Amazon Sellers Get COGS Wrong

Three mistakes show up constantly in seller books. First, treating Amazon fees as part of COGS. Referral fees and FBA fulfillment fees are operating expenses, not inventory cost, and mixing them in inflates your reported COGS while understating true gross margin.

Second, ignoring inventory adjustments from lost, damaged, or destroyed units. When Amazon loses inventory, the units need to come out of your inventory asset account and the reimbursement needs to be recorded separately, not netted directly against COGS, which hides both the loss and the recovery.

Third, forgetting returns and refurb costs. A returned unit that gets relisted, discounted, or liquidated needs its cost basis adjusted, not left at original landed cost. This is exactly the kind of reconciliation that's hard to do manually across thousands of SKUs and monthly settlement reports, which is why purpose-built Amazon accounting software exists to automate landed cost tracking, reimbursement matching, and COGS posting instead of relying on spreadsheets.

A fourth, subtler error: valuing everything at the most recent purchase price. When your supplier raises prices, revaluing old stock at the new cost overstates your inventory asset and understates COGS on units bought cheap. Each batch keeps its own cost under FIFO, or gets blended properly under weighted average. Silent revaluation is neither.

Setting Up COGS Tracking That Survives Growth

Under about 20 SKUs and a handful of POs a year, a disciplined spreadsheet honestly works. One tab for purchase batches with landed cost per unit, one for monthly units sold per SKU, and a formula that multiplies them. The failure mode isn't the math, it's the discipline: the spreadsheet is only right if every freight invoice and prep bill gets entered the week it arrives.

Past that point, tooling earns its keep. Good amazon seller accounting software should pull settlement data automatically, hold a landed cost per SKU per batch, post COGS monthly against actual units sold, and keep inventory valuation in sync with what FBA says you hold. If you run your ledger in QuickBooks, an amazon quickbooks integration that posts summarized journal entries (rather than dumping thousands of order-level rows into your ledger) keeps the books clean enough for an accountant to actually review.

Sellers on multiple channels have a second problem: the same SKU selling on Amazon, eBay, and Shopify needs one cost basis, not three. That's where ecommerce accounting platforms and multi channel inventory management software overlap; whichever tool owns your landed cost data should feed every channel's margin reporting from the same numbers. BeanHawk approaches this with a perpetual SKU-level valuation layer alongside settlement accounting, and tools like A2X take a summarization-first approach. Compare a2x accounting style summarization against SKU-level tracking based on whether you actually need per-product margins or just clean books.

Whatever you pick, the sequencing is the same. Get landed cost right at the batch level first, choose FIFO or weighted average and write the choice down, close monthly with an inventory reconciliation, and only then worry about dashboards. Fancy reporting on top of a wrong cost basis just makes the wrong number prettier.

Frequently asked questions

Does COGS include Amazon FBA fees?
No. COGS covers what it costs to acquire or produce the inventory: unit cost, inbound freight, duties, and prep fees. FBA storage, fulfillment, and referral fees are operating expenses reported separately on your income statement.
How do I calculate COGS if I don't track inventory by unit?
You can still use Beginning Inventory + Purchases − Ending Inventory at a portfolio level, but you'll lose SKU-level profitability, which makes pricing and ad spend decisions much harder. Per-unit landed costing is strongly recommended once you have more than a handful of SKUs.
What do I do with COGS when Amazon reimburses a lost unit?
Record the inventory loss at your actual landed cost (removing it from inventory), and record the reimbursement as separate income or a recovery, not a direct offset to COGS. Since Amazon now bases reimbursements on your sourcing cost rather than retail price, having documented landed cost on file directly affects how much you get paid.
Should I use FIFO or weighted average for my Amazon business?
FIFO is common when unit costs are rising, since it keeps older, cheaper costs in COGS and improves reported margin. Weighted average is simpler to maintain with frequent reorders at fluctuating costs. Pick one, apply it consistently, and keep documentation in case of an audit.
Why does my COGS look different from my Amazon settlement report?
Settlement reports show cash movements (fees, refunds, reimbursements), not accrual-based inventory expense. COGS should be recognized when a unit sells based on its landed cost, independent of when Amazon pays you or deducts fees, which is why the two numbers rarely match without a proper accounting layer in between.
Does QuickBooks calculate COGS for Amazon sellers automatically?
Not on its own. QuickBooks can hold inventory items and post COGS on invoiced sales, but it doesn't ingest Amazon settlements, allocate freight into landed cost, or handle FBA reimbursements. Most sellers pair quickbooks for amazon sellers with a connector that translates settlement data into balanced journal entries and posts monthly COGS from actual units sold.
QuickBooks Online vs Desktop: which costs more, and which handles COGS better?
They're priced differently and they count inventory differently, and the second part matters more here. QuickBooks Online bills as a monthly subscription per company file with inventory tracking gated to the higher tiers, and it values inventory using FIFO. Desktop is subscription-based now too, with Intuit narrowing who can buy it and Enterprise as the remaining upgrade path; it values inventory at average cost by default, with FIFO available through the Advanced Inventory add-on. Both change pricing often enough that you should check Intuit's current pages rather than trust any article's numbers. Choose on costing method and on what your accountant supports, because the subscription difference is small next to what a wrong cost basis does to your margins.
What's the best accounting software for Amazon sellers who need accurate COGS?
Look for four things: automatic settlement import, batch-level landed cost with freight and duty allocation, monthly COGS posting tied to actual units sold, and inventory valuation that reconciles against FBA reports. A2X, Link My Books, and BeanHawk all cover the settlement side; they differ most on SKU-level inventory depth, so test with your own catalog before committing.
Is advertising spend ever part of COGS?
No. PPC and any other marketing spend is an operating expense. It belongs below gross profit on your P&L. Folding ad spend into COGS makes gross margin useless as a signal, because it mixes the cost of the product with the cost of demand generation, which you control independently.

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.