January 19, 2026

COGS vs. operating expenses: Key differences explained

Every expense your business incurs falls into one of two categories: cost of goods sold (COGS) or operating expenses (OPEX). Classifying them incorrectly can distort profit margins, mislead stakeholders, and create tax and reporting issues.

COGS includes the direct costs required to produce what you sell, while operating expenses are the indirect costs of running the business and affect a different level of profitability on your income statement.

What is cost of goods sold (COGS)?

Cost of goods sold refers to the direct costs incurred to produce the products or services a business sells. These are expenses that can be clearly traced to production or service delivery, and without them, there would be nothing to sell.

COGS typically includes costs that scale with production or are directly attributable to it, making it a critical input for calculating gross profit and evaluating unit economics. Because COGS sits immediately below revenue on the income statement, even small classification errors can significantly distort margin analysis.

What’s included in COGS

The specific components of COGS vary by industry, but most businesses see the same core categories appear consistently:

  • Raw materials and inventory: The physical components that become part of the finished product, such as steel for manufacturers or ingredients for restaurants
  • Direct labor costs: Wages paid to employees who are directly involved in producing goods or delivering services
  • Manufacturing overhead: Production-related costs like factory utilities, equipment maintenance, facility rent, and depreciation on manufacturing equipment
  • Freight-in costs: Shipping expenses required to bring raw materials or inventory to a production or storage location
  • Packaging materials: Boxes, labels, and protective materials included with products sold to customers

How to calculate COGS

The standard COGS formula applies to any business that holds inventory:

COGS = Beginning inventory + Purchases − Ending inventory

To calculate COGS accurately, follow these steps:

  1. Determine beginning inventory by measuring the value of inventory at the start of the accounting period
  2. Add purchases made during the period, including raw materials, finished goods, and freight-in
  3. Calculate ending inventory by valuing what remains unsold at the end of the period
  4. Subtract ending inventory from the total to arrive at the cost of goods sold

Your inventory accounting method affects this calculation. FIFO assumes the oldest inventory is sold first, LIFO assumes the newest inventory is sold first, and the weighted average method smooths price changes by averaging inventory costs over the period.

What are operating expenses (OPEX)?

Operating expenses are the indirect costs required to run a business that are not directly tied to producing goods or delivering services. These expenses support day-to-day operations and appear below gross profit on the income statement, where they are used to calculate operating income.

Unlike COGS, operating expenses are not traceable to individual units of output. Some remain fixed regardless of sales volume, while others fluctuate with business activity, which makes understanding their behavior essential for budgeting and cost control.

Common types of operating expenses

Operating expenses are typically grouped by function to make financial reporting and analysis easier.

Selling expenses include costs associated with generating revenue, such as:

  • Sales team salaries and commissions
  • Marketing and advertising spend
  • CRM and sales software subscriptions
  • Trade shows, sales materials, and travel for customer meetings

General and administrative (G&A) expenses cover the costs of running the organization itself, including:

  • Office rent and utilities
  • Insurance premiums, such as general liability and D&O coverage
  • Legal, accounting, and professional fees
  • Office supplies, equipment, and administrative staff salaries

Other operating expenses may include items that support the business but do not fall neatly into selling or G&A categories, such as research and development costs, depreciation on non-production assets, amortization of intangibles, and bad debt expense.

Fixed vs. variable operating expenses

Not all operating expenses behave the same way as revenue changes, which affects how they should be managed.

  • Fixed operating expenses remain largely constant regardless of sales volume, such as office leases, insurance premiums, and most salaried roles
  • Variable operating expenses fluctuate with business activity, including sales commissions, transaction fees, and certain marketing costs

Understanding which operating expenses are fixed versus variable helps businesses plan for growth, model cash flow, and identify which costs will scale naturally and which require active control.

COGS vs. operating expenses: Key differences

The difference between COGS and operating expenses affects how profit is calculated, how performance is evaluated, and where cost-control efforts should focus. While both reduce revenue, they do so at different stages of the income statement and reveal different insights about business efficiency.

The table below summarizes the key distinctions.

