Gillia
Try Gillia Capabilities Point of sale Inventory Online store Bookings CRM & loyalty Quotes & invoicing Use cases Use cases Pricing About What's new

How to calculate gross margin: formulas, examples and tips

Gross margin, markup, margin percentage: the formulas you need, worked examples and the levers that improve your store's profitability without necessarily raising prices.

With Gillia, you can query your sales data in plain language and review your margins by category once your purchase costs are recorded.

Create an account
How to calculate gross margin: formulas, examples and tips

A store can sell more without necessarily making more money. Rising revenue can hide higher purchase costs, discounts that go too deep or a shift in sales toward less profitable products.

To understand what your business really earns, you need to track your gross margin. This metric measures the difference between your sales and the cost of the goods you sold, and it also shows which products contribute most to your store's profitability.

How do you calculate gross margin? What's the difference between markup and margin? And how can you improve your results without necessarily raising prices?

What is gross margin?

Gross margin is the difference between your merchandise sales and what that merchandise cost you to buy.

It measures what's left after you account for the cost of the products sold, before you deduct your store's other expenses: rent, payroll, insurance, energy or administrative costs.

For a single product, the simplified formula is:

Gross margin = Selling price excl. VAT − Purchase cost excl. VAT

Let's say a store buys an item for €40 excl. VAT and sells it for €70 excl. VAT.

Its gross margin per unit is:

70 − 40 = €30 excl. VAT

That €30 isn't net profit. It still has to help cover the business's other expenses.

At the store level, total gross margin is your revenue excl. VAT minus the purchase cost of the goods sold over the same period.

How do you calculate markup?

Margin in euros gives you a first indication. But it doesn't always let you compare products with very different prices.

Markup measures your margin relative to the purchase cost.

Markup = (Gross margin ÷ Purchase cost excl. VAT) × 100

Let's go back to our item bought for €40 excl. VAT and sold for €70 excl. VAT.

  • Gross margin: €30
  • Purchase cost: €40
  • Markup: (30 ÷ 40) × 100 = 75%

So the markup is 75%.

This means that for every €100 of purchase cost, the business owner earns €75 in gross margin.

This metric is especially useful for tracking how your margins change when supplier prices move.

Markup vs. margin: what's the difference?

These two metrics are often confused, even though they're calculated on a different basis.

Markup compares the margin to the purchase cost, while margin percentage compares it to the selling price.

Margin percentage = (Gross margin ÷ Selling price excl. VAT) × 100

For our item bought for €40 excl. VAT and sold for €70 excl. VAT:

  • Markup: 75%
  • Margin percentage: (30 ÷ 70) × 100 = 42.86%

The margin percentage tells you that 42.86% of the selling price excl. VAT is gross margin.

This distinction matters most when you're setting your prices.

For example, to get a 40% margin on an item you buy for €30 excl. VAT, here's how to calculate the selling price:

Selling price excl. VAT = Purchase cost excl. VAT ÷ (1 − Margin percentage)

That gives you:

30 ÷ (1 − 0.40) = €50 excl. VAT

Be careful not to plug a 40% markup into this formula: you'd get a different result.

Why doesn't higher revenue mean better profitability?

Picture two months of business at a store.

MetricMonth 1Month 2
Revenue excl. VAT€20,000€24,000
Cost of goods sold€12,000€15,600
Gross margin€8,000€8,400
Margin percentage40%35%

Revenue goes up 20%, but gross margin only grows 5%.

The store is making more sales, but each euro of sales contributes proportionally less to its margin.

There are several possible explanations:

  • Higher supplier prices.
  • More frequent or deeper promotions.
  • Growing sales of low-margin products.
  • A change in the product mix, meaning how sales are split across your different items.

That's why tracking revenue isn't enough on its own: you also need a real sales analysis.

How do you find your most profitable products?

A product with a high markup isn't necessarily the one that earns your store the most.

Take two items:

MetricProduct AProduct B
Selling price excl. VAT€100€40
Purchase cost excl. VAT€50€25
Margin per unit€50€15
Units sold10100
Total margin€500€1,500

Product A earns more margin per unit, but product B brings in three times more total margin thanks to its sales volume.

To analyze what an item really contributes, you need to look at three things together:

  1. Gross margin per unit.
  2. Units sold.
  3. Total gross margin generated over the period.

This approach keeps you from favoring only your most expensive products or the ones with the best margin percentage.

You can also add inventory turnover to the picture. A product that looks profitable on paper but sits on the shelf for months can tie up cash and add storage costs.

How can you improve your store's gross margin?

Improving your margin doesn't necessarily mean raising every price. There are several levers to look at.

