COGS vs operating expenses: the line that protects your margin
Put a cost in the wrong bucket and your gross margin lies to you. Here is the practical rule for what belongs in cost of goods sold versus operating expenses, with examples.
There's one line in your financials that quietly decides whether you think your business is healthy. It's the line between COGS and operating expenses — and most founders draw it by accident, then make pricing, hiring, and fundraising decisions on top of the wrong number.
COGS, or cost of goods sold, is the direct cost of delivering the thing you sell. Operating expenses — usually shortened to OpEx — are the cost of running the company at all. Put a cost in the wrong bucket and your gross margin moves without anything real changing. That single misclassification ripples into your unit economics, your forecasts, and the story you tell investors.
The good news: you don't need an accounting degree to get this right. You need one clear rule, applied the same way every single month.
What actually counts as COGS
COGS is the cost that exists because you sold a specific unit. If a customer buys, this cost shows up; if they don't, it doesn't. That's the whole test. Direct materials, the labor of the people building or delivering the product, the hosting that runs a customer's account, and the payment processing fee on their transaction all qualify.
Operating expenses are different in kind, not just degree. Your office rent, your CEO's salary, the marketing budget, the recruiter you hired, the accounting software for the back office — these costs keep running whether you sell ten units this month or zero. They're the price of being open for business, not the price of any one sale.
Why the line moves your margin
Gross margin is simply (revenue − COGS) ÷ revenue. It tells you how much of each dollar is left after delivering what you sold, before you pay for everything else. Because OpEx sits below that line, anything you misclassify as OpEx instead of COGS makes your gross margin look better than it is — and the reverse buries you.
Say you do $500,000 in revenue with $200,000 of true COGS. Your gross margin is 60%. Now move a $40,000 cost that's really direct delivery down into OpEx by mistake. COGS drops to $160,000 and margin jumps to 68%. Nothing changed in the business — you just made yourself look eight points healthier, and you'll price too low and promise investors a margin you can't hold.
How it plays out in three businesses
The same logic applies everywhere, but the line lands in different places depending on what you sell. The trap is assuming your industry's answer matches the business next door.
- Product business: raw materials, factory labor, inbound freight, and the credit-card fee on each order are COGS; the warehouse lease, the sales team, and HQ salaries are OpEx.
- Services business: the billable time of the people delivering the work — and any subcontractors on a client engagement — is COGS; the partner doing business development, the office, and admin staff are OpEx.
- SaaS business: hosting and infrastructure to serve paying accounts, third-party data fees passed through to customers, and payment processing are COGS; engineers building new features, sales, marketing, and G&A are OpEx.
The one rule, applied every month
When you're unsure where a cost belongs, ask one question: would this cost exist if we sold nothing this month? If the answer is no — it only happens because a customer bought — it's COGS. If the answer is yes — it happens regardless — it's an operating expense. That single question resolves the large majority of judgment calls without a meeting.
The edge cases are real, and reasonable people land differently on them — a SaaS support team, an engineer who splits time between a customer rollout and the product roadmap. The classification matters less than the consistency. If you call customer support COGS, call it COGS every month. The real enemy isn't choosing the "wrong" bucket on a gray-area cost; it's drawing the line one way in March and another way in June, so your margin trend becomes noise instead of signal. For anything that touches taxes or your statutory financials, confirm the treatment with your accountant, since the rules there are narrower than your internal management view.
This week, pull your last three months of expenses and sort each line into COGS or OpEx using the one-rule test — then write the rule down so it's applied the same way next month and every month after.
A cost belongs in COGS only if selling nothing would erase it.