Home › Blog › Gross Margin Calculator Guide

❤ Want to see our calculators more often in Google? Add us as a trusted source:

Gross Margin Calculator: Formula, Markup & Profit Guide

Calculator200 Editorial Team — published September 2026, updated 16 September 2026

A gross margin calculator answers a question every business owner eventually confronts: after paying for the product itself, how much of each sale actually stays with the company? Enter revenue and cost of goods sold, and the tool returns your gross profit in dollars and your gross margin as a percentage. The number that emerges shapes pricing decisions, supplier negotiations, and product strategy. Understanding what it measures — and what it ignores — separates informed decisions from hopeful ones. A free gross margin calculator removes the arithmetic from the equation, leaving you with the figure that matters.

What Gross Margin Actually Measures

Gross margin isolates the portion of sales remaining after paying for the direct costs of producing or purchasing what you sold. It does not include office rent, founder salaries, marketing spend, or taxes. It answers a single, focused question: for every dollar of revenue, how many cents survive the cost of delivering the product?[reference:0]

This focus is what makes gross margin such a useful steering metric. Because it excludes overhead, it lets you compare profitability across products, stores, months, and even business models without the noise of fixed costs distorting the picture. A 42% margin on one SKU and 28% on another highlights which items pull the financial cart — and which ones merely occupy shelf space.[reference:1]

Gross margin also functions as an early warning system. When supplier costs creep up, shrinkage rises, or a volume discount expires, the margin percentage compresses before cash flow feels the pinch. Treat it as a sensitive gauge rather than a vanity number, and you will catch problems while they are still fixable.[reference:2]

The Gross Margin Formula

The core formula is straightforward, and every gross margin calculator applies it the same way:

Gross Profit = Revenue − COGS
Gross Margin (%) = [(Revenue − COGS) ÷ Revenue] × 100

The numerator is gross profit in dollars. Divide by revenue to normalise it, then multiply by 100 for a percentage. That is the entire calculation. The complexity lies in getting clean inputs — particularly the COGS figure.

Revenue is the amount earned from selling goods or services, net of returns and allowances. If you book $120,000 in sales but $5,000 comes back as returns and $1,000 is a damaged-goods allowance, net revenue is $114,000 for margin purposes.[reference:3]

COGS includes the direct costs of items delivered in the period: purchase costs, inbound freight allocated to those items, direct materials, direct labour tied to production, and factory overhead allocated under your chosen costing method. It specifically excludes selling, general, and administrative expenses. For resellers, the formula is: beginning inventory plus purchases plus freight-in, minus ending inventory, adjusted for shrinkage and write-offs.[reference:4][reference:5]

Worked Example: A Real Calculation

Suppose a seller ships goods to a customer and bills $10,000. The cost of the shipped goods is $3,000. The gross profit is $7,000, and the gross margin ratio is:

$7,000 ÷ $10,000 = 70% gross margin

That 70% figure is the percentage of each revenue dollar left to cover administrative expenses, marketing, rent, utilities, and — if anything remains — profit.[reference:6]

Now consider a different scenario. A retailer sells a product for $50. The purchase cost is $30, inbound freight allocated to that unit is $2, and packaging is $1. Total COGS is $33. Gross profit is $17. Gross margin is 34%. If the retailer mistakenly uses only the $30 purchase cost, the margin appears to be 40% — a six-point overstatement that could lead to underpricing and margin erosion.

Gross Margin vs Markup: The Distinction That Matters

Margin and markup use the same gross profit figure but different denominators. Confusing the two is one of the most common — and most expensive — pricing errors.

A $40 cost sold for $80 produces $40 gross profit. The gross margin is 50% ($40 ÷ $80). The markup is 100% ($40 ÷ $40). Margin is always lower than markup when derived from the same price-cost pair.[reference:7]

A 40% markup does not mean a 40% margin. It means a 28.6% margin. A 60% margin requires a 150% markup. The two figures move in the same direction but at different rates, and pricing decisions based on the wrong one can leave money on the table — or drive customers away with prices that are too high.

A markup calculator converts between the two figures instantly, removing the arithmetic barrier that causes the confusion.

How to Calculate Gross Margin in Excel and Google Sheets

Spreadsheet users can compute gross margin with a single formula. If revenue is in cell A1 and COGS is in cell B1, the formula is:

=(A1-B1)/A1

