Gross Margin: Definition, Formula, and How to Calculate It

By Christina WendtPublished March 11, 2025Updated September 9, 2026

Gross margin is the difference between what you sell a product for and what it cost you to buy or produce it, expressed as a percentage of the sale price. It tells you how much of every dollar of revenue is left over after paying for the goods themselves, before rent, payroll, marketing, or anything else. In this article, you'll get the formula, worked examples, current industry benchmarks from official retail statistics, and practical ways to improve your margin.

Nahaufnahme der Hände einer männlichen Person in einem weißen Pullover in denen sich verschiedene Euroscheine befinden. Optimiere deine Handelsspanne und spare wertvolles Geld!

Key takeaways

Definition

Gross margin is the difference between net sales price and the cost of the goods sold. It has to cover every other cost you incur to run the business.

Absolute formula

Gross margin (in currency) = Net sales price minus cost of goods

Percentage formula

Gross margin (%) = (Net sales price minus cost of goods) divided by net sales price, multiplied by 100

Always use net prices

Exclude sales tax or VAT from both sides of the equation

Related terms

Retail margin, trade margin, and gross profit are used interchangeably with gross margin in day-to-day retail conversation

Not the same as profit

Gross margin doesn't account for fixed costs like rent, salaries, or marketing. Actual profit is what's left after those come out.

Benchmarks

Gross margins in German retail range from roughly 27% in supermarkets to nearly 60% in specialty textiles (Federal Statistical Office of Germany via HDE Zahlenspiegel 2024, reporting year 2022). Online and mail-order retail sits around 37%.

What is gross margin, and what does it tell you? 

Gross margin is the share of your net sales price left over after paying for the goods you sold. It shows how much of every revenue dollar is available to cover everything else you spend money on, including payroll, rent, marketing, and shipping. In retail, gross margin, retail margin, trade margin, and gross profit are used more or less interchangeably.

Gross margin is one of the most important metrics in retail and e-commerce. It's the foundation of every pricing decision, the starting point for supplier negotiations, and the number you look at when you're deciding whether to keep an SKU in your catalog or drop it.

Important: Gross margin isn't your profit. It doesn't include fixed costs like rent, salaries, insurance, or marketing spend. To put it in perspective: the German food retail sector reported a gross margin of around 27% in 2022, but only 5.8% of revenue actually made it to the operating result once all overhead was subtracted (Federal Statistical Office of Germany). Your real profit only shows up after you subtract every other cost. For a more complete picture, look at contribution margin.

How to calculate gross margin: formula and worked examples 

Gross margin is always calculated using net prices, meaning without sales tax or VAT. For the absolute margin, subtract the cost of goods from the net sales price. For the percentage margin, divide that difference by the net sales price and multiply by 100. That's it.

The two formulas 

Absolute gross margin (in currency):

Gross margin = Net sales price minus cost of goods

Gross margin percentage:

Gross margin (%) = (Net sales price minus cost of goods) ÷ Net sales price × 100

Key terms 

Term

What it means

Cost of goods (landed cost)

What you actually paid to get the product on your shelf: purchase price minus supplier discounts and rebates, plus freight, duties, and other inbound costs.

Net sales price

The list price, excluding sales tax or VAT.

Markup

The percentage you add to the cost of goods to arrive at the sales price. Also called markup percentage.

Target margin pricing (reverse pricing)

Working backward from a market price to figure out the maximum cost you can pay for the product. See reverse pricing

Example 1: An apparel retailer prices a sweater 

Cost of goods: €75. Net selling price: €120.

  • Absolute gross margin: €120 − €75 = €45

  • Gross margin percentage: (€45 ÷ €120) × 100 = 37.5%

Example 2: An online retailer prices a laptop from markup 

Cost of goods: €1,000. Target markup: 35% on cost.

  • Markup amount: 0.35 × €1,000 = €350

  • Net sales price: €1,000 + €350 = €1,350

  • Gross margin percentage: (€1,350 − €1,000) ÷ €1,350 × 100 = 25.93%

