Gross Margin Calculator

See how much of every sale you keep after the direct cost of making it — also called gross profit (GP) margin.

Last updated: October 2026

Live calculatorNothing you type leaves your browser.
$
Sales before any costs, net of discounts and returns.
$
Only costs that rise and fall with what you sell.
Gross margin
36.00%
Gross profit90,000.00
Equivalent markup56.25%
Cost as % of revenue64.00%

Reading this result: 36.00 cents of every sales dollar is left after the direct costs of delivering it. Everything else — rent, salaries, marketing, profit — has to come out of that.

General information only, not financial advice. Check any figure before you act on it.

Free downloadExcel .xlsx · 35 KB · no macros · no sign-up

Free gross margin calculator Excel workbook

The same method as the calculator above, in a spreadsheet you can keep, edit and share — with margin by product, a price-change table and a discount-impact calculator.

Preview of the free BabaDigit Gross Margin Calculator Excel workbook: revenue and cost inputs with a 36.00% gross margin result, margin by product and a discount-impact table
  • Gross Margin Calculator — gross margin, gross profit, equivalent markup and margin at nine price changes
  • Product Mix — margin by product for up to 20 lines, with the blended margin and loss-making lines flagged
  • Discount Impact — the extra volume a price cut needs just to keep gross profit level
  • Worked examples, formula guide and checks — including why margin is not markup
Download the free workbook (.xlsx)

Opens in Microsoft Excel or LibreOffice Calc. General information only, not financial advice.

Gross margin is the top of the story. The Profit & Loss Statement Template is a paid spreadsheet that carries it down through overheads to operating and net profit, month by month. Browse all templates

What gross margin actually measures

Gross margin (also called gross profit margin, or GP margin) is the share of each sales dollar that survives the direct cost of delivering the sale. Sell something for $100 that costs you $64 to buy or make, and $36 remains — a gross margin of 36%.

That remaining slice has to pay for everything else the business does: premises, salaries, software, marketing, interest, tax, and whatever is left over as profit. This is why gross margin is the most important single number in most small businesses. It sets the ceiling on everything below it. A business running at 20% gross margin needs five dollars of sales to cover every dollar of overhead; at 60%, it needs less than two.

It is also the number that decides whether growth helps or hurts. Doubling revenue at a healthy gross margin builds a business. Doubling revenue at a thin one mostly builds work.

The gross margin formula

Gross margin (%) = (Revenue − Cost of goods sold) ÷ Revenue × 100Gross profit = Revenue − Cost of goods sold

The difficult part is deciding what belongs in cost of goods sold. The test is whether a cost moves when sales volume moves. Materials, the purchase price of stock, direct labour on the job, shipping to the customer, payment processing fees — these scale with sales and belong in COGS. Rent, admin salaries, insurance and software subscriptions do not move with volume and belong below the gross profit line.

Get this boundary wrong and the number becomes meaningless. Putting overheads into COGS understates gross margin and makes a healthy business look sick; leaving out direct labour does the reverse.

Three worked examples

Base case

A product business

A company sells $250,000 of goods in a year. The goods cost $160,000 to buy in, including inbound freight.

Gross profit = 250,000 − 160,000 = 90,000
Gross margin = 90,000 ÷ 250,000 × 100 = 36.00%
Cost as a share of revenue = 64.00%

If overheads run at $70,000, the business makes $20,000. If overheads run at $95,000, it loses money despite every individual sale being profitable — which is the most common way a busy small business fails.

The costly confusion

Margin is not markup

The same business could describe its pricing two ways, and only one of them is the margin.

Gross profit ÷ revenue  = 90,000 ÷ 250,000 = 36.00% margin
Gross profit ÷ cost     = 90,000 ÷ 160,000 = 56.25% markup

Same money, two very different percentages. A supplier who says “we work on 50%” may mean either, and the gap is real money. If you set prices using a markup figure while budgeting using a margin figure, you will come up short every month. The markup calculator converts between the two.

Discounting

What a 10% price cut really costs