Format the cell as a percentage, and Excel displays the margin. Google Sheets uses the identical syntax. For a worked example with multiple products, list each product's revenue and COGS in adjacent columns, then copy the formula down the column to calculate margins across the entire product line.

To calculate gross profit in dollars rather than percentage, use =A1-B1. To work backwards and find the selling price required to achieve a target margin, use: Cost ÷ (1 − Target Margin). A product costing $40 that needs a 60% margin must sell for $100.

The formula is only as accurate as your COGS figure. If you exclude outbound freight, payment processing fees, or allocated overhead from COGS that your accountant includes, your margin will read higher than the accountant's. Discuss the COGS definition being used before comparing figures from different sources.

Industry Benchmarks: What Counts as a Good Gross Margin?

Gross margin benchmarks vary widely by sector, cost structure, and business model. The following ranges reflect typical figures for 2026 and should be treated as directional starting points rather than definitive targets. Your own mix — private label versus branded, direct versus wholesale, domestic versus cross-border — can push you above or below the industry range.[reference:8]

SectorTypical Gross MarginKey Drivers
SaaS / Software70–90%Near-zero marginal cost per additional user; hosting and customer support are primary COGS[reference:9]
Pharmaceuticals65–80%High R&D amortisation; patented products command premium pricing[reference:10]
Restaurants (Full-Service)55–70%Food cost target below 30% of menu price; labour and waste are key variables[reference:11]
Clothing Retail45–55%Creative margin is high; returns and markdowns compress realised margin[reference:12]
E-commerce (D2C)25–50%Gateway MDR, return rates, and CAC are the largest margin eroders[reference:13]
General Retail / FMCG20–35%Shrinkage, distribution costs, and promotional spend compress net margin[reference:14]
Electronics Retail5–20%Thin margins; volume and warranty costs are the key variables[reference:15]
Grocery / Supermarket20–35%Perishables, high shrink, and brutal price competition; net margins often 1–3%[reference:16]

The gap between gross margin and net margin matters here. A grocery chain with a 30% gross margin might net only 2% after operating expenses. A software company with an 80% gross margin might net 20%. Both can be healthy businesses. The gross margin tells you whether the product economics are sound. The net margin tells you whether the business as a whole is profitable.[reference:17]

Using a Gross Margin Calculator for Pricing Decisions

A gross margin calculator does more than report a number. It lets you test pricing scenarios before committing to them. Here is how to use it as a decision tool rather than a reporting tool.

Scenario one: raising prices. If your current margin is 35% and you raise prices by 5%, what happens? The calculator shows the new margin. A 5% price increase on a 35% margin product lifts the margin to approximately 38%. On a 10% margin product, the same 5% increase lifts it to about 14% — a proportionally larger improvement because the margin base is smaller.

Scenario two: negotiating supplier costs. If you negotiate a 10% reduction in COGS, what is the margin impact? On a product with a 50% margin, a 10% COGS reduction lifts the margin to approximately 55%. On a 20% margin product, the same cost reduction lifts it to 28% — a 40% relative improvement. The lower your starting margin, the more sensitive it is to cost changes.

Scenario three: adding a payment processing fee. If your payment gateway charges 2% of the transaction value, that fee effectively reduces your margin. A product with a 40% margin drops to approximately 38% after the fee. The calculator makes this invisible cost visible.

A profit margin calculator extends this analysis to operating and net margins, showing the full cascade from revenue to bottom-line profit.

The COGS Trap: What Belongs and What Does Not

COGS is the most common source of margin calculation error. The line between what belongs in COGS and what belongs in operating expenses is not always obvious, and different accountants draw it differently.

Belongs in COGS: Raw materials, purchase cost of goods for resale, inbound freight, direct labour tied to production, factory overhead allocated to units produced, packaging that is part of the product, and import duties on goods.

Does not belong in COGS: Outbound shipping to customers, marketing and advertising spend, sales commissions, rent for office space, administrative salaries, research and development costs not tied to a specific production run, and payment processing fees.

The treatment of outbound shipping is a frequent point of divergence. Some businesses include it in COGS because it is a direct cost of delivering the product. Others classify it as an operating expense because it is a distribution cost rather than a production cost. Either approach is defensible, but consistency matters. If you change your COGS definition between periods, your margin trend becomes meaningless.

Gross Margin for Small Business Owners