1. Check your purchase costs regularly

When a supplier raises its price, your margin automatically shrinks if your selling price stays the same.

So it's worth regularly comparing your current purchase costs with the ones recorded in your catalog.

Where it applies, also factor in costs directly tied to acquiring the goods: shipping, customs duties or other incidental costs.

A margin calculated from incomplete costs can give a misleading picture of your profitability.

2. Measure the impact of promotions

A discount can boost sales volumes while sharply cutting your margin per unit.

An item usually sold for €100 excl. VAT and bought for €60 excl. VAT earns €40 in margin.

With a 20% discount, its selling price drops to €80 excl. VAT and its margin falls to €20.

In this case, the discount cuts the margin per unit in half.

To keep the same total margin, the store would need to sell twice as many units, assuming the unit cost stays the same.

Before launching a promotion, it's worth estimating how many extra units you'll need to sell to make up for the lower margin.

3. Analyze margins by product category

Reviewing every item one by one can get complicated when your catalog has several hundred products.

Starting with a category-level analysis helps you spot the categories that:

  • Generate the most total margin.
  • Have a declining margin percentage.
  • Are growing in revenue but not in margin.
  • Have purchase prices rising quickly.

Once you've pinpointed a category, you can drill down to the items involved.

4. Keep an eye on products that tie up cash

Inventory has a significant indirect impact on profitability.

A slow-selling product can add storage costs, lose value or need a discount to clear.

On the other hand, repeated stockouts on a profitable item can mean lost sales and lost margin.

That's why margin management works best when it's tied to inventory data, sales volumes and replenishment needs.

5. Adjust prices carefully

A price increase can improve your margin per unit, but it can also reduce the volume you sell.

Before changing a price, look at several factors:

  • How your purchase costs are changing.
  • The product's market positioning.
  • How price-sensitive your customers are.
  • The prices of available alternatives.
  • The product's contribution to your overall sales.

The goal isn't to squeeze the maximum margin out of every item, but to find the right balance between price, volume and profitability.

How can you track your margins automatically?

When your store manages a large catalog, recalculating the margin on every product by hand quickly becomes a chore.

Business management software can match selling prices, purchase costs and units sold to calculate margins by item or by category.

You can then add this information to a store dashboard.

AI can also make it easier to explore this data. For example, a business owner might ask:

Which product categories lost the most margin this month?

The analysis can then compare periods, identify the categories involved and help you figure out whether the gap comes from costs, prices or the sales mix.

This is one of the approaches Gillia offers: you can query your sales data in plain language and review margins by category when purchase costs are available.

That said, the reliability of the results depends directly on the quality of the data you record. A missing or outdated purchase cost can skew your conclusions, whatever tool you use.

How often should you analyze your margins?

There's no one-size-fits-all answer.

If your supplier prices change often, weekly tracking can be useful, especially for your best-selling items.

A monthly analysis usually gives you more perspective on product categories and shows how profitability is shifting.

Finally, a one-off check is especially useful after a change of supplier, an increase in purchase costs, a promotion or a major change to your selling prices.

What matters is having data that's recent enough to act before a drop in margin takes hold.

Conclusion

Gross margin is a key metric for understanding what your sales really bring to your store.

Tracking it takes you beyond revenue alone: it shows which products contribute most to your margin and reveals the impact of promotions, purchase costs or changes to your catalog.

The analysis becomes especially useful when you look at margins alongside sales volumes, inventory levels and trends over time.

Rather than just trying to sell more, the real question is which sales actually drive your store's financial performance.

FAQ: gross margin

Gross margin measures the difference between merchandise sales and what that merchandise cost to buy. Profit also takes into account the business's other income and expenses. So a positive gross margin doesn't guarantee a profit.

There's no ideal markup that applies to every business. It depends on your industry, the type of product, the volumes you sell, your expenses and your pricing strategy. It's more useful to compare yourself with similar businesses and track how your own margin evolves.

Gross margin is normally calculated on amounts excluding VAT when you can recover the VAT. Using prices that include VAT without accounting for VAT rules can skew your results.

In a simple case where the unit cost and selling price stay the same: Total margin = Margin per unit × Units sold. When costs, prices or discounts change, use the actual amounts recorded to get a reliable result.

Yes. Higher sales volumes can come with deep discounts or higher purchase costs. Revenue grows while your margin percentage, or even your total margin, shrinks.

What if you could just ask where your margin went?

Which product categories lost the most margin this month?

Gillia understands your questions, analyzes your data and turns the answers into action. Try it free for 14 days, no credit card required.

Try Gillia free