COC

Margin Calculator — Profit Margin, Markup, Discount & Gross Margin Tool

Margin Calculator

Find your profit margin, selling price, or cost of goods from any two of the others — convert between margin and markup, apply a discount to see its real margin impact, add sales tax or VAT, and check a company's overall gross margin. All instantly.

✓ Five calculation modes   ✓ Solve for cost, revenue, margin, or profit   ✓ Works on mobile

If you've searched "margin calculator," "profit margin calculator," "margin vs markup calculator," or "how to calculate profit margin," this page is built to answer every version of that question — with a live tool, not just a single fixed formula.

0
Calculation Modes
0
FAQs Answered
0
Worked Examples

Margin Calculator

Enter a non-negative number
Enter a non-negative number
Enter a value below 100
Enter a valid percentage
Enter a value below 100
Enter a value between 0 and 100

Shows how much a discount erodes your original profit margin.

Enter a non-negative number
Enter a value below 100
Enter a non-negative number
Enter a positive number
Enter a non-negative number

Company-level gross margin, using total revenue and total cost of goods sold rather than a single item's price.

The Complete Guide to Profit Margin

Everything business owners, retailers, and finance students ask about margin, markup, and pricing.

What is profit margin?

Profit margin is the percentage of a sale's revenue that remains as profit after subtracting the cost of goods sold — it answers "how much of every dollar I bring in do I actually keep?" This is exactly the question behind "margin calculator," "profit margin calculator," and "how to calculate profit margin" searches. A healthy margin means a business has room to absorb unexpected costs or price pressure; a thin margin means even small increases in cost or small discounts can meaningfully hurt profitability, which is exactly why margin is treated as one of the most important numbers in retail and business finance.

The margin formula

Margin is calculated as Margin = (Revenue − Cost) ÷ Revenue, expressed as a percentage — note that it's based on revenue (the selling price), not on cost. First, find the gross profit by subtracting cost from revenue; then divide that profit by revenue and multiply by 100 to get the margin percentage. For example, an item that costs $80 to produce and sells for $100 has a profit of $20, giving a margin of $20 ÷ $100 = 20%. Because this relationship connects four quantities — cost, revenue, profit, and margin — knowing any two lets you solve for the rest, which is exactly what the Solve Margin mode above does.

Margin vs markup — the difference that trips everyone up

Margin and markup describe the exact same $20 profit on that $80-cost, $100-price item, but as different percentages of different base numbers — and mixing them up is one of the most common and costly pricing mistakes a business can make. Margin expresses profit as a percentage of revenue (selling price): $20 ÷ $100 = 20%. Markup expresses that same profit as a percentage of cost: $20 ÷ $80 = 25%. The two are mathematically related by Markup = Margin ÷ (1 − Margin) and Margin = Markup ÷ (1 + Markup), both using decimal form. This is exactly why the Margin ↔ Markup mode above exists — pricing a product using a 25% "margin" when you actually meant a 25% markup (or vice versa) changes your actual profit by a meaningful amount.

How discounts affect your margin

Offering a discount doesn't just reduce your profit by the size of the discount — because margin is calculated as a percentage of revenue, and revenue itself shrinks when you discount, the resulting margin erosion is actually somewhat worse than the discount percentage alone might suggest. The relationship is New Margin = (Old Margin − Discount) ÷ (1 − Discount), both in decimal form. This is exactly why "how does a discount affect profit margin" is worth checking with real numbers rather than assuming a 10% discount simply costs you "10 margin points" — the Margin with Discount mode above calculates the true post-discount margin directly.

Margin, sales tax, and VAT

Sales tax and VAT are collected on top of your selling price and passed through to the tax authority — they don't change your underlying profit margin, but they do change the final gross price your customer actually pays. Calculating a net (pre-tax) selling price from your cost and desired margin first, then adding tax on top, keeps these two calculations properly separated. This is exactly the two-step process the Margin + Tax/VAT mode above performs: it finds your net selling price from cost and margin, then applies the tax rate to show the final gross price the customer sees.

Gross margin vs net margin

Gross margin looks only at revenue minus the direct cost of goods sold (COGS) — the raw cost of producing or acquiring what you sell — without factoring in operating expenses like rent, salaries, or marketing. Net profit margin goes further, subtracting all operating expenses and taxes as well, giving a more complete picture of overall profitability. The Gross Margin mode above calculates the company-level version of this metric directly from total revenue and total COGS, answering "what is gross margin" and "gross margin formula" searches with the exact figure investors and analysts look at first when assessing a company's core profitability.

What counts as a "good" profit margin?

There's no single universal answer — target margins vary enormously by industry, business model, and market conditions. E-commerce and retail businesses commonly operate on margins in the 10–30% range, while luxury goods, software, and certain service businesses can sustain margins of 60–80% or more due to lower relative production costs. Grocery and commodity businesses, by contrast, often run on razor-thin single-digit margins, compensating with high sales volume. This is why comparing your margin against industry benchmarks and direct competitors matters far more than comparing it to a generic "good margin" number.

