Gross Margin Calculator
Calculate gross profit and gross margin, also called gross profit margin, from revenue and cost of goods sold (COGS).
Gross margin and COGS share are not applicable when revenue is $0 — dividing by zero has no meaningful percentage. Gross profit is still shown above.
What are gross profit and gross margin?
Gross profit is revenue minus the cost of goods sold (COGS): what is left after covering the direct cost of producing or delivering what was sold. Gross margin, also called gross profit margin, expresses that same figure as a percentage of revenue, which makes it easier to compare across products, periods, or companies of different sizes.
Gross margin formula
- Gross profit = Revenue − COGS
- Gross margin % = Gross profit ÷ Revenue × 100
- COGS as % of revenue = COGS ÷ Revenue × 100
The gross profit margin formula uses the same numerator as gross profit, then divides by revenue. Revenue and COGS must use the same currency and refer to the same scope (for example, both for one product line, or both for one reporting period).
What belongs in COGS
Cost of goods sold typically includes direct costs tied to producing or delivering what was sold: materials, direct labor, and production overhead directly attributable to those goods or services. It typically excludes indirect costs such as marketing, sales, general administration, and R&D — those are subtracted later, in a net profit margin calculation, not here. Exact COGS treatment can vary by accounting standard, industry, and company policy, so use figures consistent with your own accounting rather than a fixed universal definition.
Gross margin vs net profit margin
Gross margin only nets out COGS. Net profit margin nets out every cost of running the business — operating expenses, interest, and taxes, in addition to COGS — and is always equal to or lower than gross margin for the same revenue. A business can have a high gross margin and still run at a net loss if operating costs are large relative to revenue; this calculator reports gross margin only and does not calculate net profit margin.
Gross margin vs markup
Gross margin and markup describe related but distinct things: gross margin is gross profit as a percentage of revenue, while the Markup Calculator expresses the same kind of profit as a percentage of cost instead. The two percentages are equal only when profit is $0, and diverge more as the percentage grows — see the Markup Calculator for a worked comparison.
Worked example
Consider a product line with:
- Revenue = $80,000
- Cost of goods sold (COGS) = $48,000
Gross profit = $80,000 − $48,000 = $32,000
Gross margin = $32,000 ÷ $80,000 × 100 = 40%
COGS as % of revenue = $48,000 ÷ $80,000 × 100 = 60%
Use the “Load example” button above to load this exact scenario into the calculator.
Negative gross profit
When COGS exceeds revenue, gross profit and gross margin are both negative — for example, $30,000 revenue against $40,000 COGS gives a gross profit of −$10,000 and a gross margin of about −33.3%. This calculator supports and displays negative results without adjustment, since it is a factually meaningful outcome.
Why gross margin varies by business model
Businesses with low direct production cost relative to price — such as software, where the marginal cost of serving one more customer is small — tend to run high gross margins. Businesses with high direct production cost relative to price — such as low-margin retail or heavy manufacturing — tend to run lower ones. This calculator does not label any result as universally good or bad, since there is no single benchmark that applies across industries and business models.
Limitations
- This calculator only computes gross margin; it does not include operating expenses, interest, taxes, or net profit margin.
- It does not apply any specific accounting standard, and what counts as COGS can vary by company and jurisdiction.
- Results are only as accurate as the revenue and COGS figures you enter.
- This is a planning estimate, not accounting, tax, legal, or financial advice.
Related pricing calculators
For the same margin formula applied more generally to revenue and total cost, see the Profit Margin Calculator. For the cost-based counterpart to margin, see the Markup Calculator. For a fuller comparison with worked examples and a conversion table, see the Profit Margin vs Markup guide.
Frequently asked questions
What is gross margin, or gross profit margin?
Gross margin, also called gross profit margin, is the percentage of revenue remaining after subtracting the cost of goods sold (COGS). It is calculated as gross profit divided by revenue, multiplied by 100. This is sometimes called a gross profit margin calculator.
How do you calculate gross margin?
Gross profit = Revenue - COGS. Gross margin % = Gross profit / Revenue x 100. This calculator also shows COGS as a percentage of revenue.
What belongs in cost of goods sold (COGS)?
COGS typically includes the direct costs of producing or delivering what was sold - materials, direct labor, and production overhead directly tied to the goods or services sold. It typically excludes indirect costs such as marketing, sales, general administration, and R&D. Exact COGS treatment can vary by accounting standard and company policy, so use figures consistent with your own accounting.
What is the difference between gross margin and net profit margin?
Gross margin only subtracts COGS from revenue. Net profit margin subtracts every cost of running the business - operating expenses, interest, and taxes, in addition to COGS - from revenue. A business can have a high gross margin and a low or negative net profit margin if its operating costs are high relative to revenue.
What is the difference between gross margin and markup?
Gross margin is gross profit as a percentage of revenue; markup is the same dollar profit as a percentage of cost. The two use different denominators and are never equal except when profit is $0. See the <a href="/calculators/markup">Markup Calculator</a> for a dedicated comparison.
Can gross profit be negative?
Yes. When COGS exceeds revenue, gross profit and gross margin are both negative. This calculator displays negative results without adjustment, since it is a factually meaningful outcome, not an error.
Why does gross margin vary by business model?
Businesses with low direct production cost relative to price (such as software) tend to run high gross margins, while businesses with high direct production cost relative to price (such as low-margin retail or manufacturing) tend to run lower ones. This calculator does not label any result as universally good or bad, since there is no single benchmark across industries and business models.