In accounting, the cost of goods sold figure is the bridge between sales and gross profit. It shows how much of what you sold was consumed by inventory, raw materials, inbound freight, and production labor, and it often says more about pricing discipline than the top line does. I’m focusing on the U.S. treatment here, because the tax rules and financial reporting rules overlap but do not always behave the same way.
The figure is simple to state and easy to misread
- For product businesses, I start with beginning inventory, add current-period acquisition and production costs, then subtract ending inventory.
- Retailers usually capitalize purchase price and freight-in; manufacturers also allocate direct labor and production overhead.
- Service businesses often do not need a COGS line if merchandise is not an income-producing factor.
- FIFO, LIFO, and specific identification can change reported gross profit even when sales volume does not change.
- Freight-out, advertising, executive pay, and most selling or administrative costs usually stay out of the calculation.
- Inventory counts, cutoff timing, and shrinkage control matter as much as the formula itself.
What the number means in practice
I treat this line as the direct cost attached to the units that actually left the shelf, warehouse, or production line during the period. If the item is still on hand at period-end, its cost normally belongs in ending inventory, not in the current period expense. That is why the figure matters so much: it determines gross profit, and gross profit is the first real test of whether the business is pricing, sourcing, and producing well enough to create room for operating expenses.
For a product business, the logic is straightforward. Revenue comes in, returns and allowances come out, and then the period’s inventory cost is matched against the sales that consumed it. For a service business, the picture is often different. If merchandise is not an income-producing factor, there may be no meaningful COGS line at all, and gross profit may be the same as net receipts. That distinction is easy to miss, but it matters when you compare margins across business models.
In my view, the best way to think about the line is this: it measures the cost of units sold, not the cost of staying in business. That distinction is what separates margin analysis from ordinary operating expense tracking, and it leads directly to the calculation itself.

