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.
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 profit = Revenue − COGSGross margin % = (Revenue − COGS) ÷ Revenue × 100Markup % = (Revenue − COGS) ÷ COGS × 100Margin 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
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.
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.
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.