Margin Calculator

Quick answer

Gross margin is the share of a selling price that is profit after the product cost. Divide profit by the selling price, then multiply by 100. A $40 item sold for $50 has a $10 profit, which is a 20 percent gross margin. Add a target margin to see whether your pricing is on track.

Updated 2026-09-04Reviewed by Prof. Dr. Khalil Mudassar, PhD
Try
Gross Margin
$
What the item costs you to make or buy.
$
What you sell the item for.
Your goal or typical industry margin.

Gross margin

--
Profit--
Markup--
Vs target--

Calculations run in your browser. Inputs are not sent to our servers; anything you Save stays in this browser only.

Saved results (0)

How to Use the Margin Calculator

  1. Enter the cost per unit, what the item costs you to make or buy.
  2. Enter the selling price, what the customer pays.
  3. Optionally add a target margin to benchmark your result, then read the gross margin, profit, markup and how you compare to target.

Here is what each result means:

ResultWhat it means
Gross marginThe percentage of the selling price that is profit after cost.
ProfitThe cash you keep per unit, in dollars.
MarkupThe same profit measured against cost instead of price.
Vs targetHow far your margin is above or below the target you entered.

What Is Gross Margin?

Gross margin is the percentage of a sale you keep as profit after paying for the product itself. It is one of the clearest signals of whether a price is healthy, because it measures profit against the price the customer actually pays.

It helps anyone who sets prices: retailers, wholesalers, freelancers and makers. Unlike markup, gross margin can never exceed 100 percent, which makes it a reliable way to compare products, price tiers and whole businesses on one scale. It does not include overheads or tax, so it is a pricing signal, not net profit.

How to Calculate Gross Margin

Formula: Margin % = (Price - Cost) / Price x 100

Subtract the cost from the selling price to get the profit, divide that by the selling price, then multiply by 100.

  1. Profit = Price - Cost.
  2. Divide profit by the selling price.
  3. Multiply by 100 for the margin percentage.

Margin Calculator Example

Suppose an item costs you $40 and you sell it for $50, with a target margin of 25%.

Calculation: profit = 50 - 40 = $10. Margin = 10 / 50 x 100 = 20%. Markup = 10 / 40 x 100 = 25%. Against a 25% target, you are 5 points short.

This tells you the price is a little low for your goal: to hit a 25% margin on a $40 cost you would price at about $53.33.

Factors That Change Your Margin

Cost Changes

When supplier or material costs rise, margin falls unless you raise the price. Re-run the numbers whenever costs move.

Discounts and Price Cuts

A discount comes straight off margin, not markup. A 10 percent price cut can wipe out a large share of a thin margin, which the discount calculator makes visible.

Hidden Costs

Shipping, fees and returns reduce your true margin below the gross figure. Fold them into cost for a realistic number, and check the wider picture with a cash flow calculator.

Margin vs Markup

Margin and markup describe the same profit from two directions, and mixing them up is the most common pricing error.

MeasureWhat it comparesBest for
Gross marginProfit as a share of the selling priceJudging pricing health; caps at 100%
MarkupProfit as a share of the costPricing up from cost; can exceed 100%

A 25 percent markup equals a 20 percent margin. If you price up from cost, the markup calculator starts from a markup percentage and returns the price.

When to Use a Margin Calculation

Pricing a New Product

Set the price so the margin covers overheads and leaves a net profit, not just beats cost.

Checking a Deal or Quote

Before you agree a bulk price, confirm the margin still clears your target after the discount.

Comparing Product Lines

Margin puts products of different prices on the same scale, so you can see which lines actually make money. Pair it with the hourly cost calculator when your own time is part of the cost.

Common Mistakes

1. Confusing Margin with Markup

A 50 percent markup is only a 33 percent margin. Quoting the wrong one overstates profit.

2. Forgetting Overheads and Tax

Gross margin ignores rent, wages and tax, so a healthy gross margin can still mean a net loss.

3. Discounting Without Checking Margin

A price cut reduces margin faster than it reduces markup. Always re-check after a discount.

4. Leaving Out Shipping and Fees

Payment fees, shipping and returns quietly erode margin. Include them in cost.

5. Setting One Target for Every Product

Different lines carry different costs and competition, so a single target margin rarely fits all of them.

Accuracy and Limitations

The calculator is exact for the arithmetic; its usefulness depends on the costs and price you feed it.

What It Calculates Accurately

  • Gross margin, profit and markup for the values entered
  • Variance against a target margin you set
  • Consistent comparisons across products

What It Does Not Account For

  • Overheads, wages and tax (this is gross, not net)
  • Shipping, payment fees and returns unless you add them to cost
  • Volume, seasonality and competitor pricing

How We Calculate Gross Margin

Method
Profit divided by selling price, times 100; markup is profit divided by cost.
Inputs used
Cost per unit, selling price, optional target margin.
Assumptions
Cost is the direct product cost; the price is the actual amount charged.
Rounding
Percentages to two decimals; money to two decimals.
Edge cases
A price of zero is blocked; a zero cost shows markup as 0 to avoid dividing by zero.
Sources
Corporate Finance Institute and SBA references (listed under Sources below).
Last reviewed
2026-09-04.

Frequently Asked Questions

What is a good gross margin?

It varies by industry. Grocery and hardware often run under 25 percent, while software and jewellery can exceed 70 percent. Compare against typical figures for your own sector rather than a single benchmark.

What is the difference between margin and markup?

Margin is profit as a percentage of the selling price, so it caps at 100 percent. Markup is profit as a percentage of the cost, so it can be well above 100 percent. A 50 percent margin equals a 100 percent markup.

How do I convert margin to markup?

Divide the margin by one minus the margin. A 20 percent margin is a 25 percent markup; a 50 percent margin is a 100 percent markup. The calculator shows both figures at once.

Does gross margin include tax or overheads?

No. Gross margin only accounts for the direct cost of the product. It does not subtract overheads, wages, shipping or tax, so your net margin will be lower.

What target margin should I use?

Use a figure that covers your overheads and leaves a net profit, based on your industry. Many retailers aim for 30 to 50 percent gross margin, but low-overhead or premium businesses differ widely.

Can gross margin be negative?

Yes. If the selling price is below cost, the margin is negative, meaning you lose money on each sale. The calculator shows this with a minus sign.

Why is my result different from another margin calculator?

Most differences come from confusing margin with markup, or from including or excluding costs such as shipping and fees. Check that both tools use profit over price for margin.

Is gross margin the same as profit margin?

Gross margin is one type of profit margin that uses only product cost. Net profit margin also subtracts overheads and tax, so it is lower. See the profit calculator for the fuller picture.

Is my data saved?

No. The calculation runs entirely in your browser and nothing you enter is stored or sent anywhere.

Sources

Related Guides

Related Calculators

Looking for more money and business tools?

Explore all finance calculators

This calculator is for general information and planning only and is not financial, tax, accounting or legal advice. Results are estimates based on the figures you enter. Confirm important decisions with a qualified professional. Spotted an error? Let us know.

Author

shakeel-Muzaffar
Founder & Editor-in-Chief at  ~ Web ~ More Posts

Shakeel Muzaffar is the Founder and Editor-in-Chief of MultiCalculators.com, bringing over 15 years of experience in digital publishing, product strategy, and online tool development. He leads the platform's editorial vision, ensuring every calculator meets strict standards for accuracy, usability, and real-world value. Shakeel personally oversees content quality, formula verification workflows, and the platform's commitment to publishing tools that are genuinely useful for students, professionals, and everyday users worldwide.