Learn how to calculate gross margin for SaaS and service firms. Our guide includes formulas, benchmarks, and real-world examples to improve profitability.
Your gross margin isn't just a number—it’s the single clearest indicator of your company's scalability and financial health. If you’re a founder steering a business between $500K and $20M in revenue, a weak or inaccurate gross margin signals to investors that your business model has foundational cracks. It reveals how much profit you squeeze from every dollar of revenue before accounting for sales, marketing, and overhead. Get it right, and you prove you have a highly efficient, scalable machine. Get it wrong, and you risk losing credibility during your next funding round.
The formula is simple: (Total Revenue - Cost of Goods Sold) / Total Revenue. But the devil is in the details, specifically in what you classify as your Cost of Goods Sold (COGS).

Stop thinking of gross margin as just another line on your P&L. For you, it’s the ultimate diagnostic tool. It cuts through the noise and answers one critical question: how profitably can you deliver your core product or service?
A high gross margin is proof of a strong, efficient business model—the kind that gets investors excited. A low one signals foundational problems you can't fix by simply spending more on growth. It forces you to confront tough questions about your pricing, delivery costs, and operational drag.
"Revenue growth might catch a buyer’s eye, but gross margin reveals whether you’re building a scalable, efficient SaaS business or masking costly cracks in delivery. For that reason, private equity firms and strategic buyers weigh gross margin heavily." - Noah Dickinson, Software Equity Group
Nailing this metric gives you the power to:
Before you can improve it, you must understand the fundamentals of how to calculate gross profit margin. Let's break down what goes into the formula.
The calculation itself is straightforward, but the two main ingredients—Revenue and Cost of Goods Sold (COGS)—are where founders often get tripped up. Use this table to ensure you’re thinking about them correctly.
| Component | What It Is | Why It Matters to Your Business |
|---|---|---|
| Revenue | The total income generated from sales of your products or services. For SaaS, this is your recognized recurring revenue. | This is the top-line number your entire business operates from. Accuracy here, especially with revenue recognition standards like ASC 606, is non-negotiable. |
| COGS | The direct costs associated with creating and delivering your product or service. This excludes indirect costs like sales commissions or rent. | This is where most mistakes happen. Correctly identifying COGS is the key to an accurate gross margin and understanding your true profitability. |
Getting these two components right is everything. Misclassify one expense as COGS when it should be an operating expense (OpEx), and your entire profitability picture becomes distorted.
For a SaaS founder, gross margin isn't just an accounting line item—it’s the ultimate stress test of your business model's scalability. When investors look at your numbers, this is one of the first they’ll scrutinize. Your Cost of Goods Sold (COGS) isn't about physical inventory; it's the direct, recurring cost of keeping your software live and your paying customers happy.
Getting this number right is non-negotiable. A sloppy calculation can easily hide operational inefficiencies, leading to a brutal surprise during a funding round or due diligence. The goal is to draw a clean line between the costs of running the service and the costs of growing the business.
The trick is to isolate every expense that scales directly with your customer base and service delivery. Everything else—like the money you spend to land a new customer or the salaries for engineers building new features—belongs under Operating Expenses (OpEx).
Here’s exactly what belongs in your SaaS COGS calculation:
Just as important is knowing what to exclude. These are critical business costs, but they are not direct costs of goods sold:
Let’s walk through a realistic scenario. Imagine your SaaS company, "ScaleUp AI," has the following annual financials:
Now, let's tally the annual direct costs that make up your COGS:
| Expense Category | Annual Cost | Included in COGS? |
|---|---|---|
| AWS Hosting | $180,000 | Yes |
| Customer Support Team (Fully Loaded Cost) | $325,000 | Yes |
| Stripe Processing Fees (2.9%) | $59,450 | Yes |
| Third-Party API Fees | $45,000 | Yes |
| R&D Team Salaries | $400,000 | No (OpEx) |
| Sales & Marketing Spend | $500,000 | No (OpEx) |
Your Total COGS is $180,000 + $325,000 + $59,450 + $45,000 = $609,450.
With these numbers, you can calculate your key metrics. First, find your Gross Profit: Gross Profit = Total Recognized Revenue - Total COGS $2,050,000 - $609,450 = $1,440,550
Next, calculate the Gross Margin Percentage: Gross Margin % = (Gross Profit / Total Recognized Revenue) x 100 ($1,440,550 / $2,050,000) x 100 = 70.3%
A 70.3% gross margin is on the lower end for a scalable SaaS model. While not a deal-breaker, it's a signal that you need to investigate your cost structure. According to OpenView's 2024 SaaS Benchmarks, the median gross margin for SaaS companies is 78%, with top-quartile performers hitting 87%. A margin of 70% puts you in the bottom quartile and prompts an immediate review of hosting costs, support team efficiency, and pricing. While gross margin gives a powerful high-level view, you can get a more granular look at profitability by understanding contribution margin.
For agencies and professional services firms, gross margin is the truest measure of client and project profitability. Unlike a SaaS business where the biggest cost is infrastructure, your largest cost is your team. This is a simple but critical distinction.
The main challenge is accurately allocating the cost of your billable talent to your Cost of Goods Sold (COGS). If you get this wrong, you might think a difficult, time-consuming client is profitable when they’re actually an anchor dragging your business down. Your goal is to isolate the direct costs of delivering client work. Every dollar spent fulfilling a contract belongs in COGS. Everything else—from winning new business to paying office rent—is an operating expense.
The heart of COGS for any service business is labor. And not just salaries—the fully-loaded cost. A good rule of thumb: if you couldn't deliver the client work without this specific expense, it's almost certainly a direct cost.
Here’s what you absolutely must include in your agency’s COGS calculation:
What stays out? Indirect overhead. This includes administrative salaries (like your office manager or a non-billable CEO), the rent for your office, and commissions for your sales team. These are the costs of running the business, not delivering the service.
The line between COGS and Operating Expenses can feel blurry, especially when comparing different business models. This table breaks down the typical direct costs for a SaaS company versus a services firm to make the distinction crystal clear.
| Expense Category | Include in SaaS COGS? | Include in Agency/Services COGS? |
|---|---|---|
| Hosting & Infrastructure (AWS, etc.) | Yes | No |
| Customer Support Salaries | Yes | No (Overhead) |
| Onboarding Team Salaries | Yes | Yes (If billable) |
| Billable Team Salaries (Devs, Designers) | No (R&D) | Yes |
| Freelancers & Contractors (Direct Work) | Yes (e.g., specific dev work) | Yes |
| Project-Specific Software | Yes (e.g., integrated tools) | Yes |
| Sales & Marketing Salaries | No (OpEx) | No (OpEx) |
| Administrative & G&A Salaries | No (OpEx) | No (OpEx) |
As you can see, the core difference comes down to labor allocation. In SaaS, R&D labor is an operating expense, while in services, your delivery team's labor is the primary component of COGS.
Let's put this into practice with "Growth Creative," a digital agency. Here are their annual financials:
Now, we need to dig into their direct costs to figure out their COGS.
| Expense Category | Annual Cost | Included in COGS? |
|---|---|---|
| Billable Team Salaries | $525,000 | Yes |
| Billable Team Payroll Taxes & Benefits (25%) | $131,250 | Yes |
| Freelance Designer Fees | $90,000 | Yes |
| Client Project Software | $20,000 | Yes |
| Administrative Salaries | $120,000 | No (OpEx) |
| Office Rent & Utilities | $60,000 | No (OpEx) |
First, we calculate the agency's Total COGS by adding up only the direct costs: $525,000 (Salaries) + $131,250 (Benefits) + $90,000 (Freelancers) + $20,000 (Software) = $766,250
With that number locked in, we can find the Gross Profit: $1,500,000 (Revenue) - $766,250 (COGS) = $733,750
And finally, we calculate the all-important Gross Margin Percentage: ($733,750 / $1,500,000) x 100 = 48.9%
A 48.9% margin is a fantastic sign of a healthy, efficient service business. For context, many agencies operate in the 35-45% range. Hitting nearly 50% indicates strong pricing power, high billable utilization, and tight control over project costs. This isn't just an internal metric; private equity firms often look for margins above 35%, making this calculation vital for any agency considering fundraising or a future exit. This chart illustrates a similar calculation for a SaaS business, breaking down how revenue splits between direct costs and the resulting gross margin.

