Margin calculator: gross margin, markup and margin by customer

Published · Updated · 12 min read

Dylan Arnaud, founder of Datafuji

Gross margin is gross profit (selling price − cost) divided by the selling price; markup is the same gross profit divided by the cost. An item bought for €84 and sold for €120 leaves €36 of gross profit: a 30% gross margin (36 ÷ 120) and a 42.86% markup (36 ÷ 84). The price multiplier, price ÷ cost, is 1.4286.

Calculate your gross margin, markup and price multiplier

The calculator gives the gross margin, markup, price multiplier and selling price from two figures. Choose the pair you know: cost and price, cost and a target gross margin or markup, cost and multiplier, or a fixed selling price and the gross margin you need to keep. It opens on a batch bought for €84 and sold for €120 by a fictitious electrical supplies distributor.

All amounts are excluding VAT. The VAT rate, 20% by default (the standard rate in France), only gives the price including VAT: set it to 0 if you don’t charge VAT.

Calculator · your figures stay in your browser
Selling price excl. VAT
€120.00
€144.00 incl. VAT
Gross profit
€36.00
per unit, excl. VAT
Gross margin
30.00%
profit ÷ selling price
Markup
42.86%
profit ÷ cost
Price multiplier
1.4286
1.7143 to the price incl. VAT

Out of a €120.00 selling price (excl. VAT), €36.00 is left to cover overhead and make a profit: 30.0% of the price (gross margin), or 42.9% of the cost (markup). Both describe the same gross profit.

Paste your sales: margin by customer and by product

This second calculator works on your actual sales: gross margin, each customer’s or product’s share of gross profit, and the lines sold below cost. Paste them from Excel, with a revenue column, a cost column and a column to group by.

Columns are recognized by their headers, and nothing leaves your browser.

Margin by customer and by product · nothing is uploaded
Revenue
€183,100
12 rows
Gross profit
€47,550
cost €135,550
Gross margin
26.0%
markup 35.1%
Simple average
28.6%
of the rates, unweighted
Gross profit by customer, highest to lowest
CustomerRevenueGross profitGross marginShare of revenueShare of gross profit
Élec Services€55,400€17,20031.0%30.3%36.2%
Bâti Ouest€79,500€15,30019.2%43.4%32.2%
Martin et Fils€18,700€6,70035.8%10.2%14.1%
Novelec€19,100€5,40028.3%10.4%11.4%
Atelier Roux€10,400€2,95028.4%5.7%6.2%

Your actual gross margin is 26.0%, while the simple average of the rates by customer gives 28.6%: only the actual rate accounts for the weight of each one. Bâti Ouest accounts for 43% of revenue but only 32% of gross profit. Sold below cost: Atelier Roux · ICTA 20 conduit (€150 loss).

How do you calculate gross margin?

Gross margin = (selling price − cost) ÷ selling price × 100. It measures how much of each euro of sales is left once the goods are paid for: at 30%, €100 of sales leaves €30 of gross profit.

Gross profit
  = selling price
    − cost
  = 120 − 84 = €36

Gross margin
  = gross profit ÷ selling price × 100
  = 36 ÷ 120 = 30%

Markup
  = gross profit ÷ cost × 100
  = 36 ÷ 84 = 42.86%

Price multiplier
  = selling price
    ÷ cost
  = 120 ÷ 84 = 1.4286

A typical scenario in distribution: the sales rep prices quotes at “cost plus 30%,” while the supplier recommends a 30% margin. If everything sells at that price, the accountant will find a 23% gross margin in the books (€30 of gross profit on a €130 price). Nobody got the math wrong; each was talking about a different rate.

Everything is calculated excluding VAT. The cost includes the price paid to the supplier and the costs of bringing the goods in, such as freight or customs duties. Markup can exceed 100%: an item bought for €50 and sold for €120 has a 140% markup. Gross margin never can.

What is the gross margin on goods sold?

