Margin Calculator

Use this margin calculator to see how much of each sale you keep. Enter your unit cost, selling price and volume, plus any fees, discount and fixed costs. You get gross, contribution and profit margin, markup, break-even units and the price for your target margin.

Calculation and content reviewed by EZ Calculators Editorial Team on .

Enter values

Model one product or service pricing scenario from list price to profit. Keep discount, unit costs, percentage fees, fixed-cost allocation, volume, break-even, and target margin visible as separate assumptions.

Build the scenario below, then calculate for a complete result report.

Runs in your browser
01

SellList price, discount, and volume

02

CostVariable, percentage, and fixed costs

03

DecideProfit, break-even, and target price

Price and sales scenario

The list price is reduced by the entered customer discount. Whole units define both revenue and the fixed-cost allocation for this one scenario.
Enter the price before the customer discount below.
$
Reduces the list selling price before percentage-based selling fees.
%
Fixed costs are allocated across this volume for the scenario margin.
units

Complete cost structure

Direct and other variable costs apply per unit. Selling fees apply to the discounted customer price, while fixed costs are spread across the selected volume only for this scenario.
Use the direct unit cost that belongs to the modeled product or service.
Examples can include packaging, fulfillment, direct labor, or per-order shipping when they vary with each unit.
$
Applied to the selling price after the entered customer discount.
%
Use fixed overhead for the same period or campaign represented by the unit volume.
$

Target profit margin

The solver holds volume, cost, fee, and discount assumptions constant, then finds the list price required for the selected profit margin.
Solves the list price needed at the entered volume, fee rate, and discount.
%
Scenario economicsNot accounting, tax, or pricing advice
This model excludes returns, inventory changes, tax classification, financing, income tax, working capital, cash timing, demand response, and any cost not entered. Reconcile material pricing decisions with current records.

How do you calculate margin?

Subtract cost from the selling price, divide the result by the selling price, and multiply by 100. A product that costs $60 and sells for $100 makes $40 of gross profit, so its gross margin is 40%. To find the price for a target margin, divide cost by 1 minus the margin: $60 / 0.60 = $100.

How to use the margin calculator

For a quick gross margin, enter just the cost and selling price and set the other cost fields to zero. For a fuller picture, add the costs that come with each sale and the fixed costs for the same period. The more you include, the closer the profit margin gets to what you'd keep.

Change one thing at a time. If you raise the price and add a discount in the same run, you won't know which one moved the margin.

  1. Enter the cost per unit and the list selling price per unit.
  2. Enter how many units the scenario covers.
  3. Add other per-unit costs like packaging or shipping, and the fee percentage your platform or card processor charges.
  4. Add fixed costs for the same period, such as rent or software for that month.
  5. Enter any customer discount and the margin you're aiming for.
  6. Calculate and read the margins, break-even units and the price needed for your target.

Margin formula and target price formula

Margin always divides by the selling price (revenue). That's what separates it from markup, which divides by cost. The calculator shows three margins because each one includes more costs than the last.

Gross margin takes off only the product cost. Contribution margin also takes off other per-unit costs and selling fees. Profit margin then takes off fixed costs spread over your units. For the price you need, the calculator leaves room for the fee percentage and your target margin, then adjusts for any discount.

Formula guide
  • Gross margin = (selling price - product cost) / selling price x 100
  • Contribution per unit = net price - product cost - other variable cost - selling fee
  • Profit margin = (contribution per unit x units - fixed costs) / net revenue x 100
  • Price for a target margin (cost only) = cost / (1 - target margin)
  • Break-even units = fixed costs / contribution per unit, rounded up

Worked example: a $100 product across 100 units

A product lists at $100 and costs $60. Each sale also carries $5 of packaging and shipping and a 3% selling fee, which is $3. That leaves $32 of contribution per unit, or $3,200 across 100 units. Take off $500 of fixed costs and profit is $2,700, a 27% profit margin on $10,000 of revenue.

The gross margin on the same product is 40%, so the extra costs eat 13 points. To reach a 30% profit margin at this volume, the price has to rise to about $104.48. With 10% off for customers, the list price would need to be about $116.09 to land on that same net price.

Margins for a $100 product with $60 cost, 100 units
MeasureCalculationResult
Gross margin($100 - $60) / $10040%
Contribution per unit$100 - $60 - $5 - $3$32
Contribution margin$32 / $10032%
Profit after $500 fixed costs$32 x 100 - $500$2,700
Profit margin$2,700 / $10,00027%
Break-even units$500 / $32 = 15.62516 units
Price for a 30% margin$70 / (1 - 0.03 - 0.30)$104.48

Gross margin vs profit margin

Gross margin is what a product earns over its own cost. It's the number retailers use to compare items on a shelf. Profit margin, as this page uses it, also covers fees, per-unit extras and fixed costs, so it's always lower when those costs exist.

A healthy gross margin can still hide a loss. If fixed costs are large and volume is low, the profit margin can go negative even while each unit sells above cost. That's why the calculator shows break-even units next to the margins.

Margin and markup at a glance

The same $40 profit on a $60 cost and $100 price is a 40% margin but a 66.67% markup. Mix them up and you'll underprice. If you want a 40% margin and add 40% to cost instead, a $60 item sells for $84, which is only a 28.57% margin.

This table shows the markup that matches common margins, and the selling price for a $45 cost.

Margin to markup, and price for a $45 cost
Target marginSame profit as markupPrice for a $45 cost
10%11.11%$50.00
20%25%$56.25
25%33.33%$60.00
30%42.86%$64.29
40%66.67%$75.00
50%100%$90.00

How discounts squeeze your margin

Take 10% off the $100 product above and the net price drops to $90. The fee falls a little to $2.70, but the $60 cost, the $5 extras and the $500 fixed costs don't move. Profit per unit falls from $27 to $17.30 and the profit margin drops from 27% to about 19.22%.

So a 10% discount cut profit per unit by more than a third. The discount table in the results runs the same check at several discount levels so you can see where the margin runs out.

When to double-check the result

This is a single-product planning model. It doesn't know about returns, refunds, tiered platform fees, income tax, financing or cash timing. Use tax-exclusive prices if you charge VAT or sales tax, since tax collected for the government isn't your revenue.

For accounts or a tax return, your figures should match your books. IRS Publication 334 explains how gross profit and cost of goods sold work for small businesses in the US.

Sources

FAQ

What is a good profit margin?

It depends on the industry. Grocery and other high-volume retail runs on thin margins, while software and services often run much higher. Compare your margin with businesses like yours and with your own past results.

How do I find the selling price from cost and margin?

Divide the cost by 1 minus the margin as a decimal. For a $45 cost and a 25% margin, $45 / 0.75 = $60. Check it: $15 profit divided by $60 is 25%.

Why is my margin lower than my markup?

Both use the same profit, but margin divides it by the price and markup divides it by the cost. Price is always bigger than cost when you make a profit, so margin is always the smaller percentage.

Can a margin be over 100%?

Not a profit margin. Profit can't exceed the selling price, so the margin tops out just below 100%. Markup can go well over 100%, for example 150% markup is a 60% margin.

Should I include shipping and payment fees in my margin?

Yes, if you pay them on each sale. Put percentage fees in the selling fee field and flat per-order costs in the other variable cost field. Leaving them out makes the margin look better than it is.

What is contribution margin?

It's what each sale leaves after the costs that rise with every unit, like product cost, packaging and fees. That money pays your fixed costs first, and anything left after them is profit.

Can profit margin be negative?

Yes. A negative margin means the costs you entered are bigger than revenue. Check your inputs first, then look at price, discounts, fees and fixed costs to find where the loss comes from.