Explore Dika Ops

How do I calculate gross profit margin on my products?

How do I calculate gross profit margin? Use this formula, a worked example, a product table and the common mistakes, plus a free margin calculator.

7 min read Business software
Golden coin stacks rising beside an upward arrow on a white background

To calculate gross profit margin, subtract the cost of goods sold (COGS) from your revenue, divide the result by revenue, and multiply by 100. The answer is a percentage that shows how much of each sale you keep after paying for the goods themselves, before rent, salaries and other overheads. A product that sells for 40 and costs 26 has a gross profit of 14 and a gross margin of 35 per cent.

You can do the sum on paper or in a spreadsheet. If you want to check a whole price list at once, paste the products into our free profit margin calculator, which works in your browser and fills in the margin, the markup and the profit per unit from any two values. The rest of this guide shows how to get the inputs right, because most wrong margins come from the cost figure, not from the maths.

How to calculate gross profit margin, step by step

  1. Find your revenue. Use the selling price you actually charge per unit, after any discount that applies to every sale. Multiply by the number of units sold to get total revenue for the period.
  2. Find your cost of goods sold. Add up the direct costs of the units you sold: purchase price, inbound freight, packaging and any direct labour that is part of making the product.
  3. Subtract. Gross profit equals revenue minus COGS.
  4. Divide by revenue. This gives the gross margin as a decimal, for example 14 divided by 40 is 0.35.
  5. Multiply by 100. The gross profit margin is 35 per cent.

In a spreadsheet, the same calculation is =(B2-C2)/B2, where B2 is the selling price and C2 is the unit cost, formatted as a percentage. Keep the formula in a single column so that every row uses the same rule.

Calculator, notebook and printed charts on an office desk while someone works out figures
Margin depends on accurate cost and price figures, so check each input before you calculate.

Worked example with three products

The table below uses assumed figures to show how the margin changes when cost or price moves. These numbers are an illustration, not benchmarks for your market.

ProductSelling priceUnit costGross profit per unitGross margin
Standard cable set40261435.0%
Premium cable set60332745.0%
Bulk pack100782222.0%

The bulk pack earns the most money per order yet has the lowest margin. That is a common pattern, and it is why you should track margin and total profit side by side.

Margin and markup are not the same

People often mix up gross margin and markup. Both use the same two numbers, but they divide by different things. Margin divides by the selling price, while markup divides by the cost. The same product therefore shows two different percentages.

MeasureFormulaUsing the standard cable set (cost 26, price 40)
Gross margin(Price minus cost) divided by price14 divided by 40 = 35.0%
Markup(Price minus cost) divided by cost14 divided by 26 = 53.8%

If a supplier or a marketplace talks about a 50 per cent markup, ask whether they mean margin or markup before you agree to a price. The gap between the two is larger than most people expect when margins are high.

Which costs belong in cost of goods sold

Gross margin is only as good as the cost figure you put into it. The direct costs usually include the following. Check which of them your accountant treats as COGS, because local reporting rules and your chart of accounts decide the final classification.

  • Purchase price from the supplier, after any trade discount you are sure of.
  • Inbound freight and import duties that you pay to bring the goods to your warehouse.
  • Packaging that goes with each unit you sell.
  • Direct production labour if you make the product yourself.

Rent, office salaries, marketing and software are usually operating expenses, not COGS. They reduce your net profit, but they do not change gross margin.

Common mistakes that distort the margin

  • Using an old cost. Supplier prices change. Recalculate margin whenever a purchase price moves, not once a year.
  • Forgetting discounts. If customers regularly get 10 per cent off, your real selling price is lower than the list price.
  • Ignoring tax. Make sure both the price and the cost are stated without tax, or with tax, but not a mix of the two.
  • Averaging margins. The average of two product margins is not the margin of the combined sales. Calculate the margin on total revenue and total COGS.

Turning margin into a pricing decision

Once you know the margin you earn today, work backwards from the margin you need. To reach a target gross margin of 30 per cent on a cost of 26, divide the cost by 1 minus the target: 26 divided by 0.70 is about 37.14. Round to a price you can sell at, then check that the customer still sees the product as good value.

Review margins by product, by channel and by customer group. A product with a healthy margin in your own shop can look very different after marketplace fees and a discount campaign, so run the sum for each sales channel separately.

Keeping margin current in a growing business

A margin calculated once in a spreadsheet goes stale quickly. In a growing business, the cost of each product changes with suppliers and freight, and the selling price changes with promotions. We are Dika Design, and we built Dika Ops for companies that buy, make and sell, so purchase prices, stock movements and sales land in the same record. That makes it easier to see the margin per product from the same figures your finance team uses. Our finance module is the place to start if you want margins tied to your ledger. For reporting dashboards built on your own data, see our work in data platforms and business intelligence.

If you are not sure whether your cost figures are complete, our team can review the setup with you. Talk to us and we will explain how the data would flow.

Margin is one input to your cash position, so read cash flow management next to this guide. Shipping costs are often the hidden part of COGS for online sellers, as explained in how to calculate shipping costs when selling online. Once your figures are final, the month-end close checklist shows how to lock the period so the margin you report does not change later.

Frequently asked questions

What is a good gross profit margin?

A good margin depends entirely on your industry, your overheads and your business model. A low margin can be healthy for a high-volume business with few overheads, while a service business may need a much higher one. Compare your margin with your own history and with the margin you need to cover operating costs.

Is gross margin the same as net profit margin?

No. Gross margin deducts only the direct cost of goods sold. Net profit margin deducts all operating costs, interest and tax as well. A business can have a strong gross margin and a weak net margin if overheads are too high.

How do I calculate gross profit margin in Excel?

Put the selling price in one column and the unit cost in the next. In the third column, use the formula =(B2-C2)/B2 and format the result as a percentage. Copy the formula down the column for each product.

Should I calculate margin before or after discounts?

Calculate it on the price the customer actually pays. If you run regular discounts, use the average discounted price for that channel, and show the list-price margin separately so you can see the effect of the discount.

Does gross margin include shipping?

It depends on who pays for shipping and how your accountant classifies it. Inbound freight to your warehouse is usually part of cost of goods. Outbound shipping charged to customers is often treated separately. Confirm the treatment with your accountant so that margins are comparable over time.

How often should I review my margins?

Review them whenever a purchase price, a freight rate or a selling price changes, and at least once a month for your main products. Monthly reviews catch cost increases before they erode a whole quarter of sales.

Next step

Choose your five best-selling products and calculate their gross margin with the formula above. Then calculate the markup on the same products and compare the two. The product with the largest gap between margin and markup is usually the one where your pricing decisions need the most care.

Have a project in mind? Let us talk it through.

Tell us what you want to improve. We will reply with a clear next step.