For a business that resells goods as they are, gross profit is sales of goods minus the cost of the goods sold. Bpifrance Création, the business creation service of the French public investment bank, defines it as the difference between the selling price of the goods and their purchase cost, which measures the gross gain the business makes on its distribution activity. Over the year, the example distributor sold €183,100 of goods that cost it €135,550: 183,100 − 135,550 = €47,550 of gross profit, a 26.0% gross margin.

It is the margin of distribution and retail, and the first subtotal of the income statement: everything else, from payroll to rent, is paid out of it. In France, it is the first of the intermediate management balances: the SIG table shows what comes next, down to net income.

Markup vs. margin: what is the difference?

Both measure the same gross profit on two different bases: markup divides it by the cost, margin by the selling price. Margin is therefore always the lower of the two, and it can never reach 100%.

In English, “margin” on its own almost always means gross margin on price. Beware of translations: in France, the everyday “taux de marge” is a markup, and the gross margin is called “taux de marque.”

A €120 bar, excluding VAT, made of an €84 cost and €36 of gross profit. Divided by the cost, the profit gives a 42.86% markup; divided by the selling price, a 30% gross margin. The price multiplier, price ÷ cost = 120 ÷ 84, is 1.4286.A €120 bar, excluding VAT, made of an €84 cost and €36 of gross profit. Divided by the cost, the profit gives a 42.86% markup; divided by the selling price, a 30% gross margin. The price multiplier, price ÷ cost = 120 ÷ 84, is 1.4286.
Same item, same €36 of gross profit: a 42.86% markup and a 30% gross margin.

Only the denominator changes. Buyers think in terms of markup: for €100 spent, how much do I make? Sales and finance think in terms of gross margin: out of €100 invoiced, how much is left? Whoever sets prices uses the multiplier: cost × multiplier = selling price.

Every formula, in every direction

The price multiplier has no official definition; it is trade practice, and follows directly from the two rates.

What you wantFormulaExample (€84 → €120)
Gross profitSelling price − cost120 − 84 = €36
Gross marginGross profit ÷ selling price × 10036 ÷ 120 = 30%
MarkupGross profit ÷ cost × 10036 ÷ 84 = 42.86%
Price multiplierSelling price ÷ cost120 ÷ 84 = 1.4286
Multiplier to the price incl. VATSelling price incl. VAT ÷ cost excl. VAT144 ÷ 84 = 1.7143
Margin from markupMarkup ÷ (1 + markup)0.4286 ÷ 1.4286 = 30%
Markup from marginMargin ÷ (1 − margin)0.30 ÷ 0.70 = 42.86%
Multiplier from either rate1 + markup = 1 ÷ (1 − margin)1 ÷ 0.70 = 1.4286

How do you set a price for a target margin?

For a target gross margin, divide the cost by (1 − margin); for a target markup, multiply it by (1 + markup). With a 30% margin, €84 ÷ 0.70 = €120; with a 30% markup, €84 × 1.30 = €109.20.

The costliest trap is aiming for a margin by adding the percentage to the cost.

Two ways to price a batch bought for €84, on the same scale. Wrong: cost × 1.30 gives €109.20, €25.20 of profit and a gross margin of only 23.1%. Right: cost ÷ 0.70 gives €120, €36 of profit and the targeted 30% gross margin. The gap between the two prices, €10.80 of profit, is lost on every batch.Two ways to price a batch bought for €84, on the same scale. Wrong: cost × 1.30 gives €109.20, €25.20 of profit and a gross margin of only 23.1%. Right: cost ÷ 0.70 gives €120, €36 of profit and the targeted 30% gross margin. The gap between the two prices, €10.80 of profit, is lost on every batch.
Adding 30% to the cost gives €109.20 and a 23.1% gross margin, not 30%.

On this one batch, the gap is €10.80 of profit, 30% of the expected gross profit.

The calculation also works backward, when the market sets the price. If installers will only pay €110 and the distributor wants to keep a 30% gross margin, the batch must cost at most 110 × 0.70 = €77. That is the maximum cost to negotiate, which the calculator gives with the “selling price and target gross margin” option.

