Skip to content
MarginMeter

What counts as COGS for a SaaS company?

A practical list of what belongs in SaaS cost of goods sold — hosting, AI APIs, payment fees, support — what doesn't, and how to treat staging, credits and tools.

October 3, 2026 · 1 min read

Cost of goods sold (COGS) is the cost of delivering your product to the customers you already have. Get it wrong and gross margin stops meaning anything.

The test

Ask: would this cost go away if we had zero customers but kept building the product? If yes, it's probably COGS. If you'd still pay it, it's probably an operating expense.

Usually COGS

  • Production hosting: compute, databases, object storage, CDN and bandwidth.
  • AI inference and other per-request APIs used by the product.
  • Payment processing and billing fees.
  • Third-party services embedded in the product: email delivery, SMS, auth, search, maps.
  • Production monitoring and logging.
  • Customer support and success for existing customers.

Usually not COGS

  • Staging, preview and development environments.
  • Internal tools (CRM, analytics, design, docs).
  • R&D experiments — an OpenAI project for prompt research, a GPU box for model evaluation.
  • Sales and marketing, including free-trial infrastructure if you track CAC carefully.

Grey areas

  • Cloud credits. They reduce your bill today but expire. Report margin without them so it doesn't collapse when credits run out.
  • Shared accounts. If one AWS account hosts both production and staging, split by tags or accounts where possible; otherwise estimate and label the estimate.
  • Annual tool invoices. Spread them across the months they cover.

In MarginMeter, classification rules move a staging account or an R&D project out of COGS without editing data, and manual costs carry a class of COGS, OpEx or excluded.

Frequently asked questions

Are payment processing fees COGS?

Yes, for most SaaS businesses. Fees are incurred for every sale and scale with revenue, so they belong in the cost of delivering the product.

Is customer support COGS?

Support for existing customers is commonly treated as COGS by mature SaaS companies. Pre-sales support and onboarding for prospects is sales cost. Whatever you choose, apply it consistently.

Are staging and development environments COGS?

No. They support building the product, not delivering it to customers. Treat them as R&D or operating expense.

See your real margin in five minutes.

Connect Stripe and your cost providers with read-only access. Free for two connections — no card required.