Where margin calculations are actually used

Retailers and e-commerce sellers use margin calculations to price every product they sell. Manufacturers use them to evaluate whether a production line remains profitable as material costs change. Finance teams and investors use gross and net margin figures to compare a company's profitability against competitors and industry benchmarks. Sales teams use margin-and-discount calculations to know how far they can negotiate on price before a deal stops being profitable. And anyone running a side business or freelance operation uses the same core margin formula to make sure their pricing actually covers costs and leaves room for genuine profit.

How the Margin Calculator Works

Four simple steps take you from cost and price to a verified margin.

1

Choose a Calculation Mode

Select basic margin solving, margin-to-markup conversion, discount impact, tax/VAT, or company gross margin.

2

Enter Your Known Values

Provide cost, revenue, or margin — whichever two you already have.

3

Automatic Margin Calculation

The calculator applies the correct margin formula instantly, solving for whatever's missing.

4

Review Your Results

See margin, profit, markup, or gross price together, with the formula used shown clearly.

Margin Formulas

The core equations behind every calculation mode on this page.

Margin = (Revenue − Cost) ÷ Revenue

Profit Margin. Profit expressed as a percentage of revenue (selling price).

Revenue = Cost ÷ (1 − Margin)

Revenue From Cost & Margin. Finds the selling price needed for a target margin.

Markup = Margin ÷ (1 − Margin)

Margin to Markup. Converts a margin percentage into the equivalent markup percentage.

New Margin = (Old Margin − Discount) ÷ (1 − Discount)

Margin With Discount. The true margin remaining after applying a discount.

Gross Margin = (Revenue − COGS) ÷ Revenue

Company Gross Margin. The same core formula applied at the whole-company level.

Step-by-Step Worked Examples

Eight real calculations, shown with every step.

Example 1 — Basic Margin From Cost and Price

Cost = $80, Revenue = $100 Profit = 100 − 80 = $20 Margin = 20 ÷ 100 = 20%

An $80-cost item sold for $100 delivers a 20% profit margin.

Example 2 — Finding the Selling Price for a Target Margin

Cost = $80, Target Margin = 25% Revenue = 80 ÷ (1 − 0.25) = 80 ÷ 0.75 ≈ $106.67

To achieve a 25% margin on an $80-cost item, it needs to sell for about $106.67.

Example 3 — Margin to Markup Conversion

Margin = 20% Markup = 0.20 ÷ (1 − 0.20) = 0.25 = 25%

A 20% margin corresponds to a 25% markup on the same $80/$100 item — the two numbers describe the identical profit, just relative to different bases.

Example 4 — Markup to Margin Conversion

Markup = 11% Margin = 0.11 ÷ (1 + 0.11) ≈ 0.099 ≈ 9.9%

An 11% markup corresponds to just under a 10% margin.

Example 5 — Margin After a Discount

Original Margin = 30%, Discount = 10% New Margin = (0.30 − 0.10) ÷ (1 − 0.10) = 0.20 ÷ 0.90 ≈ 22.2%

A 10% discount on a 30%-margin item drops the true margin to about 22.2%, not simply 20%.

Example 6 — Margin With Sales Tax

Cost = $80, Margin = 20%, Tax Rate = 8% Net Price = 80 ÷ (1 − 0.20) = $100 Tax = 100 × 0.08 = $8 Gross Price = 100 + 8 = $108

The customer pays a $108 gross price, but the business's actual margin is still calculated on the $100 net price, not the tax-inclusive total.

Example 7 — Company Gross Margin

Revenue = $1,000,000, COGS = $620,000 Gross Profit = 1,000,000 − 620,000 = $380,000 Gross Margin = 380,000 ÷ 1,000,000 = 38%

A company with $1M in revenue and $620K in cost of goods sold reports a 38% gross margin.

Example 8 — Solving for Cost From Revenue and Margin

Revenue = $150, Margin = 40% Cost = 150 × (1 − 0.40) = 150 × 0.60 = $90

A $150 item sold at a 40% margin implies the underlying cost was $90.

Quick Reference Tables

Margin-to-markup conversions and typical margin ranges by industry.

Margin to Markup Conversion

MarginEquivalent Markup
10%11.1%
20%25.0%
30%42.9%
50%100.0%

Typical Margin Ranges by Business Type

Business TypeTypical Margin
Grocery / Commodity Retail1% – 5%
General E-Commerce / Retail10% – 30%
Restaurants3% – 9%
Software / SaaS60% – 85%
Luxury Goods60% – 80%

Discount Impact on a 30% Margin

Discount AppliedResulting Margin
0%30.0%
10%22.2%
20%12.5%
30%0.0%

Why Use This Margin Calculator

Built for anyone who needs an accurate pricing or profitability figure fast — not just a rough estimate.