| Factor | Cost of goods sold (COGS) | Operating expenses (OPEX) | | Definition | Direct costs to produce goods or deliver services | Indirect costs required to run the business | | Relationship to production | Directly tied to production or service delivery | Not tied to specific units of output | | Income statement placement | Subtracted from revenue to calculate gross profit | Subtracted from gross profit to calculate operating income | | Cost behavior | Often scales with production volume | Mix of fixed and variable costs | | Profit metric affected | Gross profit and gross margin | Operating income and operating margin | | Common examples | Materials, production labor, factory overhead | Rent, marketing, administrative salaries |

Direct vs. indirect costs explained

At the core of this distinction is whether a cost can be directly traced to producing what you sell.

Direct costs are incurred only when goods or services are produced. If production stops, these costs largely disappear. Indirect costs support the business as a whole and typically continue regardless of output levels.

A practical way to assess classification is to ask whether the cost would exist if production halted entirely. Costs that vanish with production usually belong in COGS, while those that persist are operating expenses.

How each affects profitability

COGS and operating expenses reduce revenue in sequence, which is why accurate classification matters for financial analysis:

Revenue – Cost of goods sold = Gross profit

Gross profit – Operating expenses = Operating income

Gross profit shows how efficiently a business produces or sources what it sells. Operating income reflects how well the business manages all ongoing costs. Misclassifying expenses can inflate one metric while understating issues in another, leading to poor decisions around pricing, hiring, or investment.

Common expense categorization challenges

Some expenses do not fall cleanly into COGS or operating expenses and require judgment to classify correctly. These gray areas are common sources of error, especially as businesses scale or adopt new operating models.

The goal is not perfection, but consistency. Expenses should be categorized based on how they support the business, using a rationale that can be applied the same way period after period.

Tricky expenses that cause confusion

Expense typeTypical classificationReasoning
Inbound shipping (freight-in)COGSPart of acquiring inventory or materials needed for production
Outbound shipping (freight-out)Operating expenseOccurs after production and relates to order fulfillment
Production supervisor salaryCOGSDirectly oversees manufacturing or service delivery
Sales manager salaryOperating expenseSupports revenue generation but does not create products
Factory rentCOGSEnables production activities
Office rentOperating expenseSupports administrative and operational functions
Quality control testingCOGSEnsures products meet specifications before sale
Customer support costsOperating expenseSupports customers after the sale is complete

Industry-specific classification nuances

How expenses are classified often depends on the underlying business model. For SaaS and technology companies, infrastructure costs can serve multiple purposes. Customer-facing hosting and production environments are typically classified as COGS, while development, testing, and internal systems fall under operating expenses.

Professional services firms often need to distinguish between billable and non-billable time. Labor tied directly to client work is usually treated as COGS, while time spent on training, sales, or internal administration is classified as an operating expense.

Manufacturing businesses frequently deal with shared overhead. Utilities, rent, and maintenance costs should be allocated using a consistent method, such as square footage or machine usage, to separate production-related costs from administrative ones.

Retail and e-commerce companies face ambiguity around fulfillment and platform fees. Payment processing and marketplace fees are generally operating expenses, while warehousing and fulfillment costs may be classified as COGS if they are directly tied to preparing products for sale.

Why proper classification matters for your business

Correctly distinguishing between COGS and operating expenses is not just an accounting exercise. It directly affects how you evaluate performance, explain results to stakeholders, and decide where to focus cost-control efforts.

When expenses are misclassified, core metrics can become unreliable. A business may appear to have strong gross margins while struggling operationally, or vice versa, making it harder to diagnose problems or plan for growth.

Impact on financial analysis and decision-making

Expense classification shapes the financial metrics leaders rely on most. If production costs are incorrectly treated as operating expenses, gross profit will be overstated, potentially leading to pricing decisions that erode margins. Conversely, misclassifying operating expenses as COGS can mask inefficiencies in overhead and support functions.

Accurate classification also enables meaningful comparison against industry benchmarks. Investors, lenders, and potential buyers expect consistency in how costs are reported, and discrepancies can undermine confidence in financial statements.

