Your revenue grew 40% this year — so why does your bank balance disagree? The answer is usually hiding one line below revenue on your income statement: cost of goods sold. Get that number wrong and every decision built on top of it — your prices, your hiring, your sense of whether the business even works — is built on a quietly false foundation.
COGS is the total direct cost of whatever you sold during a period. For a retailer it is the wholesale cost of the products that left the shelf. For a manufacturer it is raw materials plus the labor and factory overhead that turned them into finished goods. For a service business it is the cost of delivering the work — contractor fees, billable staff time, project-specific software. Subtract COGS from revenue and you get gross profit, the purest measure of whether your core business model makes money before rent, marketing, and everything else enters the picture.
The COGS Formula, With a Worked Example
The formula itself is simple:
Beginning Inventory + Purchases During the Period − Ending Inventory = COGS
Say you run a small candle company. On January 1 your shelves hold $12,000 of wax, jars, wicks, and finished candles. During the quarter you buy $20,000 more in materials. On March 31 you count what remains: $9,000. Your COGS is $12,000 + $20,000 − $9,000 = $23,000. That $23,000 is the direct cost of the candles you actually sold, and it is the number that belongs on your income statement — not the $20,000 you happened to purchase.
Notice what the formula does: it matches costs to sales. Buying inventory is not an expense; it just swaps one asset (cash) for another (inventory). The expense lands only when the goods sell. That matching principle is the whole reason COGS exists, and it is why sloppy inventory counts flow straight into a wrong gross profit.
Manufacturers use a longer version of the same idea: beginning finished-goods inventory plus cost of goods manufactured, minus ending finished-goods inventory. The logic is identical — only the middle term expands to cover materials, direct labor, and factory overhead.
What Belongs in COGS (and What Does Not)
The most consequential COGS skill is classification. The rule is straightforward: if the cost exists only because you made or delivered something you sold, it is COGS. If you would pay it even with zero sales, it is an operating expense.
Typically in COGS:
- Raw materials and wholesale product costs
- Direct labor — wages for people who make the product or deliver the service
- Manufacturing supplies and packaging that ships with the product
- Inbound freight and import duties on goods you sell
- Factory or production-facility costs tied to output, like equipment depreciation on the production line
Typically not in COGS:
- Rent on your office or storefront
- Marketing, advertising, and sales commissions
- Administrative salaries, accounting, and legal fees
- General utilities, insurance, and office supplies
- Outbound shipping you offer free as a promotion (a fulfillment or marketing cost, depending on your policy — but be consistent)
Misclassification is the most common COGS mistake small businesses make. Push operating costs into COGS and your gross margin looks worse than it is, which can scare you into raising prices you did not need to raise. Leave real production costs out and your margin looks rosy while your pricing quietly bleeds. Either error compounds: lenders, investors, and buyers all read gross margin first, and a misclassified COGS tells them a story about your business that is not true.
COGS for Service Businesses: Cost of Services
If you sell hours instead of widgets, you still have COGS — accountants often call it cost of services or cost of revenue. The principle does not change: what did delivering this engagement directly cost you?
For a freelance designer, that includes subcontractor fees, stock assets licensed for a specific client project, and fonts or software bought for one job. For an agency, it includes the billable portion of employee wages plus contractor costs. What it does not include is your own marketing, your coworking membership, or the hours you spent on proposals that went nowhere.
Many service businesses skip this entirely and dump everything into operating expenses. That is a mistake with a real price: without a cost-of-services line you cannot compute a gross margin per project or per client, which means you cannot tell which clients are profitable and which ones you are subsidizing. If one client consumes twice the subcontractor hours at the same retainer, your books should say so.
How Inventory Methods Change Your COGS
When the price you pay for inventory changes over time, an accounting choice decides which units count as "sold" — and therefore what your COGS is. The three standard methods are:
FIFO (first in, first out) assumes the oldest units sell first. In a period of rising prices, FIFO produces the lowest COGS and the highest reported profit, because the cheap old units are the ones counted as sold while the expensive new ones sit in ending inventory. It also keeps the balance sheet closest to current replacement cost.
LIFO (last in, first out) assumes the newest units sell first. When prices rise, LIFO produces higher COGS and lower taxable income — the reason many US companies choose it. Note that LIFO is permitted under US GAAP but banned under IFRS, so it is unavailable if you report internationally.
Weighted average cost blends all units into one average price. It smooths out price swings and is the simplest to maintain, which is why many small retailers and ecommerce sellers use it.
Walk through a quick example. You buy 100 units at $10, then 100 more at $14 after your supplier raises prices, then sell 100 units. Under FIFO your COGS is $1,000 (the cheap batch sold). Under LIFO it is $1,400 (the expensive batch sold). Under average cost it is $1,200. Same business, same cash, three different gross profits — and three different tax bills. Pick a method deliberately, apply it consistently, and revisit the choice with your accountant when your cost environment changes.
Why COGS Decides Your True Margin
Gross profit is revenue minus COGS, and gross margin is that figure expressed as a percentage of revenue. If you sold $200,000 and your COGS was $120,000, your gross profit is $80,000 and your gross margin is 40%. That 40% is the share of every sales dollar available to cover everything else — rent, salaries, marketing, taxes — and still leave a profit.
This is why COGS "decides" your margin. Revenue can grow while gross margin shrinks: a supplier raises prices, waste creeps up on the production line, discounting eats the top line while unit costs stay fixed. Each of those shows up first as a COGS problem, long before it becomes a net-profit emergency. A business with 55% gross margin can absorb a bad quarter of overhead; a business with 18% gross margin cannot absorb much of anything.
Gross margin is also the great equalizer for comparisons. It lets you benchmark against competitors, track your own trend across quarters, and test pricing changes. If your margin drifts from 45% to 38% over two years while revenue climbs, your books are telling you the business is getting harder, not easier — a signal worth hearing before you sign a bigger lease.
One caution: gross margin deliberately ignores operating expenses, so it is not the whole story. A 70% margin with bloated overhead can still lose money. Read COGS-driven margin as the verdict on your business model, and net margin as the verdict on your whole operation.
Common COGS Mistakes That Lie About Your Margin
Beyond misclassification, watch for these recurring errors:
Skipping the physical count. The COGS formula is only as honest as your ending inventory number. Businesses that estimate instead of counting — or count once a year and guess the rest — manufacture a COGS figure that drifts further from reality every month. Cycle-count high-value items monthly and do a full count at least quarterly.
Forgetting labor and freight. Product sellers routinely book the wholesale price and forget inbound shipping, duties, and packaging. A $20 item with $4 of freight and $2 of packaging really costs $26 to put in the customer's hands. Price from the full number.
Mixing personal and business purchases. Sole proprietors who buy materials on a personal card and never log them understate COGS and overstate profit — then overpay tax on income they never really earned. Every deductible cost you fail to record is a gift to the tax authority.
Treating owner labor as free. If you build every product yourself and book zero labor, your margin is fiction. It will collapse the day you hire help or try to sell the business. Value your production hours at a market rate even if you pay yourself through draws.
Changing methods midstream without disclosure. Switching from FIFO to average cost because the numbers look better this quarter distorts trends and can draw IRS scrutiny. Consistency matters more than optimization.
How to Lower COGS Without Cutting Corners
Improving gross margin starts on the cost side, and none of these require cheapening your product:
- Renegotiate supplier terms. Annual volume commitments, early-payment discounts, and competitive re-bidding routinely shave 5 to 15% off material costs. Suppliers expect the conversation.
- Reduce waste and shrinkage. Track spoilage, damage, and theft as their own line items. What gets measured gets managed, and production waste is pure COGS with zero revenue attached.
- Tune your product mix. Not every SKU earns its shelf space. Rank products by gross margin per unit of effort and promote the winners; discontinue or reprice chronic losers.
- Raise prices where margin is thinnest. A 5% price increase on a product with 20% margin lifts that margin dramatically — often more than any cost-cutting project could.
- Automate repetitive production steps. If direct labor dominates your COGS, even modest tooling or template investments can cut cost per unit permanently.
Review COGS monthly, not at tax time. A monthly gross-margin trend line is one of the cheapest early-warning systems a small business can own.
Keep Your Cost Picture Honest From Day One
COGS rewards businesses that track costs carefully and punishes those that reconstruct them in April. Recording material purchases, direct labor, and inventory counts as they happen — in a ledger you can audit line by line — is what turns the formula from a tax-time scramble into a standing management report.
Beancount.io gives you plain-text accounting that is transparent, version-controlled, and AI-ready, so your inventory and cost records stay precise and reviewable instead of locked in a black box. Get started for free and see why developers and finance professionals are switching to plain-text accounting.





