SaaS cost of goods sold is the set of direct costs of delivering the software to a paying customer — hosting and cloud infrastructure, the production and DevOps labor that keeps the service running, customer support, and third-party software or data baked into the product. Everything tied to winning the customer (sales, marketing, R&D, admin) stays out, in operating expense. Get that line right and your gross margin tells the truth; blur it and every downstream number lies.

If you run a store, you already know your product cost cold. But the moment your business runs on subscriptions — Shopify, apps, ad platforms, an AI layer — the "what belongs in cost of goods sold" question gets slippery. This guide answers it the way a SaaS finance team does, then translates it into a per-order calculation an operating store can actually use.

What counts as SaaS cost of goods sold?

The test is simple to state and easy to get wrong: a cost belongs in COGS only if it is a direct cost of delivering the service you already sold. Not the cost of finding the buyer. Not the cost of building next year's features. The cost of keeping this customer's product running this month.

The five line items that belong in SaaS COGS

SaaS Capital, which sees this across a lending portfolio, puts five categories inside the COGS line: hosting and core communication costs; infrastructure and DevOps employee costs; customer support and success labor focused on retention; third-party software or data integrated into the product; and any other direct cost required to deliver the ongoing service — all on a "fully burdened" basis including payroll taxes and benefits, according to SaaS Capital.

CloudZero's breakdown matches it almost line for line — hosting like AWS, software licenses that directly support delivery, customer-support and production-engineering labor, billing and transactional costs, and implementation or onboarding delivery — per CloudZero's SaaS COGS guide.

What stays out (and why it matters)

The exclusions are where most people quietly inflate their gross margin. CloudZero keeps general and administrative functions, sales and marketing, R&D, depreciation of intangibles, and interest charges out of COGS entirely, in its component list. SaaS Capital draws an even sharper line inside a single team: customer success work aimed at retention and satisfaction belongs in COGS, but account management aimed at renewals, upsell, and persuasion is an operating expense, it argues.

Why obsess over the boundary? Because gross margin is the number investors and acquirers use to judge revenue quality — and the easiest way to fake a great one is to push real delivery costs down into operating expense where nobody looks. The classification is the metric.

The formula: COGS, gross profit, and gross margin

The arithmetic is trivial once the line items are settled:

  • Gross profit = Total revenue − COGS
  • Gross margin % = (Gross profit ÷ Total revenue) × 100
  • COGS % = (COGS ÷ Total revenue) × 100

Say a small software product books $40,000 in monthly recurring revenue and its true delivery costs — hosting, support, embedded third-party APIs — run $9,200. Gross profit is $40,000 − $9,200 = $30,800, a 77% gross margin ($30,800 ÷ $40,000). Move a $3,000 "customer success" salary that's really an upsell rep out of COGS and margin optically jumps to 85% — same business, prettier chart, worse honesty.

This same discipline underpins how an operations team turns raw supplier and platform costs into a defensible unit cost — a topic the broader ecommerce ops economics hub treats end to end.

SaaS gross margin benchmarks

Numbers give you a sanity check. A few well-sourced reference points:

  • The median SaaS gross margin sits near 77%, with subscription-only revenue often clearing 80%, reports CloudZero. That implies a healthy COGS band of roughly 20–25% of revenue.
  • On core license revenue specifically, 80–85% gross margin is typical, per SaaS Capital's portfolio data.
  • AI-native products run about five points lower than comparable SaaS because model and compute costs land squarely in COGS, notes CloudZero.

The takeaway isn't the exact figure — it's the shape: software COGS is small relative to revenue because delivery is cheap to replicate. That's the opposite of a physical-goods store, and the contrast is the whole point of the next section.

What this means if you run a store on SaaS

Here's the trap. A print-on-demand or Shopify operator sees "SaaS cost of goods sold" and assumes their Shopify plan, their apps, and their tooling belong in COGS. They usually don't. For a store selling physical product, COGS is the cost to make and ship the unit you just sold — the supplier's print charge plus supplier shipping. Your software stack is an operating expense, the same way rent is.