Worth remembering: a 35% markup on cost turns into roughly a 26% margin on the sale price. Markup and margin are not the same thing, and mixing them up is one of the most common pricing mistakes in retail.

Example 3: A startup works backward from the market price 

A comparable product from a competitor sells for $35.99 including tax. You need to know how much you can afford to pay a supplier and still hit your numbers.

  • Assumed cost of goods: €20.00

  • Absolute markdown from sale price: €35.99 − €20.00 = €15.99

  • Markdown as percentage: (€15.99 ÷ €35.99) × 100 = 44.43%

What are the different types of gross margin? 

There are five common types. Item margin measures a single SKU. Category margin measures a whole product category. Company-wide margin measures the entire business. Markup measures the difference relative to cost. Markdown measures the difference relative to the sale price. They all use the same underlying math; they just change the reference point.

Type

Reference point

What you use it for

Item margin

A single SKU

Judging product-level profitability, spotting your real bestsellers

Category margin

A product category or group

Category management, deciding where to invest shelf space or ad budget

Company-wide margin

The whole business

Tracking overall earning power, year-over-year comparisons

Markup

Cost of goods

Deriving sales prices from your cost base

Markdown

Sales price

Working backward to find your maximum acceptable cost of goods

Gross margin vs. markup vs. contribution margin vs. profit 

Gross margin, retail margin, trade margin, and gross profit all mean the same thing in retail practice. Markup is different because it's calculated against cost of goods, which makes the percentage look higher than the margin on the sale price. Contribution margin goes one step further and also subtracts variable costs like shipping and fees.

Metric

Reference point

What it tells you

Gross margin / retail margin / gross profit

Net sales price

What's left after paying for the goods themselves

Markup / markup percentage

Cost of goods

How much you're adding on top of your cost

Contribution margin

Net sales price

What's left after all variable costs, including shipping, returns, and payment fees

Net profit

Total revenue

What's left after all costs, including fixed overhead and taxes

Practical rule of thumb: When your marketing team talks about "improving margin," they usually mean gross margin. When your finance team wants to actually understand profitability, they look at contribution margin, or in modern DTC operations, CM3 (contribution margin after marketing).

What is a good gross margin? 

There's no single right answer. Gross margins vary widely by industry. German food retail runs around 27%, apparel around 48%, and specialty textiles nearly 60% (Federal Statistical Office of Germany, 2022). What matters is whether your margin covers every downstream cost and still leaves enough for profit.

For context: even in high-margin categories, the operating surplus (gross margin minus all payroll and overhead) is usually in the single digits as a share of revenue. German food retail nets about 5.8% at the operating line despite that 27% gross margin (HDE Zahlenspiegel 2024, p. 16). If you're pricing for a 30% gross margin, expect a low single-digit net profit unless you're running an unusually lean operation.

What determines a "good" margin for your business:

  • Your fixed cost base (rent, payroll, IT, marketing)

  • Shipping and return rates, especially in e-commerce

  • How price-sensitive your customers are

  • How intense the competition is and how easy prices are to compare online

  • How much of your revenue you give back in promotions and discounts

In e-commerce, a 37% gross margin sounds comfortable on paper (the German mail-order and internet retail average in 2022, per Destatis). Once you subtract shipping, returns, payment processing fees, and marketplace commissions, that same margin can shrink to single digits at the contribution line. That's exactly why looking at contribution margin or CM3 alongside gross margin isn't optional if you're serious about profitability.

What are typical gross margins by industry? 

Gross margins swing dramatically by category. Food, gas stations, and consumer electronics typically run around 22 to 27%. Cosmetics and sporting goods land in the 30s and low 40s. Apparel, jewelry, and furniture run 40 to 50%. Specialty textiles and florists can approach 60%. Online and mail-order retail averages around 37% (Federal Statistical Office of Germany, 2022).

