Business Finance · Formula v1.0

Gross Margin Calculator

Calculate gross profit and margin from revenue and cost of goods sold.

Track pricing and direct-cost performance. Enter revenue in dollars and cost of goods sold in dollars. At the worked-example inputs, the gross margin is 40.0%. Gross margin is the share of each sales dollar left to pay overhead and profit. On the example, 40% means 40 cents of every dollar remains after direct costs. Track it over time and by product line: a slipping margin usually means costs are rising faster than prices or the sales mix is shifting toward lower-margin items. Compare it against your industry, since grocery margins run in the low twenties while software often exceeds 70%. It returns gross margin, gross profit.

FreeNo sign-upInputs stay in-browserCSV exportReviewed August 17, 2026
LAST REVIEWEDAugust 17, 2026Inputs stay in your browser
Live calculation

Enter your numbers

Calculated result
Gross margin40.0%
Gross profit$100,000
Sensitivity check

What if cost of goods sold changes?

-10% input46.0%
0% input40.0%
+10% input34.0%

Transparent method

The formula

Gross margin = (revenue − cost of goods sold) ÷ revenue × 100

Worked example

Gross margin40.0%
Gross profit$100,000

Example inputs

Revenue$250,000
Cost of goods sold$150,000

How to interpret the result

Margin and markup describe the same dollar gap between cost and price, but they divide by different numbers, and the difference between the two answers widens as the margin runs higher. A business that sets prices intending a 50% margin but calculates it as a 50% markup on cost is quietly pricing itself at a 33% margin instead, a gap that compounds across every sale in the catalog.

Before you rely on it

What to check

Confirm the denominator. Margin divides by the selling price; markup divides by the cost. The same dollar gap produces two different percentages depending on which one is used.

The common error

Where people go wrong with gross margin calculator

Using markup and margin interchangeably in a pricing conversation. A 40% markup and a 40% margin are not the same selling price, and treating them as synonyms leaves real money on the table on every unit sold.

Sensitivity evidence

How cost of goods sold changes the gross margin

Gross Margin Calculator: gross margin and gross profit across a range of cost of goods sold, every other input held at the worked-example value.
Cost of goods soldGross marginGross profit
$120,00052.0%$130,000
$135,00046.0%$115,000
$150,000worked example40.0%$100,000
$165,00034.0%$85,000
$180,00028.0%$70,000

Every input, tested

Which input moves the gross margin most

Gross Margin Calculator: gross margin with each input moved on its own, every other input held at the worked-example value.
InputTested fromToGross margin at each endSwing
Revenue$225,000$275,00033.3% to 45.5%12.1% (30%)
Cost of goods sold$135,000$165,00046.0% to 34.0%12.0% (30%)

Two variables at once

Gross margin by cost of goods sold and revenue

Gross Margin Calculator: gross margin at each combination of cost of goods sold (rows) and revenue (columns).
Cost of goods sold \ Revenue$200,000$250,000$300,000
$120,00040.0%52.0%60.0%
$135,00032.5%46.0%55.0%
$150,00025.0%40.0%50.0%
$165,00017.5%34.0%45.0%
$180,00010.0%28.0%40.0%

Step by step

The worked example, input by input

Worked-example inputs and the results they produce for the gross margin calculator.
InputValue used
Revenue$250,000
Cost of goods sold$150,000
Gross margin40.0%
Gross profit$100,000

Where the inputs come from

Revenue is what customers paid for the period, net of returns and discounts, taken from the income statement. Cost of goods sold covers only the direct costs of what you sold: materials, direct labor and freight in, and manufacturing costs, but not rent, marketing or administrative salaries. If you sell services, use the direct delivery labor as the cost. Keep the two figures on the same period and the same accounting basis so the margin compares cleanly.

When the result stops applying

Gross margin says nothing about overhead, so a business with a healthy margin can still lose money if operating costs are too high. What counts as cost of goods sold differs between companies, which makes cross-company comparisons shaky. Margin is not the same as markup: a 40% margin corresponds to a 66.7% markup on cost, and confusing the two prices products too low.

What to compare it with

Turn the margin into a price with the target price calculator, and see markup for the same numbers from the cost side. The gross profit calculator gives the dollar figure, and the operating and profit margin pages continue down the income statement. If margins are low, look at supplier prices and discounting before cutting overhead.

People also ask

Frequently asked questions

What is a good gross margin?

It varies widely by industry. Retail and food often run 20% to 40%, manufacturing about 25% to 45%, and software or online services can exceed 70%, so compare with peers.

How is gross margin different from net margin?

Gross margin subtracts only direct costs of goods sold. Net margin subtracts every expense, including overhead, interest and tax, so it is always lower.

What costs belong in cost of goods sold?

Direct materials, direct labor, freight-in and manufacturing overhead tied to production. Selling, marketing and administrative costs are operating expenses, not cost of goods sold.

Common business finance questions

Sources and evidence