Get COGS wrong, and you don't just misstate an expense. You misstate your taxable income, your real margins, and every decision you make based on them, pricing, ad spend, order quantities, all of it.
For ecommerce businesses, COGS matters for a few concrete reasons:
- COGS is your largest expense as an inventory business.
- Incorrect COGS gives you the wrong taxable income.
- Incorrect COGS gives you inaccurate profit margin numbers.
- Inaccurate margins compromise your ability to effectively manage your business.
- Decisions about pricing, order quantity, ad spend, and more all depend on COGS and profit margins being right.
If your business has ever felt more profitable on paper than it feels in your bank account, inaccurate COGS is one of the most common reasons why. (For more on that specific symptom, see why your ecommerce business might feel cash poor.)
Why you need an accurate cost of goods sold number
An accurate COGS number relies on three things:
- Calculating an accurate unit cost for each SKU
- Correctly identifying quantity of each SKU sold
- Accurately recording COGS
Calculating a cost number for each SKU
Cost of goods sold is exactly what it sounds like: the cost of the product you sold during a period. Simple in concept, but calculating an accurate cost per SKU is full of pitfalls for ecommerce businesses.
As an ecommerce business, you fall into one of five categories based on the origin of your product:
| Business type | What it means |
|---|---|
| Reseller | You buy product from someone else who produced and owns the rights to it, then resell it for more than it cost you, through retail arbitrage or a wholesale relationship. |
| Outsourced manufacturing | You contract with a company (often overseas) that produces a product you own the rights to. The manufacturer orders raw materials and charges you for a finished product. |
| Manufacturer | You produce the product and own the rights to it, ordering raw materials and covering other direct costs like labor, packaging, and machine time. |
| Hybrid | You outsource the labor for producing your product to a manufacturer but supply some or all of the raw materials yourself. |
| Product broker | Your website sells other vendors' products, which they dropship directly to the customer. You never take ownership of the product, so there's no inventory cost to calculate, only the commission you earn on the sale. |
Calculating your cost for each SKU is different for each situation. We have clients here at LedgerGurus that fall into each of these categories.
Cost calculation for purchasing finished product: resellers and outsourced manufacturers
Ordering finished product from a supplier sounds like it should make for a simple COGS calculation. It doesn't. Some bookkeepers simply divide the purchase amount for an order by the quantity to get a cost number. This is known as "buy cost," but it usually leaves out real costs you paid to actually receive that product, including:
- Shipping
- Insurance fees
- Customs and duties fees
- And more
Adding those additional costs gives you a "landed cost" instead, a meaningfully more accurate number. Landed cost versus buy cost is a big enough topic on its own that we won't fully unpack it here, but we do have a guide on how to determine all your costs to accurately price your products.
Cost calculation for producing your own product: manufacturers and hybrids
The other path is producing your own product, which means tracking and calculating raw materials, labor, packaging, and any other cost that goes into creating each unit.
Manufacturing accounting can be just as complex on its own as ecommerce accounting is without it. If you're managing both, it's worth a conversation about making sure your accounting is being done right.
Identifying quantities of each product sold
Ecommerce businesses are usually more comfortable with this part. Most already know the volume of each SKU they're selling, typically pulled from back-end reports on their sales channels.
The key is thoroughness: consider every way inventory actually leaves your business, not just direct sales. That includes product given away as gifts to neighbors, friends, or influencers, and less obvious situations like crowdfunding campaign rewards. (For a broader look at how untracked movement like this creates mismatches, see our guide on causes of stock discrepancies.)
Accurately recording COGS
Once you've calculated a cost for each SKU, you need to record COGS accurately on your books. The most common mistake ecommerce businesses make is expensing the full purchase of inventory as COGS the moment it's purchased, rather than when it's actually sold. It's an easy mistake to make, and a common one. Here's why it's a problem. (For more detail, watch our video on recording COGS: cash vs. accrual methods.)
Say you pay $70,000 for inventory in January and expense it immediately. That creates a huge hit to your P&L that month. But that inventory doesn't sell right away, it sells gradually over the next several months. When it does sell, your books show all the revenue with no matching expense, so you can't actually see your margins. Recorded incorrectly, it looks like this:
Incorrect COGS recording:

