Gross Margin Calculator

Calculate gross margin percentage and gross profit from revenue and cost of goods sold (COGS).

Money Revenue & COGS Profit, Margin, Markup
Rate this calculator · 5.0 (2)

Gross Margin Calculator

Enter revenue and COGS to compute gross profit, gross margin %, and markup.

Instructions — Gross Margin Calculator

  1. Enter total revenue (net sales) for the period.
  2. Enter cost of goods sold (COGS): direct material, direct labor, and manufacturing overhead.
  3. Read the gross margin percentage and gross profit in the result panel.
  4. Compare the markup percentage if you price products by cost-plus.

COGS excludes operating expenses such as rent, salaries for non-production staff, and marketing. Including those would yield operating margin or net margin instead.

Formulas

Gross profit: Revenue − COGS

Gross margin %: (Revenue − COGS) ÷ Revenue × 100

Markup %: (Revenue − COGS) ÷ COGS × 100

Margin and markup are not interchangeable. A 50% markup equals a 33.3% margin; a 100% markup equals a 50% margin.

Reference

  • Software & SaaS = 70–90% (low marginal cost per copy)
  • Pharmaceuticals = 50–70% (high R&D, low unit cost)
  • Hardware & electronics = 40–50% (Apple ran 45.6% in FY2023)
  • Manufacturing = 30–45%
  • E-commerce retail = 20–35%
  • Grocery & supermarket = 15–25%

Article — Gross Margin Calculator

Gross Margin Calculator: Profit, COGS, and Margin Percent

Gross margin is the percentage of revenue a business keeps after paying for the goods it sold. The formula is (Revenue − COGS) ÷ Revenue × 100. A company with $100,000 in revenue and $60,000 in cost of goods sold has a 40% gross margin and $40,000 of gross profit.

Investors, lenders, and managers use gross margin as a first read on a company's pricing power and production efficiency. It strips out the noise of office rent, executive salaries, and tax planning to show one thing: how much of every sales dollar survives the cost of producing the product.

What is gross margin?

Gross margin measures the share of revenue left after subtracting the direct cost of goods sold (COGS). It is the cleanest indicator of unit economics. If gross margin is positive, each sale at least covers the cost of producing it. If gross margin is negative, the business loses money before it pays a single bill for rent, salaries, or interest.

The metric is reported on every income statement filed with the U.S. Securities and Exchange Commission. Apple's fiscal-year 2023 10-K, for example, reported $383.3 billion in revenue against $214.1 billion in cost of sales, yielding a 44.1% gross margin. That figure tells investors that Apple keeps roughly 44 cents of every revenue dollar before operating expenses.

Did you know

Costco's gross margin sits near 12%, among the lowest of any large U.S. retailer. The chain compensates with membership fees, which fall almost entirely to operating income and turn a thin gross margin into a respectable net margin of around 3%.

The gross margin formula

Three calculations matter when you work out gross margin from raw figures. Gross profit is the dollar amount left over. Gross margin expresses that amount as a percentage of revenue. Markup expresses it as a percentage of cost.

Gross margin formulas
Gross profit = Revenue − COGS
Gross margin % = (Revenue − COGS) ÷ Revenue × 100
Markup % = (Revenue − COGS) ÷ COGS × 100

Margin and markup are not the same. A 50% markup yields a 33.3% margin, not 50%. Pricing teams who confuse the two end up under-pricing relative to their target profitability.

Gross margin vs. markup

Margin uses revenue as the denominator. Markup uses cost. The two numbers describe the same dollar of profit from two angles. Margin caps at 100%; markup has no ceiling. A product that costs $10 and sells for $40 has a 75% margin and a 300% markup.

  • 20% margin = 25% markup
  • 33% margin = 50% markup
  • 50% margin = 100% markup
  • 60% margin = 150% markup
  • 75% margin = 300% markup
  • 80% margin = 400% markup
Tip

To convert markup to margin, divide markup by (100 + markup) and multiply by 100. A 50% markup becomes 50 ÷ 150 × 100 = 33.3% margin.

Gross margin vs. operating and net margin

Three margin lines appear on a standard income statement, each subtracting more costs than the one before.

