Cost of Goods Sold for a SaaS company covers every expense directly tied to delivering the software service to paying customers today: cloud hosting and infrastructure for the production environment, third-party APIs and data feeds baked into the product, payment processing fees, the people who keep the live service running, and amortization of capitalized software development costs. GAAP does not prescribe a specific COGS definition for SaaS, so the line between cost of revenue and operating expense comes down to judgment applied consistently. Getting SaaS COGS right matters because gross margin is the single metric that most influences how investors value the business, and misclassification in either direction distorts it.
Hosting and Infrastructure
Cloud spending is usually the largest single COGS line. Every dollar you spend on AWS, Azure, or Google Cloud compute, storage, and data transfer for the production environment belongs in cost of revenue. The word doing the work is “production.” Development, staging, and QA environments are R&D expenses, not COGS.
If you run your own data centers, the equivalents are rack space, power, cooling, physical security, and depreciation on the servers running the production application. Bandwidth and CDN fees also land in COGS because they scale directly with customer usage. Monitoring and security tools used exclusively for production count as well; tools that also cover development need to be allocated proportionally.
Separating Production From Everything Else
Your COGS figure is only as accurate as your ability to isolate production spending inside a cloud bill that contains everything else. The standard approach is separate accounts for production and non-production, plus mandatory tags such as “Environment” and “Cost Center” on every resource. AWS supports separate accounts within an Organization with cost filtering in Cost Explorer, Azure uses resource groups and tags, and Google Cloud uses folders in its resource hierarchy. Cost allocation tags are not retroactive: resources spun up untagged become unattributable noise, so the tagging strategy needs to exist before you need the data.1Amazon Web Services. Building a Cost Allocation Strategy – Best Practices for Tagging AWS Resources
Third-Party Services, APIs, and Payment Processing
Any third-party software or data feed embedded in what you deliver is a COGS item. The working test: if the vendor’s service stopped, would the customer experience degrade immediately? Mapping APIs, communication platforms like Twilio, data enrichment providers, and hosted search infrastructure all pass that test.
AI model APIs sit in the same bucket but behave differently. Calls to providers like OpenAI or Anthropic that power customer-facing features are COGS, and inference costs scale with both user count and usage intensity. A single power user running complex queries can consume more inference budget than hundreds of light users, which makes forecasting harder than conventional hosting. Companies integrating AI features into an otherwise traditional SaaS product should track AI-related COGS as a distinct sub-category so the cost of those features is visible at the margin level.
Payment processing fees from Stripe, Braintree, and similar providers belong in COGS on the same logic. Stop processing payments and you stop delivering the service. Some companies bury them in G&A; at scale, the percentage-based fees consume a meaningful slice of margin regardless of where they are booked, and putting them in COGS keeps the picture honest.
People Whose Work Keeps the Service Running
Personnel is where SaaS COGS classification gets contentious. The rule in theory is simple: if an employee’s primary job is keeping the production service running for current paying customers, their fully loaded compensation belongs in COGS. Fully loaded means base salary plus the employer’s share of payroll taxes, health insurance, retirement contributions, and other benefits. In practice, drawing the line requires honest time tracking.
Roles That Belong in COGS
Site Reliability Engineers and DevOps staff managing production infrastructure, deployments, and incident response are the clearest cases. Customer support handling technical troubleshooting, bug triage, and platform guidance belongs here too; these teams exist because the product exists, and headcount scales with customer count. Implementation and onboarding specialists qualify when their work is technical setup and configuration of the production environment for a new customer. Once their time shifts to training users on features or providing strategic advice, that portion crosses into S&M or G&A, and mixed roles need to be split by time allocation.
The Customer Success Judgment Call
Customer Success Managers sit in the middle. What the team actually does day-to-day matters more than what the org chart says. A CSM function focused on retention, satisfaction, product engagement, and enablement is reasonably part of the product experience, and its costs fit in COGS. A CSM function focused on renewals as a booking event, upsell, and cross-sell is a sales function and belongs in S&M. Many companies have CSMs doing both, and lumping the whole team into one bucket is one of the most common ways gross margin gets inflated or deflated.
Who Does Not Belong
Engineers building new features, product managers designing future capabilities, and designers working on unreleased functionality are R&D, not COGS. Even when an SRE occasionally contributes to a new feature sprint, that portion of time should be tracked separately and expensed as R&D. The test is whether the work maintains the current service or creates something new.
Amortization of Capitalized Development
When engineering builds software that powers the production service, some of those development costs are capitalized under GAAP and amortized over the software’s useful life, with the amortization expense flowing into COGS. Under the accounting standards for internal-use software, costs are capitalized once management has authorized and committed to funding the project and it is probable the software will be completed and used as intended.2Financial Accounting Standards Board. ASU 2025-06 Internal-Use Software (Subtopic 350-40)
Eligible costs include external costs for materials and services consumed in development, payroll and benefits for employees directly working on the project (proportional to time spent), and related interest. Early-stage exploratory work and post-launch maintenance are expensed immediately.2Financial Accounting Standards Board. ASU 2025-06 Internal-Use Software (Subtopic 350-40) A company that capitalizes significant development and amortizes it through COGS will show a different margin profile than one that expenses everything through R&D. Neither approach is inherently wrong. Consistency year over year matters more than the method chosen, and investors doing diligence will dig into the policy to see what the margin looks like under different assumptions.
What Does Not Belong in SaaS COGS
Everything that doesn’t directly support delivering the current production service to today’s paying customers is an operating expense. The three standard buckets are R&D, S&M, and G&A.
R&D covers building new features, developing new product lines, and architectural work beyond what’s needed to keep the current service running. Salaries for engineers, product managers, and designers doing forward-looking work all land here.
S&M covers sales compensation, commissions, advertising, marketing campaigns, trade shows, and CRM subscriptions. Account managers whose primary function is driving renewals and expansion revenue belong here rather than in COGS.
G&A captures the overhead of running the business: executive compensation, finance, HR, legal, corporate rent, and professional fees for auditors and outside counsel. These costs exist whether you have ten customers or ten thousand, and keeping them out of COGS ensures gross margin reflects the actual economics of service delivery.
Professional Services Report Separately
If your company earns meaningful revenue from implementation, consulting, or training alongside subscriptions, report that revenue and its associated costs on a separate line from subscription COGS. Implementation is a fundamentally different business than recurring software delivery, and blending the two hides the unit economics of both. Subscription gross margin might be 80% while professional services margin is 10% or negative; a single blended number obscures that software revenue is subsidizing services work.
There is an accounting wrinkle. Under revenue recognition standards, if professional services can’t be sold separately from the subscription, the revenue and related costs may need to be allocated across the expected contract term rather than recognized at delivery. Timing mismatches here compound over quarters.
Gross Margin Benchmarks
Traditional SaaS companies target subscription gross margins of 75% or higher, and that remains the widely cited benchmark for 2026. Companies above 80% have consistently commanded premium valuations, while those below 60% trade at steep discounts; in recent quarters, businesses above 80% traded at roughly double the multiples of those below 60%.
AI-native companies sit lower structurally. Recurring compute and inference costs have put scaling AI companies in a 40% to 60% gross margin range, roughly half of typical SaaS margins, and that reflects the cost structure of AI workloads rather than a maturity problem. Whether inference costs will decline enough over time to close the gap is unsettled.
A few percentage points of misclassification can shift where a company sits on that spectrum. Inflating gross margin by pushing legitimate delivery costs into OpEx falls apart during due diligence; burying operating expenses in COGS makes the business look less efficient than it is. The cleanest posture is a documented COGS policy applied consistently and defensible line by line.