To show a price including VAT, add the VAT afterward: €120 at 20% VAT is €144. A multiplier applied to the cost to reach a VAT-inclusive price therefore includes the VAT: 1.7143 in the example, not 1.4286.

Conversion table: margin, markup and price multiplier

For common gross margins, the table gives the matching markup and price multiplier (selling price ÷ cost).

Gross marginMarkupMultiplierMultiplier to price incl. 20% VAT
10%11.11%1.11111.3333
15%17.65%1.17651.4118
20%25.00%1.25001.5000
25%33.33%1.33331.6000
30%42.86%1.42861.7143
35%53.85%1.53851.8462
40%66.67%1.66672.0000
50%100.00%2.00002.4000
60%150.00%2.50003.0000

Above a 50% gross margin, markup exceeds 100%: this is normal, as the cost is then less than half the price.

How do you calculate gross margin over a month or a year?

Gross margin = (revenue − cost of goods sold) ÷ revenue. For the example distributor, that gives €47,550 of gross profit and 47,550 ÷ 183,100 = 26.0%.

Cost of goods sold (COGS) depends on the business. For a retailer or distributor, it is the purchase cost of the goods sold. For a manufacturer, it is the cost of production; for a services firm, the cost of delivering the service (subcontracting and time spent, valued at cost).

The same gross profit divided by COGS gives a 47,550 ÷ 135,550 = 35.1% markup. Always say which base your figure uses.

The margin is called gross because it ignores salaries, rent, freight and overhead. For a manufacturer or a service provider, the cost to deduct has to be calculated first: the cost price calculator builds it up step by step, from purchase cost to full cost.

Over a month: margin is calculated on goods sold, not goods bought

Over a period, gross margin is calculated on the cost of goods sold, not on the period’s purchases. COGS is purchases, plus beginning inventory, minus ending inventory.

Gross profit
  = sales −
    (purchases + beginning
     inventory − ending inventory)

Take two months at the distributor, with fictitious figures. In March, it sells €15,000 and buys €14,000 to fill the warehouse, where inventory rises from €20,000 to €23,000. In April, it sells as much, buys only €8,000, and inventory falls back to €20,000.

Two months with identical sales of €15,000. March: €14,000 of purchases, inventory from €20,000 to €23,000. April: €8,000 of purchases, inventory from €23,000 to €20,000. Calculated on the month’s purchases, gross profit is €1,000, or 6.7%, in March, then €7,000, or 46.7%, in April: wrong. Calculated on cost of goods sold, €11,000 each month, it stays at €4,000, or 26.7%, in both months: right. The bars show the wrong rate jumping and the right rate staying flat.Two months with identical sales of €15,000. March: €14,000 of purchases, inventory from €20,000 to €23,000. April: €8,000 of purchases, inventory from €23,000 to €20,000. Calculated on the month’s purchases, gross profit is €1,000, or 6.7%, in March, then €7,000, or 46.7%, in April: wrong. Calculated on cost of goods sold, €11,000 each month, it stays at €4,000, or 26.7%, in both months: right. The bars show the wrong rate jumping and the right rate staying flat.
Without the change in inventory, the margin jumps from 6.7% to 46.7%; the true margin stays at 26.7% both months.

Cost of goods sold is €11,000 each month (14,000 + 20,000 − 23,000, then 8,000 + 23,000 − 20,000). Margin then follows the pace of sales, not that of supplier orders.

Restaurants apply the same rule to their food cost percentage: purchases + beginning inventory − ending inventory, divided by revenue excl. VAT. The calculation and an example are in the hospitality guide.

In the US and the UK

US and UK income statements carry the gross profit used on this page, under English names: revenue, or turnover in the UK, minus cost of sales. Companies that file with the SEC must state separately net sales of tangible products and the cost of tangible goods sold (Regulation S-X, Rule 5-03), so their gross margin can be read from the income statement. The UK accounts regulations for small companies offer two profit and loss formats: Format 1 shows turnover, cost of sales and a “gross profit or loss” line; Format 2 lists raw materials and consumables, other external charges and staff costs, with no gross profit. With Format 2 accounts, rebuild the cost of goods sold from purchases and the change in inventory, as shown above.

