Cost of goods sold for a SaaS company covers every direct expense tied to delivering the software to paying customers. That means hosting and infrastructure, third-party service fees embedded in the product, wages for the people who keep the service running and support existing customers, implementation and onboarding labor, payment processing fees, and the amortization of software development work that has been capitalized. Everything that supports the business more broadly — building future features, acquiring new customers, running the back office — stays out.
The classification matters because COGS sits directly below revenue on the income statement and defines gross profit, the line investors examine first when they look at a software business. Push costs into the wrong bucket and gross margin distorts, trend analysis breaks, and in some situations the IRS gets involved.
Hosting and Infrastructure
Cloud hosting is usually the single largest non-labor line in SaaS COGS. Providers like Amazon Web Services, Microsoft Azure, and Google Cloud Platform bill based on compute cycles, storage volume, data transfer, and instance type. These invoices are the digital equivalent of factory rent and utilities. Content delivery network fees belong in the same bucket, because distributing data across geographic nodes is part of delivering the product to end users.
These costs are highly variable. A traffic spike or a large data migration can push a monthly bill up sharply without warning. That variability makes hosting one of the few COGS items where active management directly moves gross margin. Committing to reserved instances instead of on-demand pricing can reduce cloud infrastructure costs by up to 72 percent on a three-year term, at the cost of flexibility.1AWS. What’s the Difference Between On-Demand Instances and Reserved Instances Right-sizing underutilized instances, shutting down non-production environments outside business hours, and negotiating enterprise discount programs are the standard levers.
Amortization of Capitalized Software Development
This is the COGS item that trips up the most founders. When your engineering team builds features that go into the production product, accounting rules require you to capitalize certain development costs and then amortize them over the software’s useful life. That amortization expense flows through COGS rather than R&D, because it represents the cost of what customers are using today.
Under GAAP, specifically ASC 350-40 for internal-use software, the development process breaks into three stages. Preliminary project costs, where you’re evaluating alternatives and deciding whether to proceed, are expensed immediately as R&D. Application development costs — actual coding, configuration, and testing — get capitalized on the balance sheet. Post-implementation costs like maintenance and minor updates go back to being expensed as incurred. The capitalized amount then amortizes on a straight-line basis over the product’s expected useful life, and that recurring charge lands in COGS each period.
The practical effect is that a heavy build year doesn’t crush gross margin in a single quarter. The cost spreads across the periods where customers actually benefit from the work. If a company reports unusually high gross margins while capitalizing aggressively, a careful investor will add back the amortization to see the underlying economics.
Third-Party Software and API Fees
Most SaaS products rely on external services embedded directly into the user experience. If your application uses a mapping API, a payment gateway, a communications platform like Twilio, or a data enrichment service, the fees are COGS. The test is simple: would removing the service break or meaningfully degrade a customer-facing feature? If yes, it belongs in COGS.
These fees often scale with usage. A customer who triggers 10,000 API calls generates more third-party cost than one who triggers 100, which can make per-customer unit economics tricky to pin down without good telemetry. Internal tools that run the business rather than deliver the product — an HR system, project management software, the internal Slack instance — are operating expenses and stay out of COGS.
DevOps, Support, and Customer Success Personnel
People costs are typically the second-largest component of SaaS COGS after hosting. Three groups usually qualify:
- DevOps and site reliability engineers, who keep production running, manage deployments, handle incidents, and monitor uptime.
- Technical support staff, meaning the engineers and agents who troubleshoot issues, resolve bugs, and answer tickets for existing customers.
- Customer success managers whose primary function is helping existing customers get value from the product — adoption, retention, renewal — rather than selling new accounts.
The wages you include are not just base salary. Employer payroll taxes add 7.65 percent on top (6.2 percent for Social Security and 1.45 percent for Medicare), plus health insurance, retirement contributions, and any other benefits tied to those roles.2Internal Revenue Service. Publication 926 (2026), Household Employer’s Tax Guide
When someone splits time between COGS-eligible work and other functions, the standard practice is to allocate compensation proportionally. If a customer success manager spends 60 percent of her time on post-sale support and 40 percent on upselling, only the 60 percent portion goes into COGS. Accurate time tracking makes or breaks that allocation. Service level agreements often commit you to specific uptime guarantees and response times, and the labor needed to meet those commitments belongs in the same bucket.
Implementation and Onboarding
Getting a new customer live on the platform often requires dedicated technical work: configuring their environment, migrating data from a legacy system, building integrations, and training their team. The labor behind these activities is a direct cost of producing revenue from that customer, which puts it in COGS. Project managers, implementation engineers, and trainers who spend their time on these efforts all contribute here.
These costs are one-time per customer but repeat with every new deal, so they scale with bookings volume. Leaving them out inflates gross margin and creates a misleading picture of delivery economics — exactly the kind of distortion that erodes credibility during due diligence.
The matching principle under GAAP requires you to recognize these costs in the same period as the related revenue. For large implementations where revenue is recognized over the life of a multi-year contract, the associated costs may need to be deferred and amortized on the same schedule rather than expensed upfront.
Payment Processing Fees
Every subscription payment passes through a processor, and the processor takes a cut. Credit card processing fees generally range from about 1.3 percent to 3.5 percent of the transaction amount, plus a flat per-transaction fee of roughly 10 to 30 cents. Online transactions, which is how most SaaS billing works, tend to land on the higher end of that range because of the elevated fraud risk compared to in-person swipes. Companies processing over $10,000 per month can often negotiate better rates through interchange-plus pricing rather than flat-rate models.3CO- by US Chamber of Commerce. The Best Credit Card Processors for Small Business
These fees are a direct consequence of collecting revenue, so they belong in COGS. At scale they add up. A company processing $10 million in annual recurring revenue at a 2.9 percent rate spends $290,000 a year on payment processing alone. Offering ACH or wire transfer options for enterprise customers can reduce that cost substantially, since bank transfers carry much lower per-transaction fees.
What Stays Out of COGS
Knowing what to exclude matters as much as knowing what to include. The general rule: if the expense supports the business broadly rather than delivering the product to a specific customer, it’s an operating expense.
- Research and development. Engineers building new features, exploring new product lines, or working on prototypes are creating future value, not delivering today’s product. Their salaries belong in R&D operating expenses. The exception is the capitalized software amortization discussed above, which moves into COGS once the feature is live.
- Sales and marketing. Commissions, advertising, lead generation tools, and the salaries of account executives are customer acquisition costs. They go in operating expenses regardless of how directly they seem tied to revenue.
- General and administrative. Finance, legal, HR, executive compensation, office rent, and internal IT all sit here. These keep the company running but don’t deliver software to end users.
The common gray area is customer success roles that also handle upselling. If a role is genuinely split, allocate proportionally. If the primary function is expansion revenue rather than retention and adoption support, the role belongs in sales expense. Stuffing costs into operating expenses to keep COGS artificially low makes gross margins look strong until a potential acquirer or investor recalculates using their own assumptions.
Why the Classification Matters
Gross margin is revenue minus COGS, and it’s the number investors use to judge how much of each revenue dollar is available to fund growth. Consistent classification across periods matters too. Reclassifying expenses between COGS and operating costs from quarter to quarter makes trend analysis impossible, and auditors will flag it. Pick a defensible methodology, document it, and stick with it.
There’s a tax dimension as well. For federal income tax purposes, the distinction between COGS and operating expenses usually doesn’t change the total amount you deduct, but it changes where and how those deductions appear, and certain credits and limitations reference gross income. The bigger risk for SaaS companies is the line between COGS and research expenditures under Section 174 of the Internal Revenue Code. For tax years beginning after December 31, 2024, the One Big Beautiful Bill Act created a new Section 174A that restores immediate deductibility for domestic research and experimental expenditures, including software development costs. Companies can now choose to deduct the full amount in the year incurred, capitalize and amortize over at least 60 months, or elect a flat 10-year amortization period. Foreign R&D expenses must still be capitalized and amortized over 15 years.4Internal Revenue Service. One, Big, Beautiful Bill Provisions
Misclassifying an operating expense as COGS, or vice versa, generally won’t change total tax liability if the deduction timing is the same. But if the misclassification causes you to understate taxable income, such as deducting a capital expenditure immediately rather than amortizing it, the IRS can impose an accuracy-related penalty of 20 percent on the resulting underpayment, and interest accrues on top of the penalty until it’s paid.5Internal Revenue Service. Accuracy-Related Penalty For a fast-growing SaaS company with significant development costs, getting the R&D-versus-COGS allocation right is worth the cost of professional tax advice.