Skip to main content
SaaSCity.io
DirectoriesLive LaunchesBlogWrite for UsAdvertise
Submit
HomeFree toolsMargin calculator

Free calculator

Margin calculator for profit, gross and SaaS margin

Get profit margin from cost and price, the price that hits a target margin, gross and net margin from your P&L, SaaS gross margin from real cost lines, and your break-even point.

Updated October 27, 2026

Your numbers

What one unit costs you to make, buy or deliver.

$

What the customer pays, before sales tax or VAT.

$

Runs in your browser. Nothing you type is sent or stored.

Profit margin

40%

$48 profit on a $120 price.

Profit per unit
$48
Markup
66.67%

Where the price goes

  • Cost$72
  • Profit$48

Margin = profit ÷ price = $48 ÷ $120 = 40%

Markup = profit ÷ cost = $48 ÷ $72 = 66.67%

The same $48 is 40% of the price and 66.67% of the cost. Margin divides by the price and markup by the cost, so margin is always the smaller number.

Quick answer

How do you calculate profit margin?

Profit margin = (price − cost) ÷ price × 100. A product that costs $72 and sells for $120 makes $48 of profit, a 40% margin. Gross margin is revenue minus the cost of goods sold, divided by revenue; net margin takes off every expense, interest and tax included. To hit a target margin, price = cost ÷ (1 − margin): a 40% margin on a $72 cost needs a $120 price.

How to use the margin calculator

  1. Pick a mode

    Margin for one product, Price to hit a target margin, Net margin for a full P&L, SaaS for subscription gross margin, Break-even for the units you need to sell.

  2. Enter your numbers

    Cost and price for one unit, or revenue and costs for one period. Keep every amount to the same month, quarter or year.

  3. Read the result

    See the margin, the markup behind it, and where each part of the price or revenue goes.

  4. Share it

    Copy the link to send the exact numbers to a cofounder or your accountant. Nothing is stored on our side.

How the calculator works

Margin is profit as a share of the selling price: (price − cost) ÷ price. Markup is the same profit as a share of cost: (price − cost) ÷ cost. A $72 item sold at $120 has a 40% margin and a 66.67% markup. Both describe the same $48.

Gross margin takes only the cost of goods sold off revenue. Operating margin also takes off operating expenses such as salaries, marketing and rent. Net margin takes off everything, interest and tax included, so it is the smallest of the three.

For a SaaS company, cost of revenue is what it costs to serve customers: hosting, AI inference, card fees, support and the third-party services that grow with usage. Card fees are the percentage fee on MRR plus the fixed fee times the number of charges. Sales, marketing and product development sit below gross profit, in operating expenses.

Break-even units are fixed costs ÷ (price − variable cost per unit), rounded up to a whole unit. Break-even revenue is fixed costs ÷ the contribution margin ratio.

Formula
Margin = (price − cost) ÷ price × 100 Price for a target margin = cost ÷ (1 − margin) Gross margin = (revenue − COGS) ÷ revenue × 100 Net margin = net profit ÷ revenue × 100 Break-even units = fixed costs ÷ (price − variable cost per unit)

Worked example

  1. A product costs $72 and sells for $120: profit is $120 − $72 = $48.
  2. Margin: $48 ÷ $120 = 40%. Markup: $48 ÷ $72 = 66.67%.
  3. For a 50% margin instead: $72 ÷ (1 − 0.50) = $144.
  4. A SaaS at $40,000 MRR spends $9,500 a month serving customers: gross margin is ($40,000 − $9,500) ÷ $40,000 = 76.25%.
  5. With $10,000 of fixed costs and $20 of contribution per unit ($50 price − $30 variable cost), break-even is $10,000 ÷ $20 = 500 units.

SaaS gross margin benchmarks

Published figures to compare the SaaS mode against. Each source counts cost of revenue its own way, so read them as reference points, not targets.

MeasureBenchmarkSource
SaaS subscription revenue: median gross margin81%Benchmarkit, 2025 B2B SaaS Performance Metrics Benchmarks
SaaS total revenue, services included: median gross margin77%Benchmarkit, 2025 B2B SaaS Performance Metrics Benchmarks
Professional services revenue: median gross margin30%Benchmarkit, 2025 B2B SaaS Performance Metrics Benchmarks
AI “Shooting Stars” (fast, efficient AI companies): gross marginAbout 60%Bessemer Venture Partners, The State of AI 2025
AI “Supernovas” (fastest-growing AI companies): average gross marginAbout 25%, often negativeBessemer Venture Partners, The State of AI 2025
Hosting: median spend as a share of ARR5%SaaS Capital, 2026 spending benchmarks (1,000+ private B2B SaaS companies)
Customer support and success: median spend as a share of ARR9%SaaS Capital, 2026 spending benchmarks (1,000+ private B2B SaaS companies)

Medians and averages as each source reports them. Last verified 27 October 2026.

Gross margin vs net margin

Gross margin shows whether the product itself makes money: revenue minus the direct cost of delivering it. Net margin shows whether the whole company does, after salaries, marketing, rent, interest and tax. A business can have a strong gross margin and still lose money when operating costs run ahead of revenue, which is common for young SaaS companies that hire before they sell.

What counts as cost of revenue in SaaS

CostIn cost of revenue?Why
Hosting and infrastructureYesServing customers needs it every month.
AI model and GPU costs for customer featuresYesEvery customer request costs money to answer.
Card and payment processing feesYesTaken from every charge.
Customer support and onboardingUsuallyKeeps paying customers running. Some companies book it as an operating expense; say which.
Third-party APIs inside the productYesUsage grows with customers.
Sales and marketingNoWins new customers: an operating expense.
Product developmentNoBuilds the product rather than delivering it: an operating expense.
Tools for your own teamNoGeneral and administrative expense.