How do you calculate the margin across all your sales?

The overall rate is the ratio of the totals: total gross profit ÷ total revenue for the gross margin, ÷ total cost for the markup. Never the average of each customer’s or each product’s rate, which gives them all the same weight.

The example distributor made €183,100 of revenue with five customers, for €135,550 of cost. Its actual gross margin is 26.0%. Yet the average of its five customers’ margins comes out at 28.6%. These are the sales already loaded in the second calculator.

Five bars, one per customer: length shows gross margin, thickness shows revenue. Bâti Ouest, €79,500, or 43% of sales, is the thickest and the shortest, at 19.2%. Élec Services, €55,400, is at 31.0%; Novelec, €19,100, at 28.3%; Martin et Fils, €18,700, at 35.8%; Atelier Roux, €10,400, at 28.4%. The simple average of the five rates, dotted orange line, shows 28.6%: wrong. The actual rate, green line, €47,550 of gross profit on €183,100 of sales, is 26.0%.Five bars, one per customer: length shows gross margin, thickness shows revenue. Bâti Ouest, €79,500, or 43% of sales, is the thickest and the shortest, at 19.2%. Élec Services, €55,400, is at 31.0%; Novelec, €19,100, at 28.3%; Martin et Fils, €18,700, at 35.8%; Atelier Roux, €10,400, at 28.4%. The simple average of the five rates, dotted orange line, shows 28.6%: wrong. The actual rate, green line, €47,550 of gross profit on €183,100 of sales, is 26.0%.
The average of the five rates shows 28.6%; the distributor’s true gross margin is 26.0%.

The 2.6-point gap comes from a single customer: Bâti Ouest makes up 43.4% of revenue, at a 19.2% gross margin. The simple average counts it as one fifth, the same as Atelier Roux, almost eight times smaller.

CustomerRevenueGross profitGross marginShare of revenueShare of gross profit
Élec Services€55,400€17,20031.0%30.3%36.2%
Bâti Ouest€79,500€15,30019.2%43.4%32.2%
Martin et Fils€18,700€6,70035.8%10.2%14.1%
Novelec€19,100€5,40028.3%10.4%11.4%
Atelier Roux€10,400€2,95028.4%5.7%6.2%
Total€183,100€47,55026.0%100%100%

The largest customer is not the most profitable. Élec Services brings in €17,200 of gross profit on 30% less revenue than Bâti Ouest, which brings in only €15,300.

For each customer, sorted by share of gross profit, two bars: in gray its share of revenue, in blue its share of gross profit. Élec Services: 30.3% of sales, 36.2% of gross profit, 6 points more. Bâti Ouest, in orange: 43.4% of sales but 32.2% of gross profit, 11 points less. Martin et Fils: 10.2% and 14.1%. Novelec: 10.4% and 11.4%. Atelier Roux: 5.7% and 6.2%.For each customer, sorted by share of gross profit, two bars: in gray its share of revenue, in blue its share of gross profit. Élec Services: 30.3% of sales, 36.2% of gross profit, 6 points more. Bâti Ouest, in orange: 43.4% of sales but 32.2% of gross profit, 11 points less. Martin et Fils: 10.2% and 14.1%. Novelec: 10.4% and 11.4%. Atelier Roux: 5.7% and 6.2%.
Bâti Ouest makes 43% of sales but 32% of gross profit: the largest customer is not the most profitable.

By product, the reading is the same (group by product in the second calculator). Cable makes up 46.9% of sales at a 19.5% gross margin; distribution boards, 26.4% of sales at 36.4%, bring in more gross profit: €17,600 versus €16,700.

Finally, one line is sold below cost: the conduit delivered to Atelier Roux, €2,600 of sales for €2,750 of cost, a €150 loss. It is invisible in the totals by customer and by product; only the line-by-line detail shows it.