How I calculate it from inventory and purchases
The basic formula is consistent across most product businesses: beginning inventory plus current-period purchases and production costs, less ending inventory, equals the cost tied to goods sold. In a retail file, that usually means purchase price plus inbound freight and similar acquisition costs. In a manufacturing file, the logic expands to include direct labor and qualifying factory overhead.
| Item | Amount | Why it matters |
|---|---|---|
| Beginning inventory | $40,000 | Cost of units carried in from the prior period |
| Purchases | $125,000 | Inventory bought during the period |
| Freight-in | $5,000 | Inbound shipping that gets inventory to the business |
| Goods available for sale | $170,000 | Total cost available to match against sales |
| Ending inventory | ($38,000) | Units still on hand at period-end |
| COGS | $132,000 | Cost recognized against current-period sales |
If net sales were $240,000, gross profit would be $108,000 before operating expenses. That is why a small misclassification can distort the whole income statement. If freight-in gets parked in shipping expense, or ending inventory is understated, gross profit is wrong before management even starts discussing pricing.
Once the calculation is clear, the next question is more practical: which costs belong in the total, and which ones should stay out.
What belongs in the calculation and what stays out
I usually separate the discussion into two buckets. One bucket contains costs that are tied to acquiring or producing the goods. The other bucket contains the ordinary costs of selling and running the business. Confusing the two is one of the fastest ways to inflate gross profit on paper while weakening the real economics of the company.
Usually included
- Purchase price of merchandise or raw materials.
- Inbound freight, express-in, cartage-in, and similar transport that brings inventory to the business.
- Direct labor in manufacturing or mining.
- Indirect factory labor that is part of production, not general administration.
- Factory overhead that is directly and necessarily tied to the production process, such as plant rent, utilities, depreciation, maintenance, supervision, and insurance when properly allocable.
- Packaging and containers that are integral to the product.
Read Also: Gross Margin: Your Guide to Smarter Business Decisions
Usually excluded
- Advertising and marketing.
- Sales commissions.
- Outbound shipping to customers, unless you have a specific accounting policy that treats it differently in a bundled arrangement.
- General office rent and executive salaries.
- Administrative labor that supports the whole business rather than the production process.
- Product samples, showroom costs, and many selling costs that belong below gross profit.
The line between production overhead and general overhead is where a lot of bookkeeping goes sideways. A manufacturer may capitalize factory rent and plant supervision, while a retailer would normally treat those kinds of costs very differently. I always advise clients to map each recurring expense to a policy, not a guess. Once the policy is written, the accounting gets much cleaner and the margin story becomes easier to defend.
Why retailers, manufacturers, and service firms treat it differently
The business model matters because the cost structure matters. A retailer mostly buys finished goods and resells them. A manufacturer transforms inputs into a new product, so the cost base includes more than purchases. A service firm may have no inventory accounting at all, even though it still has direct project costs or labor costs that need to be tracked somewhere.
| Business type | Typical cost base | What I watch first |
|---|---|---|
| Retailer or wholesaler | Purchase price, inbound freight, shrinkage adjustments, and ending inventory valuation | Vendor pricing, freight-in, stock counts, and gross margin by product line |
| Manufacturer | Raw materials, direct labor, indirect labor, and qualifying factory overhead | Labor absorption, overhead allocation, waste, and work-in-process accuracy |
| Service firm | Often no inventory-based COGS; direct project costs or cost of services may sit elsewhere | Labor utilization, project margins, and whether product sales are actually material |
The IRS draws this line fairly plainly: if the sale of merchandise is not an income-producing factor, the business usually does not need to figure COGS the same way a product company does. That is why a law firm, consultancy, or design studio should not force a retail-style inventory model onto its books just because the chart of accounts has a blank line for it.
Mixed businesses need the most care. If a company sells both products and services, I want the split to be explicit. Otherwise, management ends up comparing apples to oranges and making pricing decisions on muddled margin data. That problem becomes even sharper once inventory methods enter the picture.
Inventory methods can move the result without changing sales
Two businesses can sell the same number of units at the same prices and still report different gross profit numbers because they use different inventory cost flow assumptions. That is not a bookkeeping quirk; it is a real accounting choice with real consequences for margin, tax, and investor interpretation.
| Method | Core idea | Where it tends to fit | Effect when prices rise |
|---|---|---|---|
| Specific identification | Match actual cost to the actual item sold | Unique or high-value items | Most precise, but only practical when units are traceable |
| FIFO | First units purchased or produced are treated as first sold | Retail and many manufacturing environments | Usually lower COGS and higher ending inventory |
| LIFO | Last units purchased or produced are treated as first sold | Businesses that want tax or income effects aligned with recent costs | Usually higher COGS and lower ending inventory |
| Retail method | Estimates ending inventory from retail prices and markup relationships | High-volume retailers | Useful operationally, but depends on disciplined markups and markdowns |
FIFO and LIFO are especially important in inflationary periods. FIFO tends to leave newer, higher costs in ending inventory and push older, cheaper costs into COGS. LIFO does the opposite. The practical result is that margin can look stronger or weaker depending on the method, even if the business did not change its pricing at all.
For tax purposes, the IRS still expects inventory methods to clearly reflect income. The current instructions for small business taxpayers allow certain businesses with average annual gross receipts of $31 million or less over the prior three years to use simplified inventory treatment, subject to the tax shelter rule and the requirement that the method still reflect income clearly. If a business later changes its inventory method, that is not a casual bookkeeping tweak; it generally requires a formal accounting-method change.
Once the method is chosen, the real work is keeping the records clean enough that the result remains believable.
The errors I look for before I trust the margin
When gross profit moves and management cannot explain why, I usually start with the inventory file before I start with the sales team. The reason is simple: the biggest distortions often come from timing, classification, or counts, not from the customer side of the business.
- Cutoff errors at month-end, where purchases or shipments land in the wrong period.
- Ending inventory counts that ignore shrinkage, spoilage, obsolescence, or damaged goods.
- Owner withdrawals or personal use of inventory that never got removed from the books.
- Outbound freight booked as inbound freight, which pushes selling cost into inventory cost by mistake.
- Factory overhead omitted from manufacturing inventory, which understates the cost base and overstates gross profit.
- Freight-in or duty-related acquisition costs pushed straight to operating expense instead of inventory when they belong with the goods.
I also look for a mismatch between expected markup and reported gross profit. The IRS itself warns that a large difference between those percentages can signal inaccurate sales, purchases, inventory, or other cost items. That is one of the clearest signs that the problem is not strategic at all; it is mechanical.
Good controls are not complicated. A monthly inventory reconciliation, a documented count process, a clear rule for freight treatment, and a consistent method for write-downs prevent most of the avoidable noise. That discipline is what turns a fragile accounting line into a reliable management tool.
The number becomes useful only when it supports better decisions
Once the calculation is consistent, I can use it for more than compliance. It becomes a pricing tool, a sourcing tool, and a margin-control tool. That matters for strategy because it tells leadership whether revenue growth is actually creating economic value or just masking rising input costs.
For example, if vendor prices rise 8 percent and gross margin falls only 2 points, the business may have pricing power. If the same input increase wipes out margin entirely, the problem may be product mix, discounting, or an inventory method that no longer fits the business. In a governance setting, that is the kind of signal I want the finance function to surface early, before the board sees a quarter of weak margin and hears a vague explanation.
My rule is straightforward: review the figure often, keep the method consistent, and challenge any movement that cannot be tied to a real operational cause. That is the difference between an accounting number that merely satisfies a filing requirement and one that actually helps run the business.