Margin Calculator: Complete Guide

Learn the difference between gross margin and markup, how to price for a target margin, and what good margins look like by industry.

5 min read Updated 2026-06-15

Quick Answer

Gross margin is the profit percentage of a selling price after subtracting the direct cost. This gross margin tool returns the margin percentage, gross profit in dollars, and markup percentage from any cost and selling price. If something costs $40 and sells for $100: gross margin = 60%, gross profit = $60, markup = 150%.

Use it for retail pricing decisions, product profitability analysis, or any calculation that needs both profit percentage and markup in one place.

Try the Margin Calculator →

What Is Gross Margin?

Gross margin measures how much of each dollar of revenue is profit after paying for the item or service itself. The formula is: ((Selling Price − Cost) ÷ Selling Price) × 100. This gross margin calculator also computes the gross profit in dollars and the markup percentage from the same two inputs.

An item that costs $60 to produce and sells for $150 has a gross margin of (($150 − $60) ÷ $150) × 100 = 60%. That means 60 cents of every dollar of revenue is gross profit. The markup on that same product is ($90 ÷ $60) × 100 = 150%: this is why margin vs markup are two different numbers for the same transaction.

Gross margin matters because it determines whether a price actually makes money. A business that sells below its cost has a negative gross margin and cannot survive without other income. Knowing your margin before setting prices prevents underpricing.

Gross margin does not account for operating costs, salaries, rent, or taxes. Those come out later to produce net margin. Gross margin tells you whether your pricing covers your production costs and leaves room for overhead.

How Is Margin Different from Markup?

The margin vs markup distinction is one of the most confused concepts in pricing. Both describe the relationship between cost and price, but they use different bases. Margin divides the profit by the selling price. A markup calculator divides the profit by the cost.

With a cost of $40 and a selling price of $100: profit is $60. Margin: $60 ÷ $100 = 60%. Markup: $60 ÷ $40 = 150%.

This means margin and markup percentages are never equal (except when both are zero). A 50% markup does not produce a 50% margin. Retailers use margin; manufacturers and distributors use markup. Knowing which base a percentage refers to prevents costly pricing errors.

How Do You Set a Price for a Target Margin?

Divide the cost by (1 − target margin). If something costs $75 and you want a 40% gross margin: selling price = $75 ÷ (1 − 0.40) = $75 ÷ 0.60 = $125.

At $125, the gross profit is $50, which is exactly 40% of the $125 sale price. This formula works for any target margin. Add overhead and a buffer before publishing a final price.

Retailers also use markdown pricing: temporarily reducing prices below the target margin to clear inventory. A product at a 45% margin marked down 20% sells at a 32% margin. Knowing the baseline margin helps you calculate how deep a markdown the business can absorb without selling at a loss.

Margin Calculation Examples

Three common pricing scenarios, such as retail, food service, and target-margin pricing:

  • Coffee shop pastry. Cost: $1.20, selling price: $3.50. Gross profit: $2.30. Gross margin: ($2.30 ÷ $3.50) × 100 = 65.7%. Markup: ($2.30 ÷ $1.20) × 100 = 191.7%.
  • Retail clothing. Cost: $28, selling price: $70. Gross margin: (($70 − $28) ÷ $70) × 100 = 60%. Markup: ($42 ÷ $28) × 100 = 150%. A common retail target is 50-60% gross margin.
  • Target margin pricing. Cost: $45, target margin: 35%. Required price: $45 ÷ (1 − 0.35) = $45 ÷ 0.65 = $69.23. Round up to $69.99 for retail presentation.

Why Does Gross Margin Matter?

Gross margin is the first profitability filter. Before a business can pay salaries, rent, marketing, or taxes, it needs to cover the direct cost of its products. A negative or zero gross margin means every sale loses money on the product itself, making the business model unworkable without other income.

Gross margin also determines pricing headroom. A product with a 70% gross margin can absorb a 20% markdown sale and still operate at 50% margin. A product at 25% gross margin cannot take a 20% markdown without selling below cost. Knowing your margin before discounting is how you avoid a markdown pricing error.

Investors and lenders use gross margin to compare businesses in the same industry. A software company with 80% gross margin and a grocery chain with 25% are both healthy for their sectors. The absolute number matters less than whether it is sustainable for your cost structure and competitive position.

When Would You Use a Profit Margin Calculator?

  • Product pricing. Enter the cost of each item and work backwards from your required margin to find the minimum viable price. Adjust for shipping, returns, and platform fees.
  • Comparing product lines. Calculate gross margin for each product to see which lines are profitable and which need repricing or discontinuation.
  • Evaluating offers from buyers. If a buyer quotes a price, enter it against your cost to see whether the margin is acceptable before accepting.
  • Financial reporting. Gross margin is a standard metric in income statements and investor reports. Calculate it accurately before presenting to stakeholders.

Common Mistakes

You May Also Need

You may also need

Next steps

Alternatives

Continue Learning