So the real question for a sales director or a CFO is not “what is my margin?” but “on which customers and which products am I losing it?” At constant volume, one point of discount granted to Bâti Ouest costs €795 of gross profit; the same point at Atelier Roux, €104.

Why aren’t two “margins” always comparable?

Two figures both called “margin” can describe different things: a gross margin on price, a markup on cost, or a ratio that has nothing to do with the price of a product. Before comparing, check the denominator.

NameFormulaWho uses it
Markup (in France, the everyday “taux de marge”)Gross profit ÷ costBuyers, price setting, many calculators
Gross margin (in France, “taux de marque,” or “taux de marge commerciale” at INSEE)Gross profit ÷ selling price (or sales of goods)Finance, FP&A, retail, trade statistics
Profit share (national accounts; in France, also “taux de marge”)Gross operating surplus ÷ value addedNational statistics offices, macroeconomic analysis

The third one is a macroeconomic ratio: according to INSEE, the French national statistics office, it stood at 31.5% for French non-financial corporations in the second quarter of 2026. Value added is the wealth a company creates, what it produces minus what it consumes to produce it; gross operating surplus is the share it keeps after wages and production taxes.

Outside trade, the base changes again. Bpifrance Création calculates a manufacturer’s margin on its full cost rather than on a purchase cost, as does the hourly rate calculator. Cost accounting reads a margin over direct costs, and break-even analysis a contribution margin over variable costs, both divided by revenue.

Before comparing two figures, ask two questions: which cost was deducted, and what is the rate divided by? A supplier quoting 30% and a dashboard showing 42.86% may be describing exactly the same gross profit.

What is a good gross margin?

There is no universal good margin: the right level depends on the industry, how fast inventory turns and the services provided, and is first judged against the averages of your own trade.

INSEE, the French national statistics office, publishes them for French trade (2020 data, published in January 2023): a 30% gross margin in retail, 21% in wholesale. Its “taux de marge commerciale” is gross profit on goods divided by sales of goods: a gross margin, despite its name. The third column converts it into a markup, margin ÷ (1 − margin); it is not a published figure.

French sector (2020)Average gross marginEquivalent markup
Retail trade, all30%42.9%
Non-specialized stores (incl. supermarkets)22%28.2%
Food in specialized stores35%53.8%
Other household equipment in specialized stores38%61.3%
Wholesale trade, all21%26.6%
Wholesale: food, beverages and tobacco19%23.5%
Wholesale: household goods32%47.1%
Wholesale: other industrial equipment25%33.3%
Motor vehicle trade and repair, all14%16.3%
Average gross margins in French trade in 2020 according to INSEE (Insee Focus no. 284, Ésane 2020 data): 14% in motor vehicle trade and repair, 19% in food wholesale, 21% for wholesale as a whole, 22% in non-specialized stores, 25% in wholesale of other industrial equipment, 30% for retail as a whole, 32% in wholesale of household goods, 35% in specialized food stores, 38% for other household equipment. The fictitious example distributor, at 26.0%, sits just above wholesale of industrial equipment, at 25%. Its largest customer, Bâti Ouest, is at 19.2%, the level of food wholesale.Average gross margins in French trade in 2020 according to INSEE (Insee Focus no. 284, Ésane 2020 data): 14% in motor vehicle trade and repair, 19% in food wholesale, 21% for wholesale as a whole, 22% in non-specialized stores, 25% in wholesale of other industrial equipment, 30% for retail as a whole, 32% in wholesale of household goods, 35% in specialized food stores, 38% for other household equipment. The fictitious example distributor, at 26.0%, sits just above wholesale of industrial equipment, at 25%. Its largest customer, Bâti Ouest, is at 19.2%, the level of food wholesale.
At 26.0%, the example distributor is in line with its sector, wholesale of industrial equipment (25%). Source: INSEE, Insee Focus no. 284, January 5, 2023 (Ésane 2020 data).

