The Formula to Calculate Gross Margin Is
Use this premium gross margin calculator to measure profitability from revenue and cost of goods sold. Enter your sales figures, choose formatting options, and instantly see your gross profit, gross margin percentage, markup, and a visual comparison chart.
Results will appear here
Enter revenue and cost of goods sold, then click the calculate button to see your gross margin, gross profit, and markup.
Revenue vs Cost vs Gross Profit
A visual breakdown of your current inputs to support margin analysis.
What Is the Formula to Calculate Gross Margin?
The formula to calculate gross margin is one of the most important profitability formulas in business, accounting, retail, manufacturing, e-commerce, and financial analysis. In its standard form, the formula is:
This means you first subtract cost of goods sold, often shortened to COGS, from revenue. The result is gross profit. Then you divide gross profit by revenue and multiply by 100 to express the answer as a percentage. That percentage tells you how much of every sales dollar remains after paying the direct costs required to produce or acquire the goods sold.
For example, if a company has revenue of $100,000 and COGS of $65,000, gross profit equals $35,000. Dividing $35,000 by $100,000 gives 0.35. Multiplying by 100 gives a gross margin of 35%.
Gross margin matters because it reveals whether a business has enough room to cover operating expenses, marketing, payroll, rent, software, debt, taxes, and ultimately profit. A strong top-line revenue number can look impressive, but if the gross margin is weak, the business may still struggle financially. That is why finance teams, investors, lenders, and business owners closely monitor gross margin trends over time.
Why Gross Margin Is So Important in Business
Gross margin is a core measure of operational efficiency at the product or service delivery level. It does not account for every expense in the company, but it does answer a very practical question: after direct production or purchase costs, how much money is left to run the business?
- It helps evaluate pricing strategy.
- It shows whether direct costs are rising faster than sales.
- It helps compare product lines, channels, and customer segments.
- It supports budgeting, forecasting, and break-even analysis.
- It is often used by lenders and investors to assess business health.
If gross margin declines, management may need to increase prices, renegotiate supplier contracts, improve manufacturing efficiency, reduce discounting, or shift the sales mix toward higher-margin offerings. If gross margin improves, it often indicates better pricing power, lower input costs, stronger product differentiation, or a more efficient supply chain.
Gross Margin vs Gross Profit
Many people confuse gross margin with gross profit, but they are not the same. Gross profit is an absolute dollar amount. Gross margin is that same amount expressed as a percentage of revenue.
| Metric | Formula | What It Tells You | Example Using Revenue = $100,000 and COGS = $65,000 |
|---|---|---|---|
| Gross Profit | Revenue – COGS | The dollar amount left after direct costs | $35,000 |
| Gross Margin | (Gross Profit / Revenue) x 100 | The percentage of revenue left after direct costs | 35% |
| Markup | (Gross Profit / COGS) x 100 | How much profit is added relative to cost | 53.85% |
Understanding the distinction is essential. Gross profit shows scale, while gross margin enables apples-to-apples comparisons across periods, products, stores, and competitors of different sizes.
How to Calculate Gross Margin Step by Step
- Determine total revenue for the period you are analyzing.
- Determine cost of goods sold for the same period.
- Subtract COGS from revenue to calculate gross profit.
- Divide gross profit by revenue.
- Multiply by 100 to convert the result into a percentage.
Suppose an online store generated $250,000 in monthly sales and its cost of goods sold was $162,500. The gross profit is $87,500. Divide $87,500 by $250,000 to get 0.35. Multiply by 100 and the gross margin is 35%.
What Counts as Cost of Goods Sold?
Cost of goods sold includes the direct costs associated with producing or purchasing the products sold during the period. Depending on the business model, COGS may include raw materials, wholesale purchase costs, direct factory labor, freight-in, and manufacturing overhead directly tied to production. For service businesses, the equivalent direct delivery costs may include labor directly attributable to delivering the service.
However, general overhead is usually not included in COGS. Rent for the headquarters office, administrative salaries, sales commissions not tied to production, software subscriptions, and advertising spend are generally operating expenses rather than COGS. Correct classification matters because putting indirect expenses into COGS can understate gross margin and distort analysis.
Typical Items Included in COGS
- Raw materials or inventory purchase cost
- Direct labor used in production
- Factory supplies consumed in production
- Inbound shipping for inventory
- Production overhead directly allocable to goods
Typical Items Not Included in COGS
- Marketing and advertising
- Corporate office rent
- Executive salaries
- Interest expense
- Income taxes
Industry Benchmarks and Real Comparison Data
Gross margin varies widely by industry. Software businesses can post very high gross margins because the cost to deliver an additional unit is relatively low. Retailers often operate on much thinner margins because inventory costs are substantial. Manufacturers sit somewhere in the middle depending on complexity, scale, labor intensity, and raw material inputs.
| Industry | Typical Gross Margin Range | Context |
|---|---|---|
| Software / SaaS | 70% to 85% | High gross margins due to low incremental delivery costs after development. |
| Consumer Packaged Goods | 30% to 50% | Margins depend on brand power, commodity costs, and distribution scale. |
| General Retail | 20% to 40% | Often thinner due to inventory, markdowns, and supplier pricing pressure. |
| Restaurants | 25% to 40% | Food costs and waste can significantly affect gross margin. |
| Manufacturing | 20% to 45% | Varies by automation, raw materials, labor mix, and scale. |
Public filings and federal datasets are useful when assessing sector economics. According to the U.S. Census Bureau, wholesale and retail trade performance can vary significantly by category and inventory turnover. The U.S. Small Business Administration emphasizes the importance of understanding cost structure and pricing when evaluating profitability. For accounting and financial statement education, the Corporate Finance Institute is popular, but for academic grounding you can also review finance and accounting materials from university sources such as Harvard Business School Online.
While exact averages shift over time, inflation, labor pressure, logistics disruptions, and commodity price swings can materially compress gross margins in product-heavy businesses. That is why trend analysis often matters more than a single period snapshot.
Gross Margin vs Markup
Another common source of confusion is the difference between gross margin and markup. Gross margin uses revenue as the denominator. Markup uses cost as the denominator. They are related, but not interchangeable.
For a product that costs $50 and sells for $75, gross profit is $25. Gross margin is $25 divided by $75, or 33.33%. Markup is $25 divided by $50, or 50%. If a business uses margin targets but accidentally applies markup percentages, pricing decisions can be wrong by a wide margin.
Quick Comparison
- Gross margin answers: what percent of sales remains after direct costs?
- Markup answers: how much was added above cost?
- Margin is better for financial statement analysis.
- Markup is often used in operational pricing workflows.
How to Improve Gross Margin
Improving gross margin is not only about raising prices. Sustainable margin improvement usually comes from a combination of pricing discipline, cost management, product mix optimization, and operational efficiency.
- Review pricing regularly. If demand is resilient and the product is differentiated, strategic price increases may be possible.
- Negotiate supplier costs. Better terms, volume discounts, and alternate sourcing can lower COGS.
- Reduce waste. Scrap, spoilage, returns, and quality failures erode gross margin.
- Improve product mix. Selling more high-margin products can lift blended margin.
- Control discounting. Excess promotions may increase revenue but reduce margin quality.
- Increase operational efficiency. Better production planning, inventory management, and logistics can lower direct costs.
Margin management should be ongoing, not seasonal. Strong operators measure gross margin by SKU, category, region, customer cohort, and sales channel. This provides a more actionable view than looking only at the company-wide average.
Common Gross Margin Calculation Mistakes
- Using net sales in one period and COGS from another period.
- Including operating expenses in COGS.
- Confusing gross margin with markup.
- Ignoring returns, allowances, and discounts that reduce revenue.
- Failing to account for inventory valuation changes.
- Comparing businesses with very different accounting policies without adjustments.
Small errors in classification can produce large differences in reported gross margin. For example, freight-in often belongs in inventory cost, while outbound customer shipping may be treated differently depending on accounting policy. Businesses should apply consistent rules over time for trend analysis to remain meaningful.
How Investors and Lenders Use Gross Margin
Investors look at gross margin to assess quality of revenue, pricing power, and competitive position. A company with rising gross margin may be improving product differentiation or gaining scale benefits. A company with declining gross margin may be facing commodity inflation, stronger competition, discounting pressure, or inefficient operations.
Lenders also care because gross margin affects cash generation and debt service capacity. Businesses with volatile or weak margins may have less room to absorb sales declines or cost spikes. In this way, gross margin is not just an accounting ratio. It is a practical signal of resilience.
Authoritative Learning Resources
If you want to deepen your understanding of cost structures, business finance, and profitability, these authoritative resources are helpful:
- U.S. Small Business Administration for small business finance, planning, and pricing guidance.
- U.S. Census Bureau Economic Programs for industry and economic data that can support sector comparisons.
- Harvard Business School Online for educational content on margins and financial analysis.
Final Takeaway
The formula to calculate gross margin is simple, but its business value is enormous. Gross Margin = ((Revenue – COGS) / Revenue) x 100. This percentage shows how efficiently a company turns sales into gross profit before operating expenses. It is one of the clearest measures of pricing strength, cost control, and unit economics.
Whether you run a retail shop, an online store, a manufacturing company, or a growing service firm, gross margin should be tracked consistently and reviewed alongside gross profit, markup, and operating expenses. Use the calculator above to model different scenarios, compare periods, and make smarter pricing and purchasing decisions. The more accurately you calculate and monitor gross margin, the better positioned you are to protect profitability and grow sustainably.