The business above sells 1,000 units at $250, each costing $160. A competitor forces a 10% price cut to $225.

Gross profit per unit before = 250 − 160 = 90
Gross profit per unit after  = 225 − 160 = 65
 
Units needed to hold total gross profit at 90,000:
90,000 ÷ 65 = 1,385 units — a 38.5% increase in volume

A 10% discount costs 28% of the gross profit on every unit, and demands nearly 40% more sales just to stand still. This single calculation is the strongest argument against routine discounting, and it gets sharper the thinner the margin. To work out a sale price from a percentage off, use the discount calculator.

Where gross margin misleads you

Everyone defines COGS differently. Two companies in the same industry can report margins several points apart purely from where they draw the line. Comparisons are only safe when you know what each includes.
It says nothing about overheads. A 70% gross margin business with bloated fixed costs can lose money while a 25% margin business with tight overheads thrives. Gross margin sets the ceiling, not the outcome.
A blended figure hides the mix. An overall margin averages your best and worst products. The useful analysis is per product or per customer — that is where you find the lines quietly losing money. To explain how price, volume and mix each changed revenue and gross margin between two periods, see the paid Price-Volume-Mix Variance Analysis Template.
Rising revenue can hide a falling margin. Sales growth feels like progress while margin erosion goes unnoticed. Track the percentage, not just the total.

Gross, operating and net margin

MarginWhat it subtractsQuestion it answers
GrossDirect costs onlyIs each sale worth making?
OperatingDirect costs plus overheadsDoes the business work?
NetEverything, including interest and taxWhat do the owners keep?

Read them together. A wide gross margin collapsing into a thin net margin points at an overhead problem; a thin gross margin points at a pricing or purchasing problem. The profit margin calculator works all three out at once.

How to calculate gross margin in Excel or Google Sheets

Revenue in B1, cost of goods sold in B2:

=(B1-B2)/B1=(B1-B2)/B2  ← markup, not margin

Format as Percentage. If B1 might be blank, wrap it in an IF so an empty revenue cell returns a blank rather than a division error.

Frequently asked questions

What is a good gross margin?

It varies enormously by industry. Grocery and distribution often run under 20%; restaurants around 60–70% on food; software above 80%. The number only means something against your own trend and your direct competitors. A margin that is falling quarter on quarter matters far more than its absolute level.

What exactly belongs in cost of goods sold?

Anything that increases when you sell one more unit: materials, stock purchases, direct labour on the job, inbound and outbound freight, and payment processing fees. Rent, admin salaries, insurance and subscriptions stay out, because they do not move with volume.

Is gross margin the same as markup?

No, and confusing them is expensive. Margin divides gross profit by the selling price; markup divides it by the cost. A 50% markup is a 33.3% margin. Whenever someone quotes a percentage, ask which one they mean.

Should labour be in COGS?

Direct labour should — the hours billed to a job, or the staff making the product. Indirect labour such as admin, management and sales should not. Service businesses often put most of their payroll in COGS, which is correct if that time is what the customer is buying.

Can gross margin be negative?

Yes, and it is a red alert. It means you are selling below what the goods cost you, so every additional sale increases the loss. Occasionally this is deliberate for a loss-leader, but as an overall figure it means prices are wrong or costs have moved and pricing has not followed.

How do I improve gross margin?

Three levers: raise prices, reduce direct costs, or shift the mix towards higher-margin products. Price is usually the most powerful and least used — a 5% price rise with no volume loss adds far more gross profit than a 5% cost saving, because it drops straight through.

References

  1. Brealey, R. A., Myers, S. C. & Allen, F. Principles of Corporate Finance, 13th edition, McGraw-Hill Education — on profitability ratios.
  2. Horngren, C. T., Datar, S. M. & Rajan, M. V. Cost Accounting: A Managerial Emphasis, 16th edition, Pearson — on cost classification and the direct/indirect boundary.

Keep going

Written and reviewed by Ghayas Uddin, MS (Finance), financial analyst. Last reviewed 21 September 2026. Found an error? Email support@babadigit.com and we will correct it.

Scroll to Top