The overall rate is reassuring, but the detail by customer showed the largest customer at 19.2%, below the sector average. These are French averages: a business that delivers, stocks or advises more may need a much higher margin. The best benchmark remains your own rate, tracked every month and compared with the previous year.

Six mistakes that distort a margin

Most wrong margins come from six mistakes, each quantified here on the distributor example.

MistakeWhat it produces in the exampleThe right calculation
Adding the percentage to the cost to hit a target margin€84 + 30% = €109.20, a 23.1% gross marginDivide by 0.70: €120
Mixing prices with and without VATA 1.7143 multiplier read as a marginRates calculated excluding VAT; 1.4286 from cost to price
Averaging the rates28.6% shown, 2.6 points too highRatio of the totals: 26.0%
Forgetting back-end rebates (year-end discounts paid to the customer) and deliveryAn overstated customer margin, with no trace on the invoiceDeduct these rebates and the freight you pay
Calculating the month’s margin on the month’s purchases6.7% in March, 46.7% in AprilCost of goods sold: 26.7% both months
Comparing a markup with a margin30% at the supplier, 42.86% on the dashboardBring both figures to the same base

How do you track margin by customer and product every month?

To track gross margin every month by customer, product and sales rep, the calculation has to run automatically from your sales or ERP system, in a dashboard. It shows the actual rate, the variance against the previous year and the lines sold below cost.

That is the job of a Power BI dashboard connected to those sources: the KPIs and an example are in the sales dashboard guide. Compared with the budget, margin is the first variance that FP&A explains: volume, mix, price or costs.

Once your margin is known, the break-even calculator gives the revenue that covers your fixed costs. The working capital requirement calculator shows how much cash your sales tie up, and the EBITDA calculator what is left of the margin after external expenses, payroll and operating taxes.

Margin, EBITDA, working capital requirement and cash are read together in a financial dashboard; markup and gross margin each have their own sheet in the KPI library.

Frequently asked questions

What markup gives a 40% margin?

A 40% gross margin needs a 66.67% markup: markup = margin ÷ (1 − margin) = 0.40 ÷ 0.60. The price multiplier is 1 ÷ (1 − 0.40) = 1.6667, so a €60 cost gives a €100 selling price. The other way round, a 40% markup only gives a 28.57% gross margin, with a multiplier of 1.40. To go from the cost to a price including 20% VAT, multiply these multipliers by 1.20: 2.00 and 1.68.

How do you calculate margin as a percentage?

Divide gross profit by the selling price to get the gross margin, or by the cost to get the markup, then multiply by 100. An item bought for €84 and sold for €120 leaves €36: a 30% gross margin and a 42.86% markup. Always say which one you are quoting.

How do you calculate gross margin in Excel?

With the cost in A2 and the selling price in B2: gross margin =(B2-A2)/B2, markup =(B2-A2)/A2, price multiplier =B2/A2, formatted as percentages. For an overall rate, divide totals: =(SUM(B2:B500)-SUM(A2:A500))/SUM(B2:B500) for the gross margin.

What is the difference between gross margin and net margin?

Gross margin deducts only the cost of what was sold; net margin deducts every expense, down to interest and income tax: it is net income divided by revenue. A healthy gross margin can hide a weak net margin when a customer is expensive to deliver or to serve.

How do you calculate net profit margin?

Net profit margin = net income ÷ revenue × 100. If the distributor in the example has €38,400 of other expenses, its net income is 47,550 − 38,400 = €9,150, or 9,150 ÷ 183,100 = 5.0% of revenue. Always say whether it is before or after tax.

Is a markup the same as a margin?

No. Both use the same gross profit, but markup divides it by the cost and margin by the selling price. A 30% markup and a 30% margin are two different prices: on an €84 cost, €109.20 and €120.

Other free calculators: inventory turnover, NPS and MTBF and MTTR.

Let’s talk about your reporting.

A 30-minute video call with Dylan Arnaud. You come away with a clear scope and a fixed price.

Dylan Arnaud, Power BI consultant and founder of Datafuji
Dylan ArnaudFounder · your single point of contact