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.

Sales for the period, before any costs.
Direct cost of what you sold in the same period.

Enter revenue and costs to see your gross profit, gross margin and markup.

What is gross margin?

Direct Answer: Gross margin is the share of revenue left after paying the direct cost of what you sold. Gross margin = (revenue − cost of goods sold) ÷ revenue × 100. A business with $100,000 of revenue and $40,000 of cost of goods sold has $60,000 of gross profit and a 60% 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.

MeasureFormulaCosts taken away$100 sale, $40 direct cost
Gross marginGross profit ÷ revenueDirect cost of what you sold only60%
MarkupGross profit ÷ costDirect cost only, measured against cost instead of price150%
Net marginNet profit ÷ revenueEvery cost: operating expenses, interest and tax15% 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.

MarkupGross 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 marginCompanies
Software (system and application)71.72%309
Software (internet)62.58%29
Apparel56.88%35
Advertising36.24%52
Business and consumer services33.38%155
Retail (general)33.18%23
Restaurants and dining32.24%64
Retail (grocery and food)26.31%15
Computer services24.26%64
Food processing23.23%78
Engineering and construction15.46%48
Auto and truck10.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.

  1. 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.

  2. 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.

  3. 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.

  4. 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.

  5. 05

    Automate support

    Help centres, in-product guides and better onboarding reduce the support time each customer needs.

  6. 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