Current German retail benchmarks, drawn from the Federal Statistical Office's Annual Trade Survey (reporting year 2022, published in the HDE Zahlenspiegel 2024, page 16):

Product category (NACE / WZ 2008)

Gross margin (2022)

Food retail (general merchandise, food-led)

26.6%

Tobacco

29.0%

Pharmacies

26.6%

Gas stations (fuel retail)

25.2%

Beverages

36.3%

Mail-order and internet retail

36.5%

Consumer electronics

22.6%

Cosmetics and personal care

32.9%

Sporting goods, bikes, and camping

40.7%

Watches and jewelry

41.2%

DIY, hardware, and home improvement

40.4%

Furniture and home furnishings

44.1%

Apparel

47.9%

Shoes and leather goods

49.0%

Flowers, plants, and gardening

51.0%

Textiles (specialty retail)

59.3%

Source: HDE Zahlenspiegel 2024, page 16, table "Enterprises, employees, and turnover by economic sectors 2022," based on the Destatis Annual Trade Survey. Percentages calculated from absolute revenue and gross margin on merchandise per WZ 2008 industry class. These are averages across all businesses in each industry classification. Actual margins vary widely by business model, size, and channel mix. Discount grocers run well below the food retail average, while premium and specialty operators typically run above it.

How can you improve your gross margin? 

Three levers move gross margin: cutting cost of goods, adjusting sales prices, and reducing overhead. In practice, the biggest gains usually don't come from raising prices. They come from better supplier terms and from cleaning up your assortment so you're not carrying SKUs that drag margins down.

Lever 1: Cost of goods and sourcing 

Negotiate framework agreements, consolidate suppliers where it makes sense, and use payment discounts (cash discounts, early-pay terms) consistently. Make sure inbound costs like freight, duty, and customs clearance are actually being booked into your cost of goods rather than sitting somewhere else on the P&L. Reverse pricing shows you the maximum cost you can accept from a supplier while still hitting your target margin.

Lever 2: Pricing and price strategy 

Review your price positioning against competitors. Test dynamic pricing where it makes sense. Use tiered pricing for B2B customers and run promotions surgically instead of blanket-discounting. Every discount comes straight out of margin, and often more than proportionally once you factor in returns.

Lever 3: Assortment and overhead 

Not every SKU deserves the shelf space it's taking up. A disciplined assortment review, based on margin and inventory turns, frees up working capital and lifts your company-wide margin. In parallel, look at cost drivers in warehousing, shipping, and returns. Better inventory optimization alone can meaningfully cut holding costs.

How does an ERP system help you manage margins? 

An ERP system pulls purchase prices, inbound costs, sale prices, discounts, and shipping data into one dataset and calculates margins automatically per SKU, category, channel, or customer. Instead of reconciling spreadsheets, you see in real time which products are actually making money and where margins are under pressure.

With Xentral, margin management lives in one place:

  • Landed cost per SKU: Inbound costs, supplier discounts, and payment terms flow into the purchase price for each product automatically.

  • Margin reporting by channel: Compare margins on your own store against marketplaces like Amazon, eBay, and others. Spot the channels that actually contribute.

  • Real-time contribution margins: Shipping, payment fees, and returns are attributed at the order level, so CM1 through CM3 are visible without an Excel export.

  • Automated reorder points: Warehouse holding costs shrink because inventory levels match actual demand.

Margins on your dashboard, not buried in a spreadsheet

See in real time which SKUs, categories, and channels are actually earning, and which need to be repriced or dropped.

Frequently asked questions 

14 days for free

Automate all your processes in Xentral ERP

Christina Wendt - Autorin Xentral
Christina Wendt
Christina is passionate about the SaaS world and innovative B2B topics. With her knack for clear, user-focused content, she makes complex subjects accessible and helps companies navigate their digital transformation.
👉 More about Christina