Free calculator

Gross Margin Calculator

Enter your revenue and cost of goods sold to get your gross margin. Or watch Claude or ChatGPT work it out from a real set of books, and say why it moved.

Work it out here

Total sales for the period, before any costs.

What it cost to make or buy what you sold.

Example figures. Type over them with your own.

Damodaran, NYU Stern, January 2026, 5,994 US firms.

Gross margin

39.9%

Gross profit

$178,000

Get your real margin from your books

Connect QuickBooks, Xero or NetSuite, then ask Claude or ChatGPT.

Ask your own books

The formula: (Revenue − Cost of goods sold) ÷ Revenue × 100

Or ask Claude or ChatGPT

Kipper
Question:

What was our gross margin last month?

Answer:
  • Asking Kipper for last month's profit and loss…
  • Reading revenue and cost of sales off it…
  • Working out the percentage…

39.9%. Revenue was $446,000 and cost of sales was $268,000, so you kept $178,000. Those two figures are from your books. The percentage is mine.

Gross margin · last month
Amount
Revenue$446,000
Cost of sales$268,000
Gross profit$178,000
Gross margin39.9%
Question:

Why is that lower than the month before?

Answer:
  • Kipper is pulling the month before to compare…
  • Checking which line moved…
  • Opening the bills behind cost of sales…

Revenue grew $33,000, but cost of sales grew faster, by $30,100. That took margin from 42.4% to 39.9%. The extra cost is two Meridian subcontractor bills dated 28 August, which normally land in September.

July compared with August
JulAugChange
Revenue$413,000$446,000+$33,000
Cost of sales$237,900$268,000+$30,100
Gross profit$175,100$178,000+$2,900
Gross margin42.4%39.9%-2.5 pts
Question:

Show me gross margin by tracking category

Answer:
  • Passing this to Kipper…
  • Reading revenue and cost under each category…
  • Working out a percentage for each one…

Projects dipped to 38.8%. Both Meridian bills are tagged to it. Retainer is at 42.0% and Support at 41.0%.

Gross margin by tracking category · last month
CategoryRevenueCostMargin
Projects$276,500$169,20038.8%
Retainer$120,400$69,83042.0%
Support$49,100$28,97041.0%
Question:

How does this compare with the same month last year?

Answer:
  • Kipper is returning both months…
  • Lining them up…
  • Working the change…

Revenue is up 14% on last August. Cost of sales is up 11%. Sales grew faster than costs, so margin is 1.5 points higher than it was a year ago.

August this year vs August last year
Last yearThis yearChange
Revenue$391,000$446,000+14%
Cost of sales$240,900$268,000+11%
Gross margin38.4%39.9%+1.5 pts
Question:

What has gross margin done over the last six months?

Answer:
  • Asking Kipper for the monthly profit and loss…
  • Taking revenue less cost of sales each month…
  • Working the percentage for each…

Margin rose from 39.4% in March to 42.4% in July. August dipped to 39.9%, and the two early bills explain it.

Gross margin · six months
MonthRevenueMargin
Mar$362,00039.4%
Apr$371,00040.1%
May$384,00039.8%
Jun$396,00041.2%
Jul$413,00042.4%
Aug$446,00039.9%
Reply to Claude…
Open the live demo

A recorded example. Copy the question, then ask it yourself in the interactive demo.

Side by side

Typed numbers vs your real books

Typing your figures into Claude or ChatGPT works. But the assistant only knows what you typed. Here's what changes when it can read your books.

What the assistant can see

Typing the numbers

The figures you typed, and nothing else.

Connected to your books

Every invoice, bill, payment and line item behind those figures.

Why the number moved

Typing the numbers

It can suggest the usual causes and ask you to go and check.

Connected to your books

It opens the bills behind the cost line and names the ones that changed.

Doing it again next month

Typing the numbers

Find the figures and type them in again.

Connected to your books

Ask the same question. The numbers are already current.

Splitting it up

Typing the numbers

You'd have to work out each category's figures first.

Connected to your books

Split by Class, Tracking Category or Department, whichever your system uses.

Trusting the answer

Typing the numbers

The assistant takes your word for the inputs.

Connected to your books

Figures come out of your accounting system, read-only, and trace back to a record.

Connect your books and skip the typing

Start a free trial, connect QuickBooks, Xero or NetSuite, and ask for your real margin.

Both assistants

Use Claude or ChatGPT, whichever you have

Kipper connects to both and returns the same figures to either, so the answer doesn't change with the tool. Pick one to see it in the demo.

Kipper
Question:

What was our gross margin last month?

Answer:
  • Asking Kipper for last month's profit and loss…
  • Reading revenue and cost of sales off it…
  • Working out the percentage…

39.9%. Revenue was $446,000 and cost of sales was $268,000, so you kept $178,000. Those two figures are from your books. The percentage is mine.

Gross margin · last month
Amount
Revenue$446,000
Cost of sales$268,000
Gross profit$178,000
Gross margin39.9%
Question:

Why is that lower than the month before?

Answer:
  • Kipper is pulling the month before to compare…
  • Checking which line moved…
  • Opening the bills behind cost of sales…

Revenue grew $33,000, but cost of sales grew faster, by $30,100. That took margin from 42.4% to 39.9%. The extra cost is two Meridian subcontractor bills dated 28 August, which normally land in September.

July compared with August
JulAugChange
Revenue$413,000$446,000+$33,000
Cost of sales$237,900$268,000+$30,100
Gross profit$175,100$178,000+$2,900
Gross margin42.4%39.9%-2.5 pts
Question:

