Gross Margin for B2B SaaS Startups: 2026 Guide

Gross margin defines how much revenue is left to fund growth.

Gross Margin for B2B SaaS: What Counts as COGS and Why AI Products Struggle to Hit 80%

Gross margin — revenue minus cost of revenue, divided by revenue — is one of the most consequential and most inconsistently calculated metrics in B2B SaaS. Traditional SaaS benchmarks (75-85%) don't apply cleanly to AI-heavy products, high-touch enterprise deployments, or vertical SaaS with meaningful implementation costs. Getting the calculation right — and knowing your realistic benchmark — is prerequisite to running any other unit economics math.

What belongs in COGS

Hosting and infrastructure (AWS, GCP, Azure). Third-party APIs consumed on behalf of customers (LLM inference, payment processing, SMS/email, data providers). Customer support headcount (tier 1 + tier 2 support, not solutions engineering). Customer success headcount tied to a specific delivery obligation (implementation, onboarding, technical account managers — this is debated). Software licenses for tools embedded in the product delivery (not internal-use software). Data storage and CDN costs. Not COGS: R&D, sales, marketing, G&A, executive team, general CS not tied to specific customer delivery.

Traditional SaaS benchmarks

Horizontal SaaS with self-serve product: 80-85% (Slack, Notion, HubSpot). Vertical SaaS with moderate implementation: 70-80% (Toast, Procore, Veeva). Infrastructure SaaS (databases, observability): 70-78% (Snowflake, Datadog). Marketplace or transactional models: 40-60% (Shopify Payments, Stripe). Below-benchmark gross margins are fixable but require deliberate work — infrastructure optimization, pricing power, and reducing human-touch delivery.

Why AI products struggle

AI-heavy products routinely see 50-70% gross margins because LLM inference costs are meaningful and often not fully passed through to customers. A product where each user query costs $0.05-0.50 in inference and is priced at $0.10-1.00 has gross margin below traditional SaaS. Levers to improve: use smaller/cheaper models where quality allows, cache repeated queries, batch inference, negotiate committed-use pricing with providers, price with usage tiers that pass cost through at scale, invest in in-house models for high-volume workloads.

The pricing power lever

Gross margin is not just a cost problem — it's a pricing problem. Products with strong pricing power (few substitutes, high switching cost, high value) can raise prices to absorb COGS increases. Products with weak pricing power (commodity features, easy switching, unclear value) can't. If your gross margin is below benchmark, first ask whether the product is priced correctly for the value delivered before optimizing costs. Under-priced products chronically look like margin problems but are actually pricing problems.

The high-touch trap

Startups often win early enterprise deals by promising heavy implementation and dedicated support. This produces revenue but compresses gross margin to 55-70%. The trap: this feels fine at $5M ARR ("we're building relationships") but becomes structural at $20M ARR because customer expectations are set and reducing service is impossible without churn. Fix early: productize implementation, self-serve onboarding paths, tiered support levels. Adding these at scale is 10x harder than building them from the start.

Common mistakes

Excluding customer success or support from COGS (inflates gross margin 5-15 points). Excluding third-party APIs (understates true COGS). Not tracking gross margin by product line (masks unhealthy products). Reporting best-case gross margin from a specific segment as the company number. Not passing through variable costs (AI inference, usage-based charges) in pricing.

Frequently asked questions

Should customer success be in COGS?
Debated. Best practice: CSMs whose role includes delivering a specific outcome (implementation, technical account management, dedicated support) are in COGS. CSMs whose role is renewal/expansion are in S&M. Publishing this policy prevents finance teams from moving costs around to hit targets.
What if we're below benchmark — how fast should we fix it?
Depends on stage. Below $5M ARR, focus on pricing and product-market fit over margin optimization. $5-20M ARR, margin should be improving each year toward benchmark. $20M+ ARR, sub-benchmark margin will show up in valuation multiples — fix it as a strategic priority.
Are gross margins recoverable if they start low?
Yes but with real work. Companies that improved margins 10-20 points over 24-36 months (Datadog, Elastic, MongoDB early years) did so through infrastructure investment, pricing changes, self-serve options, and reducing high-touch delivery. Requires CFO + CTO + CRO alignment.

Related fundraising guides (40)

Investor directory · Fundraising library · Articles A–Z · Company funding database