Free tool
Gross Margin Calculator
This free gross margin calculator turns your revenue and cost of goods sold into gross profit, gross margin and markup. Flip it round and it works as a gross profit margin calculator for pricing: enter a unit cost and the margin you want, and get the price to charge.
- Margin and markup side by side
- Price for any target margin
- SaaS cost of revenue guide
Calculate your gross margin
Results update as you type. Nothing you enter leaves your browser.
Enter revenue and costs to see your gross profit, gross margin and markup.
Enter a unit cost and the gross margin you want to see the price to charge.
For software, cost of revenue is what it takes to run the service for paying customers. Medians are from SaaS Capital's 2026 spending survey of more than 1,000 private B2B SaaS companies.
Hosting and infrastructure
Cloud servers, storage and bandwidth that run the product. Median 5% of ARR.
DevOps for production
Engineers keeping the live service running. Median 4% of ARR.
Third-party software per customer
APIs, data feeds or licences you pay for as usage grows.
Payment processing fees
Card and payment provider fees on every invoice you collect.
Customer support
Support and success staff and tools. Median 9% of ARR for support and success together.
Onboarding and implementation
Setup and training for new customers. Professional services cost overall: median 5% of ARR.
Not cost of revenue: sales and marketing, research and development, and general and administrative costs.
What is gross margin?
Gross margin shows how much each sale contributes towards everything else the business pays for: salaries outside production, rent, marketing, research and profit. It is the first margin investors look at, because it caps how profitable a company can become at scale.
How do you calculate gross profit margin?
Three formulas cover it, plus a fourth to go from a target margin back to a price. The worked numbers use the same $100 sale with a $40 direct cost throughout.
Step 1: gross profit
Gross profit = Revenue − Cost of goods sold
$100 − $40 = $60 of gross profit.
Step 2: gross margin
Gross margin % = Gross profit ÷ Revenue × 100
$60 ÷ $100 × 100 = 60% gross margin.
Markup
Markup % = Gross profit ÷ Cost of goods sold × 100
$60 ÷ $40 × 100 = 150% markup.
Price for a target margin
Price = Unit cost ÷ (1 − target margin)
$40 ÷ (1 − 0.60) = $100 for a 60% margin.
What is the difference between gross margin, markup and net margin?
All three describe profit on a sale, but they divide by different things and take away different costs. Across US-listed companies in January 2026, the gross margin was 37.76% and the net margin 9.74% (Aswath Damodaran, NYU Stern), which shows how much sits between the two.
| Measure | Formula | Costs taken away | $100 sale, $40 direct cost |
|---|---|---|---|
| Gross margin | Gross profit ÷ revenue | Direct cost of what you sold only | 60% |
| Markup | Gross profit ÷ cost | Direct cost only, measured against cost instead of price | 150% |
| Net margin | Net profit ÷ revenue | Every cost: operating expenses, interest and tax | 15% if other costs total $45 |
How do you convert markup to margin?
Margin = markup ÷ (1 + markup). Markup is always the bigger number, so quoting one when you mean the other overstates or understates your profit.
| Markup | Gross margin |
|---|---|
| 25% | 20% |
| 50% | 33.33% |
| 100% | 50% |
| 150% | 60% |
| 300% | 75% |
What is a good gross margin?
A good gross margin is one at or above businesses that sell the same kind of thing, because direct costs differ so much between industries. A grocer and a software company can both be healthy at margins 45 points apart. The figures below are industry gross margins for US-listed companies from Aswath Damodaran, NYU Stern, with data as of January 2026; the whole market came to 37.76% across 5,994 companies.
The table shows 12 of the 94 industries in the source. The full range runs from 9.31% for basic chemicals to 78.61% for retail property trusts, leaving out banks, which report almost no cost of sales.
| Industry (US-listed companies) | Gross margin | Companies |
|---|---|---|
| Software (system and application) | 71.72% | 309 |
| Software (internet) | 62.58% | 29 |
| Apparel | 56.88% | 35 |
| Advertising | 36.24% | 52 |
| Business and consumer services | 33.38% | 155 |
| Retail (general) | 33.18% | 23 |
| Restaurants and dining | 32.24% | 64 |
| Retail (grocery and food) | 26.31% | 15 |
| Computer services | 24.26% | 64 |
| Food processing | 23.23% | 78 |
| Engineering and construction | 15.46% | 48 |
| Auto and truck | 10.41% | 33 |
What is a good gross margin for SaaS?
In the Aleph and Benchmarkit 2026 benchmarks, a study of 342 B2B software companies in which 228 to 232 reported gross margin, the median software gross margin for full-year 2025 was 80% and the top quarter of companies cleared 86%. Adding services and other revenue brought the blended median down to 76%, and companies priced purely on usage ran lower, at 62%.
If your software margin sits well below these, check what you count as cost of revenue first (the SaaS list in the calculator above), then look at hosting costs and how much onboarding work you give away.
How can you raise your gross margin?
There are only two levers: charge more for each sale, or spend less to deliver it. These are the ways to pull them.
01
Raise prices
A price rise drops straight to gross profit. Use the "Price for a target margin" tab to see the price your target margin needs.
02
Cut the direct cost per unit
Renegotiate supplier and hosting contracts, commit to volume in return for lower rates, and remove waste and returns.
03
Sell more of what earns most
Your overall margin is a mix of every product. Steering sales towards higher-margin products lifts it without changing any single price.
04
Charge for services you give away
Free onboarding, setup and custom work sit in cost of revenue. Price them, or make them self-serve.
05
Automate support
Help centres, in-product guides and better onboarding reduce the support time each customer needs.
06
Watch usage-heavy customers
Where a few customers drive most of your hosting or third-party costs, add usage tiers so price follows cost.
Gross margin calculator FAQs
It depends on what you sell. Among the 94 US industries in Aswath Damodaran's January 2026 data (NYU Stern), gross margins run from 9.31% for basic chemicals to 78.61% for retail property trusts, leaving out banks, which report almost no cost of sales. System and application software sits at 71.72% and the whole market at 37.76%. For SaaS, the median software gross margin for full-year 2025 was 80% in the Aleph and Benchmarkit 2026 benchmarks. Compare yourself with businesses that sell the same kind of thing.
Subtract cost of goods sold from revenue to get gross profit, then divide gross profit by revenue and multiply by 100. With $100,000 of revenue and $40,000 of cost of goods sold, gross profit is $60,000 and the gross profit margin is 60%.
No. Both start from gross profit, but gross margin divides it by the selling price and markup divides it by the cost. A product that costs $40 and sells for $100 has a 60% gross margin and a 150% markup. Mixing them up is a common pricing mistake: a 50% markup is only a 33.33% margin.
The direct costs of producing or delivering what you sold: materials, the labour that makes the product, inbound shipping and, for software companies, the cost of running the service for customers (hosting, third-party software used per customer, payment processing fees, customer support and onboarding). Head-office rent, marketing, sales salaries and research and development sit below gross profit as operating expenses.
Gross margin only takes away the direct cost of what you sold. Net margin takes away every cost, including salaries outside production, rent, marketing, interest and tax, so it is always lower when those costs exist. Across US-listed companies in January 2026, the gross margin was 37.76% and the net margin 9.74% (Aswath Damodaran, NYU Stern).
Yes. If cost of goods sold is higher than revenue, gross profit is below zero and so is the margin. It means you lose money on each sale before paying for anything else, which no amount of volume will fix. Raise prices or cut the direct cost per unit first.
Divide your unit cost by one minus the target margin written as a decimal. For a $40 cost and a 60% target margin, the price is $40 ÷ 0.4 = $100. Use the "Price for a target margin" tab of this calculator to do it for any cost and margin below 100%.
Usually, yes. Benchmark surveys such as the KeyBanc Capital Markets private SaaS company survey count customer support in cost of revenue, so leaving it out makes your gross margin look better than the figures you compare it with. Whatever you choose, keep it the same each month.
Related Startup Finance Tools
LTV Calculator
Turn your gross margin into margin-adjusted customer lifetime value and an LTV:CAC ratio.
Customer Acquisition Cost Calculator
Work out what each new customer costs you in sales and marketing spend.
Break-Even Calculator
Find the revenue you need each month to cover your costs at your current margin.
Runway Calculator
See how many months of cash you have left at your current burn rate.