How to Calculate Gross Profit Margin (With Example)

Learn how to calculate gross profit margin step by step. Use net sales and cost of goods sold, then see a worked example and ways to raise the margin.

a plain wooden crate holding three cardboard boxes of different sizes beside a small stack of coins on a clean desk, soft daylight

How much of each sale does your business keep after paying for the products it sells? Gross profit margin answers that question with one percentage. This guide shows how to calculate it, where each number comes from, and how to improve it.

Quick Answer

Subtract cost of goods sold from net sales to find gross profit. Then divide gross profit by net sales and multiply by 100. In our example, a candle shop with $60,000 in net sales and $36,000 in cost of goods sold has a gross profit margin of 40.0 percent.

What Is Gross Profit Margin?

Gross profit margin shows the share of sales left after paying for the goods or services you sell. It is always a percentage. Accountants also call it gross margin.

The number focuses on direct costs. It leaves out rent, salaries, marketing, and interest. Those costs come later, when you calculate net profit.

Why does this matter? A higher margin gives you more room to cover operating costs. A falling margin can signal rising supplier prices, weak pricing, or discounts that go too deep.

The margin also helps you test prices. If your margin is thin, a small rise in costs can erase most of the profit on each sale.

The Formula Step by Step

The formula needs two numbers. The first is net sales. The second is cost of goods sold, often shortened to COGS.

The IRS uses the same logic for small businesses. It starts with net receipts, which are gross receipts minus returns and allowances. Then it subtracts cost of goods sold to reach gross profit.

Formula: Gross profit margin = ((Net sales – Cost of goods sold) / Net sales) x 100

  1. Find net sales. Subtract returns, discounts, and allowances from gross sales.
  2. Find cost of goods sold. Use the inventory method in the next section.
  3. Subtract COGS from net sales. The result is your gross profit in dollars.
  4. Divide gross profit by net sales. This gives the margin as a decimal.
  5. Multiply by 100. The decimal becomes a percentage.

The result shows the margin on each sales dollar. A 40 percent margin means 40 cents of every sales dollar is gross profit.

Gross profit margin formula with Lena’s exampleNet sales of $60,000 minus cost of goods sold of $36,000 equals gross profit of $24,000. Dividing $24,000 by $60,000 and multiplying by 100 gives a 40.0 percent gross profit margin.Gross profit margin, step by stepNet sales$60,000–Cost of goods sold$36,000=Gross profit$24,000Margin40.0%Divide gross profit by net sales: $24,000 / $60,000 = 0.40Multiply by 100: 0.40 x 100 = 40.0 percentEach sales dollar keeps 40 cents after direct costs.
Figure 1: The gross profit margin steps with the example numbers used in this guide.

Finding Cost of Goods Sold

Cost of goods sold covers the direct cost of the products you sold during a period. It usually includes materials, inventory purchases, and direct production costs.

The IRS describes a simple inventory method for merchants. It uses three numbers: beginning inventory, purchases, and ending inventory.

Cost of goods sold = Beginning inventory + Purchases – Ending inventory

  • Beginning inventory. The stock you have on hand at the start of the period.
  • Purchases. The stock you bought during the period, including freight costs where they apply.
  • Ending inventory. The stock still unsold at the end of the period.

Ending inventory is subtracted because it did not sell. Only the cost of goods that actually sold belongs in COGS.

Service businesses may have no cost of goods sold. The IRS notes that gross profit can equal net receipts for those firms. Many service firms still track direct labor or subcontractor costs, which can lower their margin.

Worked Example With Lena’s Candle Shop

Lena runs a small candle shop. Her records cover one full year. The figures below are invented for this example.

Lena’s annual figures
Item Amount
Gross sales $62,000
Returns and discounts $2,000
Net sales $60,000
Beginning inventory $8,000
Purchases $35,000
Ending inventory $7,000
Cost of goods sold $36,000

Follow these steps to get the margin.

  1. Find net sales. $62,000 – $2,000 = $60,000.
  2. Find cost of goods sold. $8,000 + $35,000 – $7,000 = $36,000.
  3. Find gross profit. $60,000 – $36,000 = $24,000.
  4. Divide by net sales. $24,000 / $60,000 = 0.40.
  5. Multiply by 100. 0.40 x 100 = 40.0 percent.

Lena’s gross profit margin is 40.0 percent. For every dollar of net sales, she keeps 40 cents after paying for candles and materials.

Check the result by reversing the math. 40 percent of $60,000 is $24,000, which matches her gross profit. Lena still pays rent, wages, and utilities from that $24,000, so her net profit will be lower.

