The gross profit margin formula tells you how much of every sales dollar is left after you pay the direct costs of making or delivering what you sell. It is one of the fastest ways to check whether your pricing and your costs actually work together. In this guide you will get the formula, three worked examples, a quick calculator table and practical ways to raise your margin.
You don’t need an accounting degree for this. If you can subtract and divide, you can work out your gross margin in under a minute.
Table of Contents
What Is Gross Profit Margin?
Gross profit is your revenue minus the cost of goods sold, usually shortened to COGS. COGS covers the direct costs tied to each sale: raw materials, products you buy to resell, packaging, direct production labor, and for software companies things like hosting and customer support. Gross profit margin is that gross profit shown as a percentage of revenue.
What it leaves out matters just as much. Rent, marketing, office software, admin salaries and other overheads are operating expenses, and they come after gross profit. That is why gross margin is a clean test of your core economics before the rest of the business gets in the way. For a wider look at keeping your books healthy, the SBA has a useful overview on how to manage your business finances.
Gross Profit Margin Formula
Here is the gross profit margin formula in two quick lines:
Gross profit = Revenue − Cost of goods sold (COGS)
Gross profit margin (%) = (Revenue − COGS) ÷ Revenue × 100
The answer is a percentage. A 40% margin means you keep 40 cents of every dollar of sales after direct costs, and the other 60 cents goes to those direct costs.
How to Calculate Gross Profit Margin Step by Step
Step 1: Find your net revenue
Use the total sales for the period you are checking, such as a month, a quarter or a year. If you give discounts or refund orders, subtract those first so you are working with the money you really kept.
Step 2: Add up your COGS
List every direct cost for the same period. Be strict about the period, because mixing a quarter of sales with a month of costs ruins the result.
Step 3: Subtract COGS from revenue
The difference is your gross profit in dollars.
Step 4: Divide and multiply by 100
Divide gross profit by revenue, then multiply by 100. That is your gross profit margin.
Gross Profit Margin Formula Examples
Example 1: Online store
An online store brings in $120,000 in a year. Product costs, packaging and inbound shipping come to $72,000.
- Gross profit = $120,000 − $72,000 = $48,000
- Gross profit margin = $48,000 ÷ $120,000 × 100 = 40%
Example 2: Service business
A small design agency bills $90,000 and pays $58,500 to contractors and for project software that is directly tied to client work.
- Gross profit = $90,000 − $58,500 = $31,500
- Gross profit margin = $31,500 ÷ $90,000 × 100 = 35%
Example 3: Software company
A SaaS company earns $200,000 in subscription revenue. Hosting, payment processing and customer support cost $44,000.
- Gross profit = $200,000 − $44,000 = $156,000
- Gross profit margin = $156,000 ÷ $200,000 × 100 = 78%
If you run a subscription product, pair this with our guide to how to calculate MRR so you can see both recurring revenue and how much of it you keep.
Gross Profit Margin Calculator: Quick Table
You can use a spreadsheet or the table below as a simple gross profit margin calculator. Fill in two numbers and follow the formula in the last column.
| Line | What to enter | Formula |
|---|---|---|
| A. Revenue | Total sales for the period | Your number |
| B. COGS | Direct costs for the same period | Your number |
| C. Gross profit | What is left after COGS | A − B |
| D. Gross profit margin | Percentage of revenue you keep | C ÷ A × 100 |
Spreadsheet tip: put revenue in cell A2 and COGS in cell B2, then type =(A2-B2)/A2 in C2 and format the cell as a percentage. It works the same in Excel and Google Sheets.
Here are a few quick product-level checks:
| Selling price | Direct cost | Gross profit | Gross margin |
|---|---|---|---|
| $50 | $30 | $20 | 40% |
| $100 | $70 | $30 | 30% |
| $20 | $5 | $15 | 75% |
Gross Profit Margin vs Markup vs Net Margin
These three get mixed up all the time, and the mix-up leads to pricing mistakes.
| Metric | Formula | Example |
|---|---|---|
| Gross profit margin | (Price − Cost) ÷ Price | ($50 − $30) ÷ $50 = 40% |
| Markup | (Price − Cost) ÷ Cost | ($50 − $30) ÷ $30 = 66.7% |
| Net profit margin | Net profit ÷ Revenue | Includes all expenses, so it is always lower |
Notice that the same product has a 40% margin and a 66.7% markup. If you add 40% on top of your cost thinking you will get a 40% margin, you will end up with less than you planned.
What Is a Good Gross Profit Margin?
There is no single right number, because it depends heavily on your industry. As a rough guide, software and other digital products tend to have high margins, often well above 60 or 70 percent, while retail, grocery, restaurants and many physical product businesses run much lower. That is why comparing your result with businesses like yours matters more than comparing it with a random average.
Your own trend matters even more. A margin that drops for three months in a row is a warning sign, even if the number still looks decent on paper.
How to Improve Your Gross Profit Margin
- Review your prices. Small, well-tested price increases often help more than cutting costs. Our guide to SaaS pricing models shows several ways to think about it.
- Renegotiate with suppliers. Ask for bulk discounts, compare quotes and look at alternatives.
- Cut waste and returns. Damaged goods, errors and refunds quietly eat into margin.
- Shift your product mix. Promote items with higher margins and rethink those that barely earn anything.
- Bundle products. Packages can raise the average order value without raising direct costs at the same rate.
- Lower shipping and packaging costs. Test lighter packaging or a different carrier.
Here is what a modest improvement looks like. If the online store from Example 1 trims COGS by 10%, it drops from $72,000 to $64,800. Gross profit rises to $55,200, and the margin climbs from 40% to 46% with no extra sales at all.
Common Mistakes When Using the Gross Profit Margin Formula
- Leaving out direct costs. Forgetting packaging, payment fees or contractor costs makes your margin look better than it is.
- Mixing in operating expenses. Rent and marketing belong lower down the income statement, not in COGS.
- Using mismatched periods. Always compare revenue and costs for the exact same dates.
- Ignoring discounts and refunds. Use net revenue, not the listed price.
- Calculating one blended number only. Check margin by product or service too, because one weak line can hide behind a strong one.
Where Gross Margin Fits in Your Planning
Gross margin is the starting point for almost every other money check. Use it to build a realistic small business budget, to predict timing with a cash flow forecast, and to find out how many sales you need to cover fixed costs with a break even analysis. If your margin is weaker than you expected, a SWOT analysis template can help you map the causes and decide what to fix first.
Frequently Asked Questions
What is the gross profit margin formula?
It is (Revenue − COGS) ÷ Revenue × 100. The result is the percentage of sales you keep after paying direct costs.
Is gross margin the same as gross profit margin?
People use the two terms interchangeably. “Gross profit” is the dollar amount, while “gross margin” or “gross profit margin” is that amount shown as a percentage.
Can gross profit margin be negative?
Yes. If your direct costs are higher than your revenue, gross profit is negative. It usually means prices are too low, costs are too high, or both.
How often should I calculate it?
Check it every month if you can, and at least every quarter. Frequent checks help you catch cost increases before they cut into profit.
Final Thoughts
The gross profit margin formula is simple, but it can change the way you run your business. Calculate it this week, look at the result by product, and pick one change from the list above. A few points of margin add up quickly over a full year.