The problem should be obvious: none of these monthly numbers reflect what's actually happening in the business. To get real insight, purchases should initially skip the P&L entirely and sit on the balance sheet as inventory, until they're sold. When a product sells, inventory decreases on the balance sheet and COGS is recorded for that sale (using the previously calculated per-SKU cost multiplied by quantity sold). That's what lets you see your actual margins for that month. Recorded correctly, it looks like this:
Here is the correct way to record your COGS:
Correct COGS recording:

At the end of each month, your P&L should show revenue and COGS that reflect the margin you actually earned on what sold that month, and your balance sheet should show an inventory balance reflecting exactly what you have left. Together, those two numbers give you an accurate picture of where you stand on inventory, COGS, and, most importantly, gross margin (gross margin = gross revenue − COGS). For more information on how to record COGS properly, read 3 Ways to Record a COGS Journal Entry in QuickBooks Online (+ a Shortcut).
Getting COGS right
Businesses don't run off their sales, they run off gross profit. Getting gross profit right, which depends entirely on getting COGS right, is one of the most important pieces of insight you'll have into your ecommerce business.
The big takeaways for cost of goods sold:
- Accurately calculate a unit cost for each SKU, using the method that fits your business model.
- Initial inventory purchases belong on the balance sheet, not expensed at the time of purchase.
- Each sale should have its cost identified, moved out of inventory, and recorded as COGS in the same period as that sale. This doesn't need to happen sale-by-sale, it can be summarized (usually monthly), but the timing of revenue and COGS need to match.
- Gross margin = Sales − COGS. This is the single most important number for an ecommerce company to calculate, record, and watch.
Once your COGS and gross margin are reliable, the natural next step is tightening up the inventory processes feeding into them. (Our roadmap for good inventory management walks through exactly that.)
Frequently asked questions
What is Cost of Goods Sold (COGS) and why does it matter so much for ecommerce?
COGS is the cost of the product you sold during a given period. It matters because it's usually your largest expense, and getting it wrong distorts your taxable income, your profit margins, and every pricing or spending decision built on top of those numbers.
How do I calculate unit cost for my products?
It depends on your business model. Resellers and outsourced manufacturers should calculate landed cost (purchase price plus shipping, insurance, customs, and duties), not just "buy cost." Manufacturers and hybrids need to track raw materials, labor, packaging, and other direct production costs.
What's the difference between "buy cost" and "landed cost"?
Buy cost is simply your purchase price divided by quantity, ignoring the other costs it took to get that product into your hands. Landed cost adds in shipping, insurance, customs, and duties, giving you a much more accurate picture of what each unit actually cost you.
What's the most common mistake businesses make with COGS?
Expensing the full cost of an inventory purchase immediately, instead of recording it as an asset on the balance sheet and only recognizing COGS as each unit actually sells. This creates wild, meaningless swings in monthly profit and makes it impossible to see your real margins.
How should COGS actually be recorded on the books?
Inventory purchases go onto the balance sheet as an asset. As each unit sells, its cost moves from the balance sheet to COGS on the P&L, in the same period as the matching revenue. This can be done sale-by-sale or summarized, usually monthly, but the timing needs to match.
What is gross margin, and why is it more important than revenue?
Gross margin equals Sales minus COGS. It's the number that tells you whether you're actually running a healthy business, since a business can have great revenue and still be unprofitable if COGS isn't accurate or margins are too thin.
Get your COGS (and your margins) right
COGS isn't a number you calculate once and forget. It touches your pricing, your ad spend, your inventory decisions, and your taxes. If you're not fully confident your COGS is accurate, everything built on top of it is standing on shaky ground.
LedgerGurus specializes in ecommerce accounting and inventory, and getting COGS right is one of the things we do most for clients. We'll make sure your unit costs, quantities, and recording are all correct, so your margins actually mean something.

