Gross Margin Calculator

Work out gross profit, gross margin and markup from your price and cost — or go the other way and find the selling price you need to hit a target margin.

What are you working out?

Enter a price and a cost to see the margin.

Margin, markup and profit are three different numbers

They all describe the same $40. What differs is the base each one is measured against — and that is where most pricing mistakes begin.

MeasureFormulaWith cost $60, price $100
Gross profitPrice − Cost$40.00
Gross margin %Gross profit ÷ Price40.0%
Markup %Gross profit ÷ Cost66.7%

The same transaction is a 40% margin and a 66.7% markup. Neither figure is wrong; they simply answer different questions. Margin tells you what share of every dollar of revenue you keep. Markup tells you how much you added to the cost.

The relationship between them is fixed: margin = markup ÷ (1 + markup) and markup = margin ÷ (1 − margin). That means a 50% markup is only a 33.3% margin, and a 50% margin requires a 100% markup.

Markup to margin conversion

This is the table to keep next to you when a supplier talks in markup and your accounts talk in margin.

MarkupGross marginCost $60 sells for
15%13.0%$69.00
25%20.0%$75.00
33.3%25.0%$80.00
50%33.3%$90.00
66.7%40.0%$100.00
100%50.0%$120.00
150%60.0%$150.00
233%70.0%$200.00

Read it in one direction and the lesson is immediate: if you think in markup and your accountant thinks in margin, you are undercharging on every line. A stated target of "40% margin" requires a price of $100 on a $60 cost. Adding 40% to the cost gives $84 — a 28.6% margin, which is a third short of the target.

The rules behind the numbers

What belongs in cost of goods sold

Gross margin deducts only the direct cost of what was sold. Everything else waits below the line.

Business typeTypical COGS
Retail / resellerPurchase price of inventory, freight in
ManufacturerRaw materials, direct labour, production overhead
Service businessDirect labour delivered to the client, subcontractors
Software / digitalHosting attributable to delivery, third-party licence fees

Rent, admin salaries, marketing, insurance and interest are operating expenses. Deduct those from gross profit and you reach operating profit; deduct interest and tax as well and you reach net profit. A business can run a 45% gross margin and still lose money, which is why the two margins are never substitutes for each other.

Why a 100% margin is impossible

Gross margin divides by price, and any item with a positive cost must sell for more than that cost. As cost approaches zero the margin approaches 100% but never reaches it. A calculator returning exactly 100% means the cost was entered as zero — for a genuinely free product that is fine, but in a pricing exercise it usually signals missing data, most often a cost that has not been allocated yet.

Cost-plus pricing and its failure mode

Cost-plus pricing sets price by adding a standard markup to cost. It is simple and defensible, and it has one structural weakness: it ignores what the customer will pay. If your cost is $60 and the market will pay $140, cost-plus at 66.7% leaves $40 on the table every sale. Margin analysis tells you what you kept; it does not tell you what you could have.

Shipping, fees and returns

Outbound shipping you pay and payment processing fees are commonly folded into COGS for e-commerce, and left as operating expense by others. Either treatment is acceptable if applied consistently, because moving them in or out changes reported margin without changing a cent of cash. What is not acceptable is switching treatments between periods, which makes the trend line meaningless.

Three worked examples

1. A retailer checking a markdown

A shop buys for $42 and normally sells at $70, which is a gross profit of $28, a 40% gross margin and a 66.7% markup. A seasonal sale cuts the price to $56. Gross profit falls to $14 and the margin drops to 25% — a 15-point margin loss from a 20% price cut.

That asymmetry is the single most important fact in retail pricing. Cutting price by a fifth removes well over a third of the gross profit.

2. A service business pricing a retainer

A consultant's direct cost to deliver is $55 an hour, covering their own time and any subcontractor. They want a 60% gross margin. The formula is cost ÷ (1 − margin): 55 ÷ 0.4 = $137.50 an hour. Adding 60% to the cost would have produced $88, a margin of only 37.5%.

