COGS: what the direct cost of delivering a SaaS is
By Tiago Costa · Updated on July 9, 2026

Definition
COGS (Cost of Goods Sold) is the direct cost of delivering a SaaS service, and the base of gross margin: revenue minus COGS equals gross profit.
- Includes hosting, support, third-party APIs and payment fees.
- Does not include sales, marketing or R&D, which are OpEx.
- It is the base of a SaaS gross margin.
What COGS is
COGS (Cost of Goods Sold) is the set of direct costs of delivering the service to someone who has already paid for it. In a physical store, it would be the cost of the merchandise that left the shelf. In a SaaS, where there is no inventory, it is everything spent to keep the software running and the customer served, month after month.
The core idea is direct cost: only what varies with the operation of serving the product already sold belongs in COGS. Winning new customers or building the next feature are important costs, but they are not part of COGS, because they are not the cost of serving the current base.
What belongs in SaaS COGS
Because software has no raw materials, SaaS COGS is made up of operating and service costs. The main ones are:
- Hosting and infrastructure: servers, databases, CDN, storage and the cloud bill that runs production.
- Customer support: the team that answers, onboards and keeps the base working.
- Third-party fees and APIs: external services embedded in the product, licenses and API calls paid per use.
- Payment processing: the fees charged to collect from each customer.
- Production DevOps: the slice of engineering that keeps the environment running, plus monitoring and reliability.
What they share is that they all grow, in some way, with the number of customers served. If doubling the base doubles (or nearly doubles) the cost, it is probably COGS.

COGS vs OpEx: where to draw the line
The classic split separates COGS from OpEx (operating expenses). COGS is the cost of delivering what has already been sold; OpEx is the cost of making the company grow and run as an organization. On the income statement, COGS sits right below revenue, and OpEx comes after gross margin.
- It is COGS: cloud, support, third-party APIs, payment fees and production DevOps.
- It is OpEx: sales and marketing, research and development (R&D) of the next product, and the general and administrative expenses, the so-called SG&A.
The practical rule: sales, marketing and R&D never belong in COGS. They build future revenue, they do not serve present revenue. Mixing the two hides the true efficiency of the operation.
How to calculate COGS and gross margin
Calculating COGS is a sum: add up all the direct delivery costs of the period. From it comes the metric that really matters, gross margin.
- Gross profit = Revenue - COGS.
- Gross margin = Gross profit / Revenue.
Example: with $100k of revenue and $25k of COGS, gross profit is $75k and gross margin is 75%. Market surveys such as the one by Benchmarkit tend to place a typical SaaS gross margin between 75% and 80%, a high level that reflects the low marginal cost of serving one more software customer.

How classification changes reported margin
Where you draw the line between COGS and OpEx directly changes the gross margin that shows up in the report. Allocating part of engineering as production DevOps (COGS) or as product development (OpEx), including or not the cost of the customer success team, treating payment fees as COGS or as a financial expense: each choice pushes the margin up or down.
That is why two companies with identical costs can report different margins. What protects the reading is not a single rule but consistency: define the criterion, document it and keep it over time. That way gross margin becomes a comparable series, not a number that reinvents itself every quarter.
Why COGS matters
COGS is the foundation of almost every profitability analysis of a SaaS. It defines gross margin, feeds the per-customer contribution margin and enters the calculation of LTV / CLV, because the value of a customer over time is measured by the margin they leave, not by the gross revenue they generate.
A high gross margin is what gives a SaaS the room to invest in growth and still scale. The private SaaS company survey by KeyBanc Capital Markets reinforces how the healthiest companies combine strong margins with operational efficiency. Controlling COGS, then, is not about cutting cost for its own sake: it is about preserving the margin that funds everything else.
Frequently asked questions
They are the direct costs of delivering a software service: hosting, support, third-party fees and payment processing. They do not include sales, marketing or R&D, which are OpEx.
By summing all the direct delivery costs of the period. Revenue minus COGS equals gross profit, and gross profit divided by revenue gives gross margin.
COGS is the cost of delivering what has already been sold (cloud, support, APIs, payment fees). OpEx is the cost of growing and running the company: sales, marketing, R&D and SG&A.
Yes. Software is a service, and its COGS is the cost of delivering that service (cloud, support, third-party fees, payment processing) rather than physical goods.
Hosting and infrastructure, customer support, third-party fees and APIs, payment processing, and the production DevOps that keeps the environment running.
Market surveys such as Benchmarkit place a typical SaaS gross margin around 75% to 80%. Above that range is strong; well below it usually signals heavy delivery or support costs.
Related concepts

Gross margin
Gross margin is the share of revenue left after the direct cost of delivering the service: (revenue minus COGS) divided by revenue, as a percentage. Pure SaaS usually runs between 70% and 85% or more, and that headroom is what sustains the model, feeds LTV and funds reinvestment in growth.

Contribution margin
Contribution margin is revenue minus variable costs, measured per unit or in total. It is what each sale leaves over to cover fixed costs and, after that, become profit. Unlike gross margin, which subtracts all of COGS, it isolates only what changes with volume, which is why it underpins break-even analysis and pricing decisions.

LTV / CLV
LTV (Lifetime Value), also called CLV or CLTV, is the total value a customer generates while they stay in your base. In a simple form, it is the recurring average revenue times margin times the customer lifetime. It is the metric that shows how much it is worth investing to win and keep each customer.