Strategic cost management approaches

COGS and operating expenses call for different optimization strategies because they reflect different parts of the business.

Reducing COGS typically involves improving how products or services are produced, such as negotiating vendor pricing, reducing waste, or improving labor efficiency. Managing operating expenses focuses on structural efficiency, including controlling fixed costs, streamlining processes, and evaluating return on discretionary spending.

Understanding where costs sit allows teams to prioritize the right actions instead of cutting expenses indiscriminately, which can create unintended long-term consequences.

What percentage of sales should COGS and OPEX be?

Benchmark ranges can help you evaluate whether your cost structure is broadly in line with similar businesses. These figures are best used as reference points rather than strict targets, since pricing strategy, scale, and business model all influence what “normal” looks like.

Typical COGS as a percentage of sales by industry

  • Grocery stores: 75–80%
  • Manufacturing: 50–70%
  • Retail: 50–65%
  • Professional services: 30–50%
  • Restaurants: 25–35%
  • Software (SaaS): 10–20%

Typical operating expenses as a percentage of sales by industry

  • Software (SaaS): 40–60%
  • Professional services: 25–40%
  • Retail businesses: 20–30%
  • Manufacturing: 15–25%

These ranges provide context, not judgment. Higher COGS may reflect premium inputs or labor-intensive production that supports higher pricing. Higher operating expenses can signal investment in growth, such as sales expansion or product development, rather than inefficiency.

The most useful comparison is often your own trend over time. Consistent classification allows you to track how changes in pricing, volume, or operations affect margins and to spot issues early.

Real-world examples: COGS vs. OPEX in action

The examples below are simplified, composite scenarios that reflect common expense patterns across different business models. They are designed to illustrate how COGS and operating expenses are typically classified in practice.

Example: E-commerce retailer (composite scenario)

An e-commerce retailer generates $150,000 in monthly revenue.

  • COGS ($75,000): Inventory purchases, inbound freight, warehouse receiving labor, product packaging, and fulfillment pick-and-pack fees
  • Operating expenses ($35,000): Office-related rent, customer support salaries, marketing spend, ecommerce platform subscriptions, and outbound shipping

This results in a 50% gross margin and a 23% operating margin, indicating that customer acquisition and fulfillment efficiency have a greater impact on profitability than sourcing costs.

Example: SaaS company (composite scenario)

A SaaS company generates $200,000 in monthly recurring revenue.

  • COGS ($18,000): Customer-facing cloud infrastructure, third-party API licenses, and customer support teams
  • Operating expenses ($112,000): Product development salaries, sales compensation, marketing programs, office costs, and general administration

With a high gross margin but a lower operating margin, this structure shows how SaaS businesses often achieve strong unit economics while absorbing significant operating costs to support growth.

Example: Manufacturing business (composite scenario)

A manufacturing business generates $250,000 in monthly revenue.

  • COGS ($125,000): Raw materials, production wages, factory rent and utilities, equipment depreciation, and quality control
  • Operating expenses ($45,000): Sales commissions, administrative salaries, office rent, marketing, and delivery to customers

This breakdown highlights how production efficiency drives gross margin, while sales and administrative costs determine operating profitability.

Automate COGS and OpEx classification with Ramp

Distinguishing between COGS and OpEx is critical for accurate financial reporting, but manual classification is time-consuming and error-prone. When transactions aren't coded correctly, your income statement becomes unreliable, making it harder to analyze profitability, manage budgets, and make informed decisions about pricing and operations.

Ramp's AI-powered accounting software eliminates the guesswork by learning your accounting patterns and automatically coding transactions across all required fields as they post. The platform analyzes transaction details, merchant information, and historical coding decisions to classify expenses correctly, whether they're direct costs tied to production or indirect costs supporting your operations.

  • AI codes with precision: Ramp learns how your business categorizes different types of spend and applies consistent logic to code transactions in real time, reducing manual review time and classification errors
  • Auto-sync routine spend: Ramp identifies in-policy transactions and syncs them to your ERP automatically, so correctly classified expenses flow to the right accounts without manual intervention
  • Review with full context: Ramp surfaces transaction details, receipts, and approvals in one place, making it easy to verify classifications and adjust coding rules when needed
  • Maintain audit trails: Every transaction includes a complete record of who approved it, why it was coded a certain way, and what supporting documentation exists