The distinction changes which margin you're even looking at. Confuse the two and you can't tell whether a slow month is a product-cost problem or a subscription-bloat problem — because the correct way of recording cost of goods sold keeps unit cost and overhead in separate buckets on purpose.

Worked example: per-order profit for an operating store

Say your store does 340 orders a month at a $31 average order value, with $2,800 in monthly Meta spend. Revenue is 340 × $31 = $10,540. Now walk one order down to the bottom:

Per-order line Amount
Average order value (revenue) $31.00
POD product + supplier shipping (COGS) −$12.50
Payment processing (say 2.9% + $0.30) −$1.20
Ad spend per order ($2,800 ÷ 340) −$8.24
Contribution before fixed costs $9.06

Your product COGS is $12.50, so product gross margin is ($31.00 − $12.50) ÷ $31.00 ≈ 60%. That's your "cost of goods sold" number — and notice it's nowhere near the 77% a SaaS business posts, because a printed shirt isn't a copied file.

Where your SaaS subscriptions actually go

The software you run the store on lives below the COGS line. Say your stack is a Shopify plan plus a handful of apps totaling $189 a month. Across 340 orders that's $0.56 per order — a real cost, but an operating expense, not COGS. Folding it into COGS would understate your product margin and hide whether your app spend is worth it.

This is exactly the boundary that trips up sellers migrating off marketplaces or scaling their app stack — the same classification discipline that a purpose-built ecommerce operations platform is designed to enforce so the margin you read is the margin you have.

How to keep the COGS line honest month over month

The formula is easy; the consistency is hard. Three habits keep it clean:

  1. Freeze your definitions. Write down which line items are COGS and which are operating expense, and don't quietly reclassify to flatter a bad month. The same modern classification shift shows up even in machine-learning cost accounting — see the ML cost of goods sold transformation for how compute is migrating into COGS.
  2. Cost every order, not just the month. A blended monthly margin hides the products bleeding money. You want per-order product cost, per-order processing, and per-order ad spend on the same row.
  3. Reconcile against source data, not memory. Supplier invoices, ad-platform charges, and payout fees all drift. Pull the real numbers each month rather than carrying last quarter's estimate forward.

That third habit is where most operators lose the plot — the data lives in five places and none of them agree. Victor, the AI employee inside PodVector AI, connects your Shopify store, Meta Ads, Google Ads, your POD supplier (Printify, Printful, or Gelato), and Klaviyo, then computes true per-order profit from the actual charges — supplier cost, fees, and ad spend — and delivers the reports to Google Drive. Every write action Victor takes is approval-gated, so you review before anything executes. If you want the COGS line reconciled for you instead of rebuilt by hand each month, you can put Victor to work on your store.

FAQs

Is SaaS cost of goods sold the same as cost of revenue?

Effectively, yes, for most SaaS businesses. "Cost of revenue" is the broader accounting label, and for a software company the two are used interchangeably to mean the direct cost of delivering the service — hosting, support, and embedded third-party tooling. The important part isn't the label; it's that only direct delivery costs go in it.

Do software subscriptions count as COGS for my store?

Usually no. If you sell physical product, your COGS is the cost to produce and ship the unit — your POD supplier's charge plus supplier shipping. Shopify, your apps, and your tooling are operating expenses. The exception is a subscription that's a direct input to fulfilling a specific order, which is rare for a typical POD store.

What gross margin should a SaaS business aim for?

Benchmarks cluster around a median near 77%, per CloudZero, with core license revenue often at 80–85%, per SaaS Capital. AI-native products run a few points lower because compute sits in COGS. A physical-goods store will land far lower — often in the 40–65% range on product — and that's normal, because the cost structures aren't comparable.

Does payment processing go in COGS?

For a SaaS business, billing and transactional costs are commonly treated as part of COGS, per CloudZero's component list. For a store, processing fees are a direct variable cost of each sale, so many operators subtract them right alongside product cost when computing per-order contribution — as the worked example above does.

Why does the COGS boundary matter so much?

Because gross margin is the headline number for revenue quality and valuation, and the classification is the margin. Pushing a real delivery cost into operating expense inflates gross margin without changing the business. Keeping the boundary fixed and honest is what makes every downstream metric — contribution, payback, true per-order profit — trustworthy.