Over a 30-hour month the difference between $137.50 and $88 is $1,485 of lost gross profit, month after month.

3. A product line where units hide the problem

A brand sells three products. Product A: price $120, cost $48, 1,000 units. Product B: price $60, cost $39, 400 units. Product C: price $200, cost $170, 300 units.

The revenue ranking is A, B, C. The profit ranking is A, C, B. Product B is the weakest by margin even though it outsells C, and Product C ties up the most cash per unit for the least return. Margin per unit and margin percentage together tell you which line to push and which to reprice.

Five mistakes to avoid

  1. Adding the margin to the cost. To hit a 40% margin on a $60 cost you divide by 0.6, not multiply by 1.4. The wrong method gives $84 and a 28.6% margin.
  2. Calling markup margin in a conversation. A 50% markup is a 33.3% margin. Once the two words are used interchangeably, nobody in the room knows which number they agreed.
  3. Leaving overhead out of COGS and forgetting it exists. Excluding rent from gross margin is correct. Forgetting to deduct it anywhere means a healthy-looking 45% gross margin covers a loss-making business.
  4. Discounting without recalculating. A 20% price cut on a 40% margin removes 37.5% of gross profit. Discounts need volume, not optimism.
  5. Comparing margins across industries. A 20% margin is strong in grocery and weak in software. Benchmarks only mean something against close comparables, ideally your own history.

Sources and standards

How we verify this calculator

The formulas are the standard definitions used in management accounting: gross profit is revenue less cost of goods sold, gross margin is gross profit divided by revenue, and markup is gross profit divided by cost. No rounding is applied until display.

Formulas and conversion table last reviewed: 19 September 2026.

This tool provides calculations, not accounting, tax or financial advice. How COGS is defined for your business may differ from the industry norms shown here.

FAQ

What is the difference between gross margin and markup?

Both measure the same gross profit against different bases. Gross margin divides gross profit by the selling price; markup divides it by the cost. Buy for $60 and sell for $100 and you have a 40% gross margin and a 66.7% markup.

How do you calculate gross margin percentage?

Subtract cost of goods sold from revenue to get gross profit, then divide gross profit by revenue. Revenue of $100 with COGS of $60 gives $40 gross profit and a 40% gross margin.

What is a good gross margin?

It depends on the industry. Software commonly runs above 70%, professional services typically 40% to 60%, retail 20% to 50%, and grocery single digits. Comparing against an unrelated industry tells you nothing useful.

Why can gross margin never be 100%?

Because it is measured against the selling price, and anything with a positive cost must sell above that cost. A 100% result means cost was entered as zero, which is usually a data gap rather than a genuinely free product.

How do I work out the price for a target gross margin?

Divide the cost by one minus the target margin as a decimal. A $60 cost at a 40% target margin is 60 ÷ 0.6 = $100. Adding 40% to cost gives $84, which is only a 28.6% margin.

Does gross margin include overhead?

No. Gross margin deducts only cost of goods sold. Rent, salaries, marketing, insurance and interest are operating expenses below the gross profit line. Deduct those and you reach operating margin or net margin.

What counts as cost of goods sold?

For a retailer, the purchase price of inventory plus freight in. For a manufacturer, raw materials, direct labour and production overhead. For a service business, usually the direct labour delivered to the client.

What is the difference between gross margin and net margin?

Gross margin deducts only the direct cost of what was sold. Net margin deducts everything, including overhead, interest and tax. A business can run a healthy gross margin and still lose money.

Can gross margin be negative?

Yes. If cost of goods sold exceeds revenue you are selling below cost. That is expected for a deliberate loss leader and a serious problem anywhere else. The calculator flags a negative result.

Should shipping and payment fees be in COGS?

Either treatment is acceptable if applied consistently. Moving them in or out of COGS changes reported margin without changing cash. Switching between periods is what makes the trend meaningless.

Explore all free calculators

Fifteen free tools for invoices, deadlines, hours and pricing — pick one, no signup.

Have a suggestion?

Missing a feature or found something off? Tell us — user suggestions decide what we build next.