Try a demo to see how Ramp helps finance teams code transactions with 67% more accuracy using AI compared to rules-only automation.

Try Ramp for free
Share with
Mason Brady, MBA, CEPAPresident, Brady CFO
Brady CFO is a full-service Fractional CFO firm supporting companies in agriculture, food, manufacturing, logistics, warehousing/distribution, construction & professional services industries. We serve as strategic partners to CEOs and owners to improve profits and cash flow. Our innovative service model provides tools and insights to drive sustainable growth without wasting time and money on inefficient processes or unnecessary expenditures. With Brady CFO, you're investing in a creative and evolving strategy that fits the needs of your growing business.
Ramp is dedicated to helping businesses of all sizes make informed decisions. We adhere to strict editorial guidelines to ensure that our content meets and maintains our high standards.

FAQs

Inventory is an asset on the balance sheet, not an expense. When inventory is sold, its cost is recorded as cost of goods sold on the income statement. Unsold inventory is never classified as an operating expense.

It depends on the role. Salaries for employees directly involved in producing goods or delivering services are classified as COGS. Salaries for administrative, sales, marketing, and management roles are operating expenses.

Yes. Some costs, such as rent or utilities for a shared facility, can be allocated between COGS and operating expenses. The key is to use a reasonable allocation method, apply it consistently, and document the rationale.

Both COGS and operating expenses reduce taxable income, but the timing differs. Operating expenses are generally deductible in the period they are incurred, while COGS is deducted only when the related inventory is sold.

In the public sector, every hour and every dollar belongs to the taxpayer. We can't afford to waste either. Ramp ensures we don't.

Carly Ching

Finance Specialist, City of Ketchum

City of Ketchum

Ramp gives us one structured intake, one set of guardrails, and clean data end‑to‑end— that’s how we save 20 hours/month and buy back days at close.

David Eckstein

CFO, Vanta

How Vanta runs finance on Ramp with programmatic spend for 3 days faster close

Ramp is the only vendor that can service all of our employees across the globe in one unified system. They handle multiple currencies seamlessly, integrate with all of our accounting systems, and thanks to their customizable card and policy controls, we're compliant worldwide.

Brandon Zell

Chief Accounting Officer, Notion

How Notion unified global spend management across 10+ countries

When our teams need something, they usually need it right away. The more time we can save doing all those tedious tasks, the more time we can dedicate to supporting our student-athletes.

Sarah Harris

Secretary, The University of Tennessee Athletics Foundation, Inc.

How Tennessee built a championship-caliber back office with Ramp

Ramp had everything we were looking for, and even things we weren't looking for. The policy aspects, that's something I never even dreamed of that a purchasing card program could handle.

Doug Volesky

Director of Finance, City of Mount Vernon

City of Mount Vernon addresses budget constraints by blocking non-compliant spend, earning cash back with Ramp

Switching from Brex to Ramp wasn't just a platform swap—it was a strategic upgrade that aligned with our mission to be agile, efficient, and financially savvy.

Lily Liu

CEO, Piñata

How Piñata halved its finance team’s workload after moving from Brex to Ramp

With Ramp, everything lives in one place. You can click into a vendor and see every transaction, invoice, and contract. That didn't exist in Zip. It's made approvals much faster because decision-makers aren't chasing down information—they have it all at their fingertips.

Ryan Williams

Manager, Contract and Vendor Management, Advisor360°

How Advisor360° cut their intake-to-pay cycle by 50%

The ability to create flexible parameters, such as allowing bookings up to 25% above market rate, has been really good for us. Plus, having all the information within the same platform is really valuable.

Caroline Hill

Assistant Controller, Sana Benefits

How Sana Benefits improved control over T&E spend with Ramp Travel