Blog
→
Expenses
October 18, 2026

SaaS COGS: what counts and how to calculate It

Written by:
Christophe Sion
CEO
Share on XShare on LinkedInShare on FacebookShare by email
In this article
Ready to get started?
Get full visibility into your spend in minutes.
Get started for free

SaaS COGS are the direct costs required to deliver your product or service to paying customers. They are not the full cost of running the company. That sounds simple, but SaaS has more grey areas than inventory businesses. There is no box of goods leaving a warehouse. You need a policy that is logical, consistent, and easy to defend over time. Get it wrong and your gross margin shifts, your pricing can look better than it is, and your runway, financing, and planning decisions start from the wrong numbers.

Why this metric gets messy faster than you expect

In SaaS, the direct cost of delivery is less visible than in a physical product business. You are usually dealing with hosting, third-party tools, support, onboarding, and people time, not raw materials. That is why similar companies often classify the same cost differently or miss hidden costs. One team puts onboarding in COGS, another keeps it in operating expenses. The real risk is not that your policy is imperfect. It is that it keeps changing. Pick an approach early, document it, and apply it the same way every month. Consistency makes your gross margin more credible and your business easier to explain as you scale.

Use one rule to separate COGS from OpEx

In business accounting, COGS means the direct cost of producing or delivering what you sell. In SaaS, that means costs directly tied to delivering the subscribed service to paying customers during the period. Keep broader company-running costs in OpEx, including sales and marketing, executive overhead, finance, HR, and general admin. A useful test is simple: if you removed the cost, could you still deliver the product or support it at the promised level? If not, it may belong in COGS. Keep acquisition and expansion work out of COGS. Retention or service-delivery work may qualify, but only when it is clearly part of delivery.

What usually belongs in SaaS COGS

  • Infrastructure and technical delivery costs: cloud hosting, servers, storage, monitoring, CDN, data transfer, and communications costs used to run the product for customers.
  • Third-party software and APIs used in delivery: tools, platforms, or usage-based services that are consumed as part of the customer experience.
  • Direct delivery people costs: support, onboarding, implementation, training, and delivery-side engineering work when those roles are clearly tied to serving active customers.
  • Borderline roles that need judgment: customer success and account management only belong in COGS when the work is truly part of ongoing service delivery or retention execution, not upsell, general relationship management, or expansion.

A simple SaaS COGS formula, with an example

For SaaS, COGS is usually a period cost, not an inventory calculation. The basic formula is: SaaS COGS = total direct delivery costs recognized in the period. Gross margin is (Revenue - COGS) / Revenue.

Monthly SaaS example

  • Subscription revenue: €100,000
  • Cloud hosting and data transfer: €12,000
  • Third-party APIs, AI model usage, and delivery tools: €5,000
  • Support team costs: €8,000
  • Direct onboarding and implementation: €5,000

Total COGS: €30,000
Gross profit: €70,000
Gross margin: 70%

If onboarding is wrongly left out of COGS, COGS falls to €25,000 and the reported gross margin rises to 75%.

That 5-point gap matters. It changes how efficient the business looks. Track this month over month, especially when customer count, usage, support load, or implementation intensity changes, and use solid spend forecasting techniques to plan ahead. SaaS delivery costs rarely stay flat while the business grows.

What counts as a healthy SaaS margin

As a broad rule of thumb, SaaS COGS often lands around 10% to 25% of revenue, which puts gross margins somewhere from the high 60s to around 80%. Treat that as context, not law. Early-stage companies often sit below those margins because support is hands-on, onboarding is heavy, and the product still needs manual work around the edges. AI-heavy or infrastructure-heavy products can also carry higher delivery costs, which is why AI unit economics for SaaS deserve extra attention. The same goes for SaaS businesses with a meaningful services component. Investors and lenders care less about whether you hit a generic benchmark and more about whether the number is credible, consistent, and clearly explained. Margin quality feeds directly into pricing decisions, runway planning, growth targets, and your broader unit economics.

How to lower COGS without breaking delivery

Start with the biggest buckets you can actually control through spend management.

  • Clean up infrastructure first: remove idle resources, right-size workloads, review storage and transfer costs, and challenge expensive architecture choices that do not create customer value.
  • Reduce avoidable support load: improve product UX, add better documentation, automate repetitive requests, and use self-serve flows where they genuinely help.
  • Rationalize software and API spend: review duplicate tools, unused seats, low-value vendors, and pricing models that no longer fit your customer mix or usage pattern.
  • Standardize onboarding and delivery work: use repeatable playbooks, clearer training, and the right staffing mix so each new customer does not trigger custom effort by default.
  • Push back on unprofitable complexity: question custom requests, one-off processes, or premium service promises that raise delivery cost without enough revenue, retention value, or strategic upside.

How to track SaaS COGS without spreadsheet chaos

Tag delivery-related spend as close to the transaction as possible, by vendor, team, product line, or customer, so finance is not rebuilding intent from memory at month-end. Keep one mapping into your accounting system so COGS and OpEx stay consistent across months and entities. Then review COGS next to revenue, customer scale, and gross margin trends to generate clearer financial insights. A modern spend stack with accounting integrations and AI spend visibility, including tools like Husk, makes that process faster and much easier to defend.

‍

Same model, different bill: direct APIs, clouds and routers

The same model can produce a different bill depending on where you buy it, because LLM pricing is several markets stacked on top of each other: model makers selling direct, managed cloud platforms, routing services and hosts that run open models. Each route changes how pricing, access and governance work.

Common buying routes

  • Direct provider API: best for access to the newest models, simpler pricing and fast experimentation. Total cost can rise through separate billing per vendor, fewer controls across providers and no built-in backup if one vendor fails.
  • Managed cloud platform: best for enterprise procurement, control over where data is processed, security and governance. Total cost can rise through platform-specific pricing, regional price differences and possible markup.
  • Router or marketplace: best for switching models quickly, one connection to many vendors and automatic fallback. Total cost can rise through markup, different rounding and extra monitoring or routing fees.
  • Open-model hosting provider: best for low token prices on selected workloads and a wide choice of models. Total cost can rise through uneven quality, missing features and host-specific limits.
  • Self-hosted open models: best for predictable high volume and heavy customization. Total cost can rise through hardware costs, servers sitting idle, engineering time and responsibility for uptime.

Direct provider APIs

Direct APIs are usually the cleanest place to start a comparison. Pricing is easier to read, new models arrive there first, and there is no extra commercial layer between you and the model maker. For testing the newest models or moving quickly, this route gives the clearest view of raw model economics.

Managed cloud platforms

Azure, AWS Bedrock, Vertex AI and similar platforms add considerations beyond price. A company may accept a higher rate because the route fits its procurement process, regional deployment, data-handling policy, network setup or existing cloud commitments, such as an annual spend already agreed with AWS. For many finance and compliance teams that trade-off makes sense, as long as it is measured explicitly.

You deserve
financial clarity.
Get full visibility into your company’s finances in minutes.
Get started for free