For a small business owner without a finance team, the gross margin calculator is often the single most important financial tool after the bank account itself. It tells you whether your pricing covers your costs before you start paying for everything else.[reference:18]

Here is a practical routine. Once a month, pull your revenue figure and your COGS figure. Run them through the gross margin calculator. Write the result down. Do this for three months, and you have a trend. A declining margin means costs are rising faster than prices, or you are selling more of your low-margin products and fewer of your high-margin ones. Either problem is visible in the trend before it becomes a cash crisis.

For product-based businesses, calculate margin by product line rather than in aggregate. A blended margin can hide the fact that your best-selling product has a 15% margin while a slow-moving item carries 60%. The gross margin calculator handles individual products as easily as company-wide figures.

Gross Margin Return on Inventory Investment (GMROI)

For retailers and e-commerce sellers, gross margin alone does not tell the full story. A high-margin product that sits on the shelf for six months ties up working capital that could be deployed elsewhere. GMROI measures how much gross profit you earn for every dollar of average inventory.

GMROI = Gross Margin Dollars ÷ Average Inventory Cost

A GMROI above 1.5 is generally considered healthy in retail. A product with a 40% margin that turns over four times a year has a GMROI of 1.6. The same product with a 60% margin that turns over once a year has a GMROI of 0.6. The lower-margin, faster-turning product is the better use of capital. A gross margin calculator provides the margin figure; the inventory turnover ratio provides the other half of the equation.

Common Mistakes in Gross Margin Calculation

Even experienced business owners make the same handful of errors. Here are the ones that matter most.

Frequently Asked Questions

What is the difference between gross margin and markup?

Margin is profit divided by selling price. Markup is profit divided by cost. They use the same gross profit figure but different denominators. A product that costs $40 and sells for $80 has a 50% gross margin and a 100% markup. Margin is always lower than markup when derived from the same price-cost pair.

What counts as COGS in a gross margin calculation?

COGS includes the direct costs of producing or acquiring the goods you sell: raw materials, purchase costs, inbound freight, direct labour tied to production, and factory overhead allocated under your costing method. It specifically excludes selling, general, and administrative expenses such as rent, marketing, and founder salaries.

What is a good gross margin for a small business?

It depends on the industry. SaaS and software companies typically run 70% to 90% gross margins. Restaurants range from 55% to 70%. General retail sits between 20% and 35%. E-commerce ranges from 20% to 45%. Compare your margin to businesses of similar size in your sector and region, not to a single national average.

How do I calculate gross margin in Excel?

Use the formula =(Revenue - COGS) / Revenue in a cell formatted as a percentage. If revenue is in cell A1 and COGS in B1, type =(A1-B1)/A1. Press Enter, then format the cell as a percentage. Excel handles the arithmetic correctly, but the result is only as accurate as your input data.

Can gross margin be negative?

Yes. If your cost of goods sold exceeds your revenue, the gross margin is negative. This means you are losing money on every sale before accounting for any operating expenses. A negative gross margin is unsustainable and signals a fundamental pricing or cost problem that needs immediate attention.

Why does my gross margin look different from my accountant's?

The most common reason is different COGS treatment. If your accountant includes items you exclude — such as outbound freight, payment processing fees, or allocated overhead — their COGS will be higher and the margin lower. Discuss the COGS definition being used before comparing figures from different sources.

What is the gross margin return on inventory investment?

GMROI measures how much gross profit you earn for every dollar of average inventory. The formula is gross margin dollars divided by average inventory cost. A GMROI above 1.5 is generally considered healthy in retail. It helps identify which products justify the shelf space and working capital they consume.

Should I use gross margin or net margin to evaluate my business?

Use both. Gross margin tells you whether your product economics are sound — whether you make money on each sale before overhead. Net margin tells you whether the business as a whole is profitable. A healthy gross margin with a thin net margin points to excessive operating expenses. A thin gross margin means your pricing or COGS structure needs attention first.

In sum, a gross margin calculator converts a question that looks simple — how much do I keep from each sale? — into a figure that can be trusted, compared, and acted upon. Whether you are pricing a new product, negotiating with a supplier, comparing your performance against industry benchmarks, or simply trying to understand why your bank balance and your sales figures do not move in step, the gross margin is the number to check first. Use the gross margin calculator above, enter your revenue and COGS with care, and treat the result as what it is: a precise measure of your product economics, unclouded by the operating expenses that belong to a different conversation.