With $5M in revenue and $1.25M in direct costs (COGS), the business retains a very strong 75% gross margin, leaving a significant chunk of revenue to fund growth and operations. By applying this same disciplined logic, you can perform an agency profitability analysis to calculate true client ROI and finally get a clear picture of which accounts are fueling your bottom line—and which ones are draining it.
Calculating gross margin seems simple, but a few common errors will completely warp your understanding of your company's financial health. An investor or buyer will sniff these out in a heartbeat—and it’s one of the fastest ways to lose credibility during due diligence. It signals you don’t fully grasp the core mechanics of your own business model.

These aren't just minor accounting details. They are foundational mistakes that hide inefficiencies and can lead you to make disastrous decisions about pricing, hiring, and growth.
"A messy gross margin calculation isn't just a math error; it's a sign that the leadership team doesn't truly understand their own business model. If you can't get COGS right, an investor has to question every other number you present." - David Prim, CFO, Jumpstart Partners
Let's walk through the most common traps and how to fix them so your financials are bulletproof.
This is, without a doubt, the number one error. Founders often lump costs related to acquiring customers into the bucket for delivering the service. The classic example? Putting sales commissions in COGS. Sales commissions are a cost of winning a customer, not fulfilling the contract. They belong in your Operating Expenses (OpEx) under Sales & Marketing. Putting them in COGS artificially deflates your gross margin and makes your core service look far less efficient than it is.
For service businesses and SaaS companies, salary allocation is a minefield. The common mistake is dumping 100% of a salary for an employee with a mixed role into a single bucket. For example, if your CTO spends 20% of their time on high-level customer support and 80% on R&D, you must allocate their fully-loaded salary cost accordingly. Putting it all in R&D understates your COGS; putting it all in COGS overstates it.
This one trips up many SaaS companies, especially those with one-time setup fees. The mistake is booking the entire fee as revenue in the month you receive the cash. According to accounting standards like ASC 606, that revenue must be recognized over the expected lifetime of the customer. Booking it all at once gives you a misleading spike in revenue and gross margin, creating a lumpy financial picture that is a massive red flag for any investor. For a deeper dive, review our guide to SaaS revenue recognition under ASC 606.
Once you have an accurate gross margin, the real work begins. This number is a powerful lever for making smarter, faster decisions. Think of a healthy gross margin as the fuel for your growth engine—it’s the cash your core operations generate that you can reinvest in sales, marketing, and R&D.
Your next steps should be to:
By treating gross margin as a strategic KPI, you move from reactive problem-solving to proactive, data-driven leadership.
As a founder, you're not just looking for definitions; you're looking for answers that apply to your business. Here are the most common questions we hear from CEOs.
This is the question, and the answer is always, "It depends." There's no universal "good" number, but there are clear industry benchmarks that investors will use to judge you.
At an absolute minimum, you must calculate this monthly. This isn't an annual check-up. Gross margin is a core vital sign of your business's health. Tracking it monthly lets you spot trends before they become disasters. A slowly eroding margin is the classic canary in the coal mine—it signals creeping inefficiency long before it blows up your annual P&L.
They sound similar, but they tell you two very different stories about your business.
To get a hands-on feel for how these numbers play out, a retail profit margin calculator can be a useful tool for modeling different scenarios. While both metrics are important, for assessing the fundamental health and scalability of your business, gross margin is king.
Your gross margin isn't just a number on a spreadsheet—it's a direct reflection of your business's health and its readiness to scale. Getting it right is non-negotiable. At Jumpstart Partners, we provide US-based, CPA-certified controller services to give you investor-ready financials with a guaranteed 5-day month-end close.
Stop guessing and get the financial clarity you need to grow confidently.