Gross margin subtracts only COGS. It answers: does the product itself make money? Operating margin also subtracts selling, general, and administrative expenses (SG&A) plus depreciation. It answers: does the business as a whole make money before financing decisions? Net margin further subtracts interest, taxes, and any one-time charges. It is what shareholders actually receive.

For a software firm, the spread between gross and net margin is wide because most of the income statement sits below the gross-profit line. For a grocery chain, gross margin is already thin, and net margin shrinks further to a few percent.

Gross margin by industry

Comparing margins across industries is misleading. Software firms commonly post 70–90% gross margin because the marginal cost of an extra license is near zero. Grocery stores live with 15–25% because perishable inventory and price-sensitive customers cap pricing power. Both can be excellent businesses on a risk-adjusted basis.

SaaS
Software
70–90%
Near-zero marginal cost
RTL
Grocery
15–25%
Perishable inventory

The Census Bureau's Annual Retail Trade Survey publishes gross margin benchmarks by retail sub-sector. Furniture stores run around 43%, clothing stores around 41%, gasoline stations around 17%. Within an industry, margin is a reasonable signal of brand strength and operational efficiency.

What counts as COGS

The IRS defines cost of goods sold in Publication 334 as the cost of inventory sold during the year. It includes raw materials, direct labor applied to production, factory overhead, freight-in, and inventory write-downs. It excludes selling expenses, general administrative costs, and any expense not tied to producing the goods.

Don't bury operating costs in COGS

Pushing salaries, marketing, or office rent into COGS understates gross margin and overstates operating margin. The total stays the same, but the metric loses its diagnostic value. Auditors flag this when COGS grows faster than units sold.

Improving gross margin

Gross margin moves on two levers: revenue per unit and cost per unit. Raising prices is the fastest path but risks volume loss. Cutting COGS is slower but compounds. Common tactics include renegotiating supplier contracts, automating production, shifting product mix toward higher-margin SKUs, and reducing shrinkage and returns.

A 1-point gain in gross margin on $10 million of revenue is $100,000 of pure profit, since the cost base is unchanged. That same $100,000 would require roughly $250,000–$400,000 in additional revenue at typical operating margins, which is why margin-improvement projects often outperform sales pushes on return-on-effort.

Volume-based discounts on raw materials, longer payment terms with suppliers, and switching to a contract manufacturer with lower overhead all reduce per-unit COGS. On the revenue side, value-based pricing, bundling, and removing the lowest-margin SKUs from the catalog can lift the average selling price without losing core customers. Track gross margin monthly and segment it by product line so weak performers cannot hide inside a healthy company average.

Common gross-margin mistakes

The frequent errors are mechanical and conceptual.

  • Confusing margin and markup in pricing rules
  • Ignoring freight-in and duty, which the IRS includes in COGS
  • Comparing across industries without context
  • Tracking gross margin alone while operating costs balloon
  • Recording sales tax in revenue, which inflates the denominator
  • Excluding inventory write-downs from COGS in good quarters

Gross margin is a simple number that rewards careful definition. Pin down what goes into revenue and what goes into COGS, hold those rules constant across periods, and the metric becomes a reliable signal of how the underlying business is changing.

FAQ

It depends on the industry. Software companies commonly post 70–90% gross margin, while grocery stores run 15–25%. Compare your business to peers in the same sector, not across industries.
Margin is profit divided by revenue; markup is profit divided by cost. A 50% markup equals a 33.3% margin. Margin is bounded between 0% and 100%; markup has no upper bound.
Cost of goods sold includes direct materials, direct labor used in production, and manufacturing overhead. It excludes selling, general, and administrative expenses (SG&A), interest, and taxes.
Yes. If COGS exceeds revenue, gross margin is negative, meaning the business loses money on each unit before paying any operating expenses. This is typically unsustainable outside loss-leader strategies.
Raise prices, negotiate lower input costs, improve production efficiency, shift product mix toward higher-margin items, or reduce waste and shrinkage.
Gross margin subtracts only COGS. Operating margin also subtracts SG&A and depreciation. Net margin subtracts everything including interest and taxes. Gross is largest, net is smallest.