Skip to content

Gross Margin Calculator

Calculate gross profit and gross margin from revenue and COGS — or solve in reverse for the maximum COGS or the revenue you need to hit a target margin.

Written by the CalcBundle Research & Editorial Team · Reviewed by the Quality Review Team · Transparent formulas · results are estimates, not advice. · Updated

Inputs
$
$

Gross margin

Enter a revenue greater than zero.

What is a gross margin calculator?

Gross margin is the share of revenue that remains after the direct cost of what you sell. It is a core health metric for e-commerce and SaaS businesses because it sets the ceiling on what you can spend on marketing, overhead and profit.

The formula

  • Gross profit = Revenue − COGS
  • Gross margin % = Gross profit ÷ Revenue × 100

Three ways to solve

  • Gross margin: enter revenue and COGS.
  • Maximum COGS: enter revenue and a target margin to see the most you can spend on goods.
  • Required revenue: enter COGS and a target margin to see the revenue you need.

Gross margin vs net margin

Gross margin stops at COGS; net margin accounts for all other costs. A business can have a strong gross margin but a thin net margin if overhead and marketing are high. For per-unit decisions, also look at contribution margin.

Why gross margin matters for e-commerce and SaaS

High gross margins give you room to acquire customers profitably and to weather discounts and returns. Low gross margins leave little slack, so pricing, sourcing and fees matter enormously. Use the product pricing calculator to price for a target gross margin.

Worked example

Revenue of $10,000 with $6,000 of COGS gives a $4,000 gross profit and a 40% gross margin. Used in reverse, the same tool answers the questions you actually plan around: to hold a 40% margin at $10,000 of revenue, your cost of goods must stay at or below $6,000; and if your COGS is fixed at $6,000, you need at least $10,000 of revenue to reach that margin. Nudge the target to 50% and the maximum allowable COGS drops to $5,000 — a vivid illustration of how tightly sourcing cost and margin are linked, and why small savings on COGS translate directly into margin points.

Frequently asked questions

What is gross margin?

Gross margin is the percentage of revenue left after the cost of goods sold (COGS). Gross profit = revenue − COGS, and gross margin = gross profit ÷ revenue × 100.

What is the gross margin formula?

Gross margin % = (Revenue − COGS) ÷ Revenue × 100. For $10,000 revenue and $6,000 COGS, gross profit is $4,000 and gross margin is 40%.

What is the difference between gross margin and net margin?

Gross margin only subtracts the direct cost of goods. Net margin subtracts everything — operating expenses, marketing, taxes and overhead — so net margin is always lower than gross margin.

Can I calculate COGS or revenue from a target margin?

Yes. This calculator works in reverse: enter revenue and a target margin to find the maximum COGS, or enter COGS and a target margin to find the required revenue.

What exactly counts as COGS?

Cost of goods sold covers the direct costs of producing or acquiring what you sell — raw materials, manufacturing or wholesale purchase cost, and the inbound freight and direct labour tied to the product. It deliberately excludes indirect costs like marketing, office rent, salaries of non-production staff and software, which belong further down the income statement. Drawing this line consistently is what makes gross margin comparable from one period to the next; misclassifying overhead as COGS quietly distorts the figure.

Why is gross margin so important for SaaS?

For software businesses, gross margin largely determines how scalable and valuable the company is. Because the cost of serving one more customer is often very low, well-run SaaS firms commonly reach gross margins of 70–85%, which leaves ample room to fund sales, support and development while still growing. Investors watch this number closely, because a low SaaS gross margin usually signals heavy hosting, support or third-party costs that will cap profitability no matter how fast revenue grows.

Can gross margin be too high?

Rarely in itself, but an unusually high gross margin can attract competitors and may not last if it relies on a temporary pricing advantage. More practically, a high gross margin means little if fixed costs consume it — a business with an 80% gross margin but bloated overheads can still be unprofitable. Gross margin sets the ceiling on profitability; whether you reach that ceiling depends on how well you control the costs below the gross-profit line.

Disclaimer. This calculator provides estimates for informational purposes only. Results are based on the information you enter and the assumptions used by the calculator. Actual financial, tax, business valuation, lending, marketplace or investment outcomes may differ. Consider consulting a qualified professional for decisions involving significant amounts of money. Results are estimates based on the revenue and costs entered.