Correctly separating Cost of Goods Sold / Cost of Revenue from Operating Expenses is important because this designation can impact gross margin, operating income, pricing decisions, investor reporting, and management analysis. Whether a company sells physical products, software, services, or a combination of the three, the goal is to distinguish the direct cost of delivering revenue from the broader cost of operating the business.
General Rule
COGS / Cost of Revenue (sometimes used interchangeably) is deducted from revenue to calculate gross profit. It generally includes costs directly connected to delivering the product or service sold, such as inventory, materials, production labor, fulfillment costs, hosting infrastructure, third-party service costs, or other delivery-related expenses, depending on the business model.
Operating Expenses are the costs of running the business that are not included in COGS / Cost of Revenue. These typically include sales, marketing, administrative payroll, legal, accounting, recruiting, rent, internal software, product development, and other overhead.
Core Classification Framework
| Usually COGS / Cost of Revenue | Usually Operating Expenses |
| Directly tied to producing, acquiring, fulfilling, or delivering the product or service. | Related to selling or marketing the product. |
| Variable with sales, customer usage, transactions, or order volume. | Related to corporate administration. |
| Required to fulfill the company’s promise to the customer. | Related to future product development. |
| Part of the product’s landed cost, production environment, or delivery infrastructure. | Required to operate the company, but not directly required to deliver each sale. |
In simple terms: COGS answers, “What did it cost us to deliver the revenue we just earned?” Operating expenses answer, “What did it cost us to run and grow the business?”
Example 1: Software / AI Startup
For a software or AI startup, COGS is usually called Cost of Revenue because the company is selling access to a service rather than physical inventory. Imagine an AI workflow automation platform where customers pay a subscription and use AI models to process documents or automate tasks.
| Likely Cost of Revenue | Why |
| Cloud hosting for the production app | Required to deliver the live service. |
| GPU inference costs | Direct cost of processing customer usage. |
| Third-party LLM or API fees | Direct input into the customer-facing product. |
| Production databases, storage, and monitoring | Supports uptime, availability, and customer workloads. |
| DevOps or infrastructure labor | Directly supports delivery of the live platform. |
| Implementation or support labor | COGS if required to deliver or maintain the contracted service. |
| Likely OPEX | Why |
| Product engineers building new features | R&D for future product capability. |
| ML researchers experimenting with new models | Future development rather than current delivery. |
| Sales team salaries and commissions | Customer acquisition. |
| Marketing campaigns | Demand generation. |
| CEO, finance, HR, legal, and accounting | Corporate administration. |
| Customer success focused on renewals and upsells | Account management rather than service delivery – more like sales. |
Key distinction: production usage costs generally belong in Cost of Revenue, while experimentation, future feature development, sales, marketing, and administration generally belong in OpEx.
Example 2: Ecommerce Company
For an ecommerce company, COGS is usually more straightforward because the company sells physical goods. Imagine a company that buys apparel from suppliers and sells it online.
| Likely COGS | Why |
| Product inventory purchased for resale | Direct cost of the item sold. |
| Freight-in from suppliers | Part of getting inventory ready for sale. |
| Import duties and tariffs | Directly tied to landed inventory cost. |
| Product-level packaging | Part of the product sold. |
| Manufacturing or customization labor | Directly tied to preparing the product. |
| Likely OPEX | Why |
| Paid ads on Google, Meta, TikTok, etc. | Customer acquisition. |
| Influencer campaigns | Marketing. |
| Product photography and creative | Selling and merchandising. |
| Website design and brand work | Sales and marketing. |
| Finance, HR, legal, accounting, and executive salaries | Administration and corporate overhead. |
| Recruiting and office expenses | General business operations. |
The key is consistency. A company should choose a defensible policy, document it, and apply it the same way each period.
Common Gray Areas
Shipping
Freight-in is usually COGS because it is part of acquiring inventory. Outbound shipping is more nuanced: some companies include it in Cost of Revenue, while others present it as fulfillment or operating expense.
Payroll
Classification depends on function. Production labor, implementation labor, infrastructure support, and customer support may belong in COGS if required to deliver the product or service. Sales, marketing, HR, finance, legal, executives, and product development usually belong in OpEx.
Software Tools
General business tools such as Slack, Notion, QuickBooks, Salesforce, and HR software are usually OpEx. Software, APIs, data, or infrastructure embedded directly into the customer-facing product may be COGS.
Customer Success
Customer success can be mixed. Support that helps customers use the product or resolve delivery issues may be Cost of Revenue. Renewals, upsells, account expansion, and relationship management are usually Sales & Marketing OpEx.
Bottom Line
- Classify an expense as COGS / Cost of Revenue when it is directly required to deliver the product or service that generated revenue.
- Classify an expense as Operating Expense when it supports selling, administration, product development, or general business operations.
- For a software or AI startup, COGS usually includes hosting, production infrastructure, model inference, third-party APIs, implementation, and support tied to service delivery.
- For an ecommerce company, COGS usually includes product inventory, freight-in, duties, and product-level packaging.
- Everything else — sales, marketing, R&D, finance, HR, legal, executives, and general overhead — usually belongs in Operating Expenses.
Sources Consulted
IRS Publication 334, Tax Guide for Small Business — guidance on cost of goods sold and business expenses.
KPMG Inventory Handbook — accounting judgment and inventory principles under ASC 330.
SaaS Capital, “What Should Be Included in COGS for My SaaS Business?” — SaaS cost of revenue framework.·
Amazon public filings — example of separating cost of sales, fulfillment, technology, sales and marketing, and G&A.


Leave a Reply