Key takeaways
- The journal entry to record cost of goods sold is a debit to Cost of Goods Sold and a credit to Inventory for the cost of the units you sold.
- COGS is a debit because it’s an expense. The matching credit reduces Inventory, moving the cost off your balance sheet and onto your income statement.
- You record COGS when the goods sell, not when you buy them. A purchase sits in Inventory as an asset until a sale turns it into an expense.
- Under a perpetual system you post the entry with every sale; under a periodic system you post it once at period-end from beginning inventory plus purchases minus ending inventory.
- Most ecommerce sellers book one monthly entry: units sold times weighted-average landed cost, debit Cost of Goods Sold and credit Inventory, on an accrual basis.
Recording cost of goods sold comes down to a single journal entry: debit Cost of Goods Sold, credit Inventory. The part that trips sellers up isn’t the accounts, it’s the timing and the amount.
You book the cost when the goods sell, not when you buy them, and the dollar figure has to be the landed cost of what actually shipped. Here’s the entry, three ways, and how to keep it clean every month.
What is the journal entry for cost of goods sold?
The journal entry to record cost of goods sold is a debit to Cost of Goods Sold and a credit to Inventory for the cost of the units sold. The debit records the expense on your income statement; the credit lowers the Inventory asset on your balance sheet by the same amount. Cost of goods sold (COGS) is the direct cost of the goods you sold in a period.
That one entry is the whole idea. A product’s cost lives on your balance sheet as inventory while it sits on the shelf, and the moment it sells, this entry moves that cost into expense so it lands against the revenue from the same sale.
Everything else in this guide is a variation on when you post it and how you size it.
The core entry to record cost of goods sold
| Account | Debit | Credit |
| Cost of Goods Sold | $X | |
| Inventory | $X |
Are you on a perpetual or periodic inventory system?
How you post COGS depends on which inventory system you run. A perpetual system updates inventory and COGS continuously, so you record the cost with every sale. A periodic system leaves COGS untouched during the period and trues it up once at the end, after a physical count.
Most sellers on accounting software are effectively perpetual; many small brands still close their books periodically each month.
The two inventory systems and how each records COGS
| System | How it tracks inventory | When COGS is recorded |
| Perpetual | Inventory and COGS update with every sale | A COGS entry per sale (or a batched summary), all period long |
| Periodic | Purchases collect in a Purchases account; inventory is counted at period-end | One COGS entry at period-end, from beginning inventory + purchases − ending inventory |
How do you record COGS under a perpetual system?
Under a perpetual system, every sale gets two journal entries. The first records the revenue; the second records the cost. They’re separate because one hits your sales and cash, the other hits your expense and inventory.
Say you sell one unit for $40 that cost you $16 landed. The first entry books the sale:
Entry 1: Record the sale
| Account | Debit | Credit |
| Cash or Accounts Receivable | $40 | |
| Sales Revenue | $40 |
The second entry books the cost of that unit, moving $16 out of Inventory and into COGS:
Entry 2: Record the cost of the sale
| Account | Debit | Credit |
| Cost of Goods Sold | $16 | |
| Inventory | $16 |
If you run QuickBooks or Xero with a cost on each product, the software posts that second entry for you every time an order is marked as sold. The mechanics are automatic; your job is making sure the unit cost behind it is right.
How do you record COGS under a periodic system?
Under a periodic system, nothing hits COGS during the month. Purchases pile up in a Purchases account, and you only work out the cost of what sold at period-end. It’s the older, count-based method, and it takes three steps.
- Count your ending inventory: Do a physical count at period-end to find the value of what’s still on the shelf.
- Compute COGS: Add beginning inventory and purchases, then subtract ending inventory. With $2,400 of beginning inventory, $5,000 of purchases, and $4,000 left at the end, COGS is $3,400. For the full method and what belongs in the number, see how to calculate your cost of goods sold.
- Post the closing entry: Debit Cost of Goods Sold and your ending inventory, then credit beginning inventory and purchases, so the books reflect the real cost of what sold.
Period-end closing entry for a periodic system ($3,400 COGS)
| Account | Debit | Credit |
| Cost of Goods Sold | $3,400 | |
| Inventory (ending) | $4,000 | |
| Inventory (beginning) | $2,400 | |
| Purchases | $5,000 |
How ecommerce sellers actually record COGS each month
Most DTC and marketplace sellers don’t post an entry per order, and they don’t run a full physical count each month either. They book one monthly summary entry: units sold times weighted-average landed cost, debit Cost of Goods Sold and credit Inventory, dated to the month the sales happened.
Ship 4,200 units in a month at an average landed cost of $11.50, and the entry is a $48,300 debit to COGS and a $48,300 credit to Inventory. Two things make that number trustworthy.
The unit cost has to be landed cost, the full cost to get a unit on your shelf, capitalized into Inventory before it ever becomes COGS. And the count has to be units sold, not units bought, or you’re back to expensing purchases too early.
Monthly summary COGS entry (4,200 units × $11.50 landed cost)
| Account | Debit | Credit |
| Cost of Goods Sold | $48,300 | |
| Inventory | $48,300 |
Getting the landed cost right per unit depends on how you value inventory in the first place, whether that’s FIFO, LIFO, or weighted average.
Pin those unit costs down and the monthly entry writes itself. The harder part is knowing the cost, and the profit, on each product. When every SKU hides inside one blended COGS figure, your thin-margin products ride along invisibly.
Adjusting entries: shrinkage, write-downs, and returns
A few events change your inventory without a normal sale, and each needs its own entry to keep the Inventory account honest. Leave them out and your balance sheet carries stock you no longer have.
Shrinkage covers units lost, damaged, or miscounted. Book the missing cost as an expense: debit Cost of Goods Sold, credit Inventory. A write-down handles stock that’s worth less than you paid, often aging or obsolete goods; debit Cost of Goods Sold or a loss account and credit Inventory or a contra-inventory account, a paired account that offsets Inventory’s value.
A customer return of sellable goods reverses the original cost entry: debit Inventory, credit Cost of Goods Sold, putting the cost back on the balance sheet where it belongs.
The three inventory adjustments and their entries
| Event | Debit | Credit |
| Shrinkage (lost, damaged, miscounted) | Cost of Goods Sold | Inventory |
| Write-down (obsolete or aged stock) | Cost of Goods Sold (or loss) | Inventory (or contra account) |
| Return of sellable goods | Inventory | Cost of Goods Sold |
When does COGS hit your books: cash or accrual?
The single most common recording mistake is expensing inventory when you pay the supplier instead of when the goods sell. That’s cash-basis thinking, and it wrecks your monthly picture: a big buying month looks unprofitable, and the month you sell that stock looks impossibly cheap.
Accrual accounting fixes it. It holds each purchase in Inventory and moves the cost to COGS only as units sell, so revenue and its cost land in the same month. That’s what gives you a clean, comparable gross margin month to month. Anyone carrying inventory should be on accrual for COGS.
It’s a core piece of solid ecommerce accounting, and it’s the foundation the monthly entry above rests on.
| Record COGS when the goods sell, not when you buy them. Until a sale, a purchase is inventory, an asset on your balance sheet, and never an expense. |
Frequently asked questions
Is cost of goods sold a debit or a credit?
Cost of goods sold is a debit, because it’s an expense and expenses carry debit balances. When you record COGS you debit the Cost of Goods Sold account and credit Inventory for the same amount, which moves the cost from your balance sheet to your income statement.
What account do you credit when you record COGS?
You credit Inventory when you record COGS, which reduces the value of stock on your balance sheet by the cost of the units sold. The matching debit goes to Cost of Goods Sold on your income statement, so the two entries always move together.
Do you record COGS when you buy or when you sell inventory?
You record COGS when you sell the inventory, not when you buy it. A purchase sits in the Inventory asset account until a sale happens, and only then does its cost move into Cost of Goods Sold to match the revenue it earned.
What’s the COGS entry under a perpetual versus periodic system?
Under a perpetual system, you post a debit to Cost of Goods Sold and a credit to Inventory with every sale, so the accounts stay current in real time. Under a periodic system, you post one entry at period-end, calculated as beginning inventory plus purchases minus ending inventory after a physical count.
How do I record COGS in QuickBooks?
In QuickBooks, if each product carries a cost and inventory tracking is on, the software posts the COGS entry automatically when you record a sale. If you book a monthly summary instead, enter a journal entry that debits Cost of Goods Sold and credits Inventory for units sold times their landed cost.
Is COGS an expense or an asset?
COGS is an expense that appears near the top of your income statement, directly below revenue. The inventory it comes from is an asset on your balance sheet, and the journal entry is what converts that asset into an expense at the moment of sale.