Show me gross margin by tracking category

Answer:
  • Passing this to Kipper…
  • Reading revenue and cost under each category…
  • Working out a percentage for each one…

Projects dipped to 38.8%. Both Meridian bills are tagged to it. Retainer is at 42.0% and Support at 41.0%.

Gross margin by tracking category · last month
CategoryRevenueCostMargin
Projects$276,500$169,20038.8%
Retainer$120,400$69,83042.0%
Support$49,100$28,97041.0%
Question:

How does this compare with the same month last year?

Answer:
  • Kipper is returning both months…
  • Lining them up…
  • Working the change…

Revenue is up 14% on last August. Cost of sales is up 11%. Sales grew faster than costs, so margin is 1.5 points higher than it was a year ago.

August this year vs August last year
Last yearThis yearChange
Revenue$391,000$446,000+14%
Cost of sales$240,900$268,000+11%
Gross margin38.4%39.9%+1.5 pts
Question:

What has gross margin done over the last six months?

Answer:
  • Asking Kipper for the monthly profit and loss…
  • Taking revenue less cost of sales each month…
  • Working the percentage for each…

Margin rose from 39.4% in March to 42.4% in July. August dipped to 39.9%, and the two early bills explain it.

Gross margin · six months
MonthRevenueMargin
Mar$362,00039.4%
Apr$371,00040.1%
May$384,00039.8%
Jun$396,00041.2%
Jul$413,00042.4%
Aug$446,00039.9%
Reply to Claude…
Open the live demo

Connect once, then ask from either one

Read-only access to QuickBooks, Xero or NetSuite, with the same permissions behind each.

Schedule a demo

Three steps

How to calculate gross margin

01

Add up your revenue

Total sales for the period, before any costs come off. It's the top line of your profit and loss.

02

Add up your cost of goods sold

What it cost to make or buy the things you sold. Materials, the staff who made it, subcontractors. Rent and admin salaries stay out.

03

Subtract, then divide

Revenue minus cost of goods sold gives gross profit. Divide that by revenue and multiply by 100 for the percentage.

Gross margin

Gross profit ÷ Revenue

$178,000 ÷ $446,000 = 39.9%. The share of each sale you keep.

Markup

Gross profit ÷ Cost

$178,000 ÷ $268,000 = 66.4%. How much you added on top of what it cost you.

Same sale, same profit, two very different percentages. If you want a 30% margin on something that cost you $100, charge $142.86. Adding 30% to the cost gets you $130. That's a margin of 23.1%.

Benchmarks

Average gross margin by industry

A percentage on its own doesn't tell you much. Here are the real averages, so you can see where yours sits. Across all US firms in the dataset, the average is 37.8%.

  • Software (system & application) 71.7%
  • Software (internet) 62.6%
  • Advertising 36.2%
  • Business & consumer services 33.4%
  • Retail (general) 33.2%
  • Restaurant / dining 32.2%
  • Retail (grocery & food) 26.3%
  • Construction supplies 25.5%
All US firms 37.8%

Source: Aswath Damodaran, NYU Stern, US industry dataset, January 2026, 5,994 firms. View the data.

What is a good gross margin?

It depends on what you sell. A software company with a 35% gross margin is in trouble. A grocer with 35% is doing very well.

  1. 1

    Compare yourself with your industry first. The chart shows where you sit.

  2. 2

    Then compare with your own last six months. The direction usually matters more than the number.

  3. 3

    If your margin falls three points in a quarter, find out why, even if it's still above average.

The month-by-month comparison needs your real numbers. To see why your margin moved, read financial analysis with Claude or ChatGPT.

FAQ

Gross margin questions

What people ask most about the formula, and what the number means.

Subtract cost of goods sold from revenue to get gross profit. Then divide gross profit by revenue and multiply by 100. On $446,000 of revenue with $268,000 of cost, gross profit is $178,000 and gross margin is 39.9%.
Yes, if you give it the figures. But it only knows what you type, so it can't check the numbers or see what moved. Connect your accounting system through Kipper, and it reads the real revenue and cost itself, along with the invoices and bills behind them.
You keep 30 cents of every dollar you sell, before rent, salaries, marketing and tax come out. The other 70 cents went on making or buying what you sold. Whether 30% is good depends on your industry. It's strong for a grocer, average for a restaurant, and low for a software company.
A 30% margin on a $100 sale is $30 of gross profit, leaving $70 of cost. If instead the cost is $100 and you want a 30% margin, the selling price is $142.86, not $130. That's the difference between margin and markup.
No, and mixing them up is a common pricing mistake. Margin divides profit by revenue. Markup divides the same profit by cost. A 39.9% margin is a 66.4% markup, on the same sale.
Gross profit is an amount of money. Gross margin is that amount as a percentage of revenue. $178,000 of gross profit on $446,000 of revenue is a 39.9% gross margin.
The costs that go up and down with what you sell: materials, stock you bought to resell, subcontractors, and the wages of people who make or deliver the work. Costs you'd pay anyway, like rent, admin salaries and marketing, sit below gross profit in operating expenses.
Either revenue fell, cost of sales rose, or both at once. The percentage alone won't tell you which. So compare two periods, then look at the records underneath the line that moved. That's what the demo on this page does.

Connect your accounting system and ask

One read-only connection to QuickBooks, Xero or NetSuite. Then Claude or ChatGPT reads your real figures, not the ones you typed. We'll help you set it up.

QuickBooks Xero NetSuite Read-only Audit-logged