What a Good Gross Margin Looks Like

No single gross margin fits every business. A grocery store often runs on thin margins because it sells large volumes. A software company can post much higher margins because extra copies cost little to make.

For a broad benchmark, NYU Stern professor Aswath Damodaran publishes margin data for US firms. His January 2026 dataset lists an average gross margin of 37.76 percent across all US firms. That figure covers listed companies, so a small business may differ.

Compare your margin with businesses in your own industry. Then track your own trend over several periods. A margin that falls for several periods deserves a closer look, even if it still beats the industry average.

How to Raise Your Gross Profit Margin

You can raise gross profit margin in two main ways. You can raise prices, or you can lower cost of goods sold. Figure 2 compares two single-change scenarios for Lena.

Lena’s gross profit margin under two scenariosThe current margin is 40.0 percent, from $24,000 gross profit over $60,000 net sales. A 5 percent price increase lifts net sales to $63,000 and gives 42.9 percent. Cutting cost of goods sold to $33,000 keeps net sales at $60,000 and gives 45.0 percent.Lena’s gross profit margin under two scenariosCurrent: $24,000 gross profit / $60,000 net sales40.0%Prices up 5%: $27,000 gross profit / $63,000 net sales42.9%COGS cut to $33,000: $27,000 gross profit / $60,000 net sales45.0%
Figure 2: Lena’s gross profit margin after each single change, using the same formula.

A 5 percent price increase on $60,000 in sales adds $3,000. Gross profit rises to $27,000, and the margin reaches 42.9 percent. This assumes customers buy the same volume at the higher price.

A supplier discount that cuts cost of goods sold by $3,000 also lifts gross profit to $27,000. Because net sales stay at $60,000, the margin reaches 45.0 percent.

Other steps can help:

  • Review prices each year. Pay special attention to products with rising material costs.
  • Compare suppliers. Ask for bulk pricing before you reorder.
  • Reduce waste. Spoiled or damaged stock raises COGS without adding any sales.
  • Clear slow stock. Old inventory ties up cash and often leads to deep markdowns.

Pricing changes are easy to misread. Our markup vs margin guide explains why the two numbers differ. Next, read our net profit definition to see what comes after gross profit. More money guides live in the finance hub.

Common Mistakes to Avoid

Small errors change the result. Check these points before you compare margins.

  • Using gross sales. Use net sales after returns and discounts.
  • Forgetting ending inventory. Skipping it overstates COGS and understates the margin.
  • Adding operating costs to COGS. Rent and marketing belong below gross profit.
  • Comparing across industries. Retail and software margins follow different patterns.

Review each input once more before you use the number for pricing or loan decisions.

General education, not financial, tax, or legal advice. This content is for planning and estimation only. The figures here are invented for a worked example. A licensed professional can review your real sales, costs, and reporting rules.

FAQs About Gross Profit Margin

What is a good gross profit margin?

There is no single good number. Margins vary widely by industry and business model. Compare your margin with peers and with your own past results.

Is gross margin the same as gross profit margin?

Yes, in most business writing the two terms mean the same thing. Both express gross profit as a percentage of net sales.

Does gross profit margin include operating expenses?

No. Rent, salaries, marketing, and interest come after gross profit. They reduce net profit, not gross profit margin.

Should I use gross sales or net sales in the formula?

Use net sales. Subtract returns, discounts, and allowances from gross sales first. This keeps the margin tied to money you actually kept from sales.

How does the formula work for a service business?

Many service businesses have no cost of goods sold. The IRS notes that gross profit can then equal net receipts. Track direct labor or subcontractor costs if you want a more useful margin.

Can gross profit margin be negative?

Yes. A negative margin means cost of goods sold is larger than net sales. The business loses money on each sale before paying any operating costs.

How often should I calculate gross profit margin?

Calculate it every month or quarter. Frequent checks show cost changes and pricing problems early, before they hurt annual results.

Sources and Further Reading

References Used in This Article

The figures here are worked examples with invented numbers, not data from a real business. Your sales, costs, and reporting rules will differ. Reviewed for accuracy by Prof. Dr. Khalil Mudassar, PhD. Last updated November 15, 2026.


See Our Tools

Useful tools from AskWebTools

Jump from the guide to a practical online utility and continue your task.

Explore all tools
About the Author

Shakeel Muzaffar

Shakeel Muzaffar is the Founder and Editor-in-Chief of AskWebTools.com, with 15+ years of experience in digital publishing, product strategy, and web tool development.

132 published articles View all posts → Website ↗