Five Tools in One

Solve for margin, convert margin to markup, model discounts, add tax, and check company gross margin — all in one place.

Instant Calculations

Every mode recalculates live using the exact margin formula, not a rounded shortcut.

🔁

Solve for Any Value

Find cost, revenue, or margin from whichever two values you already know.

🏷️

Correctly Distinguishes Markup

Never confuses margin (based on revenue) with markup (based on cost) — a common and costly pricing mistake.

💵

Real Business Scenarios

Covers discounting, sales tax and VAT, and company-level gross margin, not just a single simplified formula.

📱

Works Everywhere

A fully responsive layout means the same accurate tool works on desktop, tablet, and mobile.

Practical Applications of Margin Calculations

Real business situations where this exact calculation runs every day.

%

Retail & E-Commerce Pricing

Setting product prices that hit a target profit margin on every item sold.

Manufacturing & Production Costing

Checking whether a product line stays profitable as material and labor costs change.

Financial Analysis & Investing

Comparing companies' gross and net margins to assess profitability and efficiency.

Sales Negotiations & Discounting

Knowing exactly how far a discount can go before a deal stops being profitable.

$

VAT & Sales Tax Pricing

Separating net selling price and margin from the tax added on top for the customer.

Freelance & Small Business Pricing

Making sure service or product pricing actually covers costs and leaves real profit.

Common Margin Calculation Mistakes

Avoid these classic errors when calculating margin and pricing.

Confusing margin with markup

Margin is profit as a percentage of revenue; markup is profit as a percentage of cost — using one where you meant the other changes your actual price.

Assuming a discount costs exactly its percentage in margin

Because margin is based on revenue, which shrinks with a discount, the true margin impact is larger than the discount percentage alone.

Including tax in margin calculations

Sales tax and VAT are collected on behalf of a tax authority and should be excluded from your margin calculation, which is based on your net selling price.

Confusing gross margin with net margin

Gross margin only subtracts direct cost of goods sold; net margin also subtracts operating expenses and taxes — they tell very different stories.

Forgetting to convert percentages to decimals

Margin and markup formulas require percentages in decimal form (20% = 0.20) — plugging in whole numbers directly produces a wrong result.

Comparing margin against the wrong benchmark

Typical "good" margins vary enormously by industry — comparing a grocery margin to a software margin isn't a meaningful comparison.

Ignoring all costs, not just COGS

A healthy gross margin can still hide an unprofitable business once operating expenses are factored in at the net margin level.

Rounding intermediate steps too early

Rounding a margin or cost figure before the final calculation can shift the resulting price or margin meaningfully.

Frequently Asked Questions

Straight answers to the most common questions about profit margin.

How do I calculate profit margin?

Subtract cost from revenue to find profit, then divide by revenue and multiply by 100: Margin = (Revenue − Cost) ÷ Revenue × 100.

What is the difference between margin and markup?

Margin is profit as a percentage of revenue (selling price); markup is profit as a percentage of cost — the same dollar profit gives two different percentages.

How do I convert margin to markup?

Markup = Margin ÷ (1 − Margin), using decimal form — or use the Margin ↔ Markup mode above for an instant conversion.

How do I find the selling price for a target margin?

Divide your cost by (1 − target margin, as a decimal) — the Solve Margin mode above does this automatically.

How does a discount affect profit margin?

New Margin = (Old Margin − Discount) ÷ (1 − Discount) — the margin drop is larger than the discount percentage alone, since revenue also shrinks.

What is gross margin?

Gross margin is revenue minus cost of goods sold (COGS), divided by revenue — a company-level profitability measure that excludes operating expenses.

What is a good profit margin?

It varies significantly by industry — general retail commonly runs 10–30%, while software and luxury goods can exceed 60%, and grocery margins are often in the low single digits.

Does margin include sales tax or VAT?

No — margin is calculated on the net selling price before tax; tax is added on top and passed through to the tax authority.

Can I calculate cost from revenue and margin?

Yes, use the Solve Margin mode above: Cost = Revenue × (1 − Margin).

Is this calculator accurate?

Yes, it applies the standard finance formulas for margin, markup, discount, and gross margin used across business and accounting.

Is it free?

Yes, the calculator and every calculation mode on this page are completely free to use, with no signup required.

Does it work on mobile?

Yes, the entire page — including the calculator and tables — is fully responsive and works on phones and tablets.

Can small businesses use it?

Yes, it's designed to help price individual products or services just as easily as it handles company-level gross margin.

What is the difference between gross margin and net margin?

Gross margin subtracts only direct cost of goods sold; net margin also subtracts operating expenses and taxes, giving a fuller profitability picture.

Can I copy my results?

Yes, use the Copy Results button to copy a plain-text summary, or Share to send your results directly.

Price With Confidence

Calculate profit margin, convert between margin and markup, model discounts and tax, and check gross margin using this professional Margin Calculator.