How AI features change SaaS margins

Classic SaaS costs little to serve one more customer, which is why its gross margins are high. AI features add a cost to every request, in model API fees or GPU time. Bessemer’s State of AI 2025 found gross margins of about 60% for fast, efficient AI companies and about 25% on average for the fastest-growing ones, against a median of 81% on SaaS subscription revenue in Benchmarkit’s 2025 survey. Track AI inference as its own cost line and price heavy usage separately.

Margin questions

How do I calculate profit margin?
Subtract cost from price, divide by price and multiply by 100. A $120 sale that cost $72 leaves $48 of profit: $48 ÷ $120 = 40% margin.
What is the gross margin formula?
Gross margin = (revenue − cost of goods sold) ÷ revenue × 100. With $500,000 of revenue and $150,000 of cost of goods sold, gross profit is $350,000 and gross margin is 70%.
What is the difference between gross profit and gross margin?
Gross profit is an amount: revenue minus cost of goods sold. Gross margin is that amount as a percentage of revenue. $350,000 of gross profit on $500,000 of revenue is a 70% gross margin.
How do I calculate net profit margin?
Divide net profit by revenue and multiply by 100. Net profit is revenue minus every cost: goods, operating expenses, interest and tax. $80,000 of net profit on $500,000 of revenue is a 16% net margin.
What is a good profit margin?
It depends on the industry and on which margin you mean. For SaaS, Benchmarkit’s 2025 survey puts the median gross margin on subscription revenue at 81%. Compare yourself with businesses that sell the same way, and watch your trend over several months.
How do I price a product for a 30% margin?
Divide the cost by 1 minus the margin: price = cost ÷ 0.70. A $70 cost needs a $100 price for a 30% margin. Adding 30% to the cost gives $91, which is only a 23% margin.
Is margin the same as markup?
No. Margin is profit divided by the selling price; markup is profit divided by cost. The same $48 profit on a $72 cost and a $120 price is a 40% margin and a 66.67% markup.
How do I calculate the break-even point?
Divide fixed costs by the contribution per unit, which is the price minus the variable cost per unit. $10,000 of fixed costs at $50 a unit with $30 of variable cost needs $10,000 ÷ $20 = 500 units.
What is contribution margin?
What each sale adds towards fixed costs and profit: price minus variable cost per unit. Divide it by the price for the ratio. A $50 product with $30 of variable cost has a $20 contribution and a 40% contribution margin.

Related

  • Stripe fee calculator
  • LLM API pricing calculator
  • LTV calculator
  • Claude Haiku 5.5 and AI SaaS margins

Cite this tool

Free to link and quote. Use this reference:

SaaSCity, "Margin Calculator", October 27, 2026. https://saascity.io/free-tools/margin-calculator

Sources

  • OpenStax, Principles of Accounting, Volume 1, 6.6: the gross profit margin ratio
  • OpenStax, Principles of Accounting, Volume 2, 3.1: contribution margin
  • OpenStax, Principles of Accounting, Volume 2, 3.2: break-even point in units and dollars
  • Benchmarkit, “2025 B2B SaaS Performance Metrics Benchmarks”
  • Bessemer Venture Partners, “The State of AI 2025” (13 August 2025)
  • SaaS Capital, 2026 spending benchmarks for private B2B SaaS companies
  • Stripe Support, “Manually entered card payments” (standard US card rate)

More free tools

  • Stripe fee calculatorWhat Stripe, Paddle, Lemon Squeezy and Polar take from each sale, side by side.
  • Burn rate & runway calculatorMonths of cash left, the date it runs out, when to raise, and whether you are default alive.
  • LTV calculatorCustomer lifetime value, CAC, the LTV to CAC ratio and the months it takes to earn back a customer.
  • Domain Rating checkerAny site’s Ahrefs DR in one click, live, with no account.
  • DR badge generatorAn embeddable badge that shows your live Domain Rating.
  • Launch card generatorA shareable card image for your launch post on X and LinkedIn.
  • ARR & MRR calculatorMRR to ARR, ARPU, annual plans and the ARR bridge, with months to $1M ARR.
  • Churn rate calculatorCustomer and revenue churn, monthly to annual done right, and the signups you need to stand still.
All free tools

Find customers without ad spend eating your margin

List your product on SaaSCity: a hand-reviewed listing, a launch week and a permanent page on a DR 70 domain.

Submit your product
SaaSCity.io

Directories are boring. We built a city instead. First isometric SaaS directory on the planet.

Platform
Submit SaaSLive LaunchesPricingBlogWrite for UsMCP for AgentsAdvertiseAboutghosty
Directories
Best SaaS DirectoriesBest AI DirectoriesDirectory ReviewsBest Indie Hacker CommunitiesBest Subreddits for FoundersHow to Get SaaS BacklinksSEO GlossaryHow to Submit to DirectoriesDirectory Submission ServiceDirectory Submission Services Compared
SaaSCity Alternatives
All ComparisonsSaaSCity vs Nick LaunchesSaaSCity vs BetterLaunchSaaSCity vs PeerPushProduct Hunt AlternativesSaaSHub Alternatives
Legal
Terms of ServicePrivacy PolicyRefund PolicyCookie PolicyCopyright & DMCASecurityContact
Free Tools
ARR calculatorSaaS valuationChurn calculatorMargin calculatorTAM SAM SOMLLM API pricingDR checkerRobots.txt generatorPNG to ICOAll 14 tools →

© 2026 SaaSCity.io

llms.txt