SaaS & Revenue Metrics

What Is COGS for SaaS?

Also known as COGS, Cost of revenue, Cost of sales

Definition

Cost of goods sold (COGS) is the direct cost of delivering a product or service to paying customers. For SaaS, COGS usually includes hosting and infrastructure, third-party software built into the product, customer support, onboarding staff and payment processing. Subtracting COGS from revenue gives gross profit, the starting point for gross margin.

Free tool Cost of Goods Sold Calculator

Skip the spreadsheet. Plug in your numbers and get the answer in seconds.

Open the tool

Cost of Goods Sold (COGS) explained

In a physical goods business, COGS is materials and manufacturing. Software has almost no marginal production cost, so COGS covers the people and systems needed to keep the service running for customers. Often called cost of revenue in SaaS financial statements, it grows with the customer base, unlike R&D or most overhead.

Getting the split right matters more than most founders expect. Sales and marketing, product development and general admin are operating expenses, not COGS. Moving costs between these buckets changes gross margin, which changes LTV, payback and how investors value the business. Conventions vary, so agree definitions with your accountant and apply them consistently.

COGS also shapes pricing. Products built on paid data providers, enrichment APIs or AI models carry real per-customer costs that rise with usage. If heavy users pay the same as light ones, margin shrinks as the best customers grow. Tracking COGS per customer or per unit of usage shows when pricing needs usage tiers or limits.

Cost of Goods Sold (COGS) formula

SaaS COGS = Hosting + Third-party product software + Support and onboarding staff + Payment processing
Hosting
Cloud infrastructure, servers, storage, bandwidth and monitoring needed to run the production service for paying customers.
Third-party product software
APIs, data providers, AI models and licensed components that are part of what customers use.
Support and onboarding staff
Salaries and tools for support, implementation and the customer success work that keeps customers running.
Payment processing
Card and billing fees charged by payment providers for collecting subscription revenue from customers.

Worked example: In a year, a SaaS company spends $180,000 on hosting, $60,000 on third-party APIs, $150,000 on support and onboarding staff and $30,000 on payment fees. COGS = $180,000 + $60,000 + $150,000 + $30,000 = $420,000. On $2,100,000 revenue, gross margin is 80%.

Want it done for you? Use the free Cost of Goods Sold Calculator →

Cost of Goods Sold (COGS) example

A lead enrichment startup reviews its costs. Data provider fees run $25,000 a month, hosting $8,000 and a two-person support team $14,000, so monthly COGS is $47,000 against $160,000 in revenue, about a 71% gross margin. It discovers most data fees come from a few heavy users on flat plans, so it introduces credit-based pricing for lookups above a monthly limit.

How to calculate COGS for a SaaS business

  1. List delivery costs

    Pull every cost involved in running the product for current customers: infrastructure, third-party services, support and onboarding.

  2. Separate shared staff time

    For people who split time, such as engineers on call for production, allocate only the delivery portion to COGS.

  3. Exclude operating expenses

    Leave sales, marketing, new product development and general admin out. Those belong in operating expenses below gross profit.

  4. Sum and review monthly

    Add the delivery costs for the period, compare with revenue to get gross margin, and watch which lines grow fastest.

Common mistakes

  • Leaving support and onboarding staff out of COGS, which inflates gross margin and misleads investors.
  • Putting all engineering salaries into COGS, even though most engineering work builds new product and belongs in R&D.
  • Ignoring per-customer data or AI costs that grow with usage until margins have already dropped.
  • Changing what counts as COGS from quarter to quarter, which makes gross margin trends meaningless.

Cost of Goods Sold (COGS) FAQ

Typical items are hosting and infrastructure, third-party software and APIs that are part of the product, customer support, implementation and onboarding staff, and payment processing fees. Some companies also include a share of DevOps time spent keeping production running.

Some are. Salaries for support, onboarding and implementation staff usually go into COGS because they deliver the service. Salaries for sales, marketing and engineers building new features usually do not. Split roles by how time is actually spent.

In most SaaS financial statements, yes. Cost of revenue is the more common label for software companies, and it covers the same idea: direct costs of delivering the product. Some companies report subscription and services cost of revenue as separate lines.

COGS sets gross margin, and gross margin affects how much each dollar of revenue is worth. Lower COGS means higher margin, better unit economics and usually a higher revenue multiple. Investors often adjust COGS themselves during diligence if they see costs placed in the wrong bucket.