Free tool
Gross Margin Analyzer
Enter revenue and cost of goods sold to see gross margin, gross profit, and markup on cost.
Gross margin
40%
Share of revenue left after direct costs.
Gross profit
$40,000
Markup on cost
66.7%
How much you add on top of COGS.
What is gross margin?
Gross margin is the percentage of revenue left after paying the direct costs of producing what you sold — the cost of goods sold (COGS). It shows how much of every sales dollar is available to cover overhead (rent, salaries outside production, software, marketing) and, ultimately, profit.
Gross profit is the same idea in dollars. Markup is a related but different measure: it expresses gross profit as a percentage of cost rather than of price. The analyzer shows all three because confusing margin with markup is one of the most common pricing errors.
The formula
Gross profit = revenue − COGS; gross margin % = gross profit ÷ revenue × 100; markup % = gross profit ÷ COGS × 100
- COGS should include only costs that vary directly with what you sell: materials, direct labor, freight-in, and production subcontractors. Overhead belongs below the gross profit line.
- Margin can never reach 100% (unless COGS is zero); markup can exceed 100%.
- To find the price that delivers a target margin: price = cost ÷ (1 − target margin).
Worked example
Illustrative example — a hypothetical specialty food producer for one quarter:
- Revenue: $480,000. COGS: $312,000.
- Gross profit = $480,000 − $312,000 = $168,000.
- Gross margin = $168,000 ÷ $480,000 = 35.0%.
- Markup on cost = $168,000 ÷ $312,000 = 53.8%.
- Pricing check: a product costing $100 sold with a 35% markup is priced at $135, which is a gross margin of only $35 ÷ $135 = 25.9% — not 35%.
The business-wide margin is 35%, but any product priced with a 35% markup is quietly earning about 26%. Pricing by markup while budgeting by margin is a common source of margin leakage.
How to read your result
Gross margin depends heavily on the business model, so compare against your own history and similar businesses. As a public-company reference, NYU Stern's January 2026 dataset of US companies shows an aggregate gross margin of about 37.8% across all industries, with, for example, roughly 15% for food wholesalers and for engineering/construction firms and about 72% for system and application software (Damodaran, NYU Stern). Public companies differ from small private ones, so treat these as orientation, not targets.
A falling gross margin with steady revenue usually points to rising input costs that have not been passed through, discounting, or a shift in mix toward lower-margin products or customers.
Company-wide margin hides the spread. Margin by product, customer, or job is where the decisions are — some lines are usually subsidizing others.
Common mistakes
- Confusing markup with margin. As the example shows, a 35% markup is a 25.9% margin. Always say which one you mean.
- Putting overhead in COGS (or direct costs in overhead). Inconsistent classification makes margin swing for reasons that have nothing to do with performance, and makes comparisons meaningless.
- Comparing periods with different inventory treatment. If inventory counts or cost layers were not updated, COGS for the period is wrong — and margin with it.
- Looking only at the blended number. A healthy average can mask products or customers that lose money on every sale.
Frequently asked questions
What is a good gross margin?
It depends on the industry. NYU Stern's January 2026 data on US public companies shows an aggregate gross margin of about 37.8%, with roughly 15% for food wholesalers and about 72% for software. Compare yourself with businesses that have a similar model, and watch your own trend.
What is the difference between gross margin and markup?
Gross margin is gross profit divided by revenue; markup is gross profit divided by cost. A product that costs $100 and sells for $135 has a 35% markup but a 25.9% gross margin.
What belongs in cost of goods sold?
Costs that vary directly with what you sell: materials, direct labor, freight-in, and production subcontractors. Rent, administrative salaries and marketing are operating expenses below the gross profit line.
How do I price for a target margin?
Divide the cost by one minus the target margin. For a 40% margin on a $60 cost: $60 ÷ 0.60 = $100.
Further reading
- Revenue recognition without the headache — Margin is only as accurate as the revenue it is measured against.
- Measuring ROI on finance technology (without fooling yourself) — Margin improvement is the cleanest way to prove a finance-tech investment paid off.
- Your board deck is too long (and saying the wrong things) — Show margin by line, not just the blended number, when you report up.
- Gross margin analysis for SaaS: pulling COGS, usage and revenue onto one data spine — A worked approach to margin by product and customer.
More free tools
- Cash Runway Calculator
- Loan Covenant Health Check
- DSO & AR Aging Calculator
- 13-Week Cash Flow Starter
- DSCR Calculator
- Covenant Headroom Checker
Sources
Worked examples on this page are illustrative and use hypothetical figures, not customer data. This page is general information, not lending, tax or investment advice.
Do this automatically
MarginLens
Profit margin analysis for QuickBooks by product, customer, and segment — true margins computed straight from your ledger.