Small business

Gross margin calculator

Compare margin with markup, or find the selling price needed for a target percentage. Prices round up to 0.01 to preserve your target.

Your measurements

Change any value to calculate

Your cost of goods sold per unit for the gross calculation. Costs, selling fees or overhead omitted here are not deducted elsewhere; this result is not net profit.

$
$

Gross profit as a percentage of the selling price. A 40% margin leaves 60% of the selling price to cover the entered cost.

%

Gross profit as a percentage of cost. A 40% markup multiplies cost by 1.4 and is different from a 40% margin.

%
Gross margin
40 % margin
Gross profit per unit
40 $
Markup on cost
66.67 %

Displayed values are rounded. Whole packages and purchase lengths round up. See assumptions below.

Calculation details

Inputs and full-precision results for checking this calculation. No report is sent.

How to use this calculator

Enter the cost and selling price for the same unit in the same currency to compare current margin and markup. Or choose a target mode, enter cost and the percentage you want, and calculate the selling price. Margin divides profit by selling price; markup divides profit by cost. Target prices round up in increments of 0.01 so rounding does not bring the price below the calculated target. Include the costs you intend to treat as cost of goods sold. If you start with a materials-only estimate, add any other costs you want included before entering it here.

The formula

Gross profit = selling price − cost. Gross margin% = gross profit ÷ selling price × 100. Markup% = gross profit ÷ cost × 100. To meet a target margin, formula price = cost ÷ (1 − target margin ÷ 100). To meet a target markup, formula price = cost × (1 + target markup ÷ 100). Target-mode selling price = formula price × 100, rounded up to a whole number, then divided by 100. Achieved margin, markup and gross profit use that rounded-up price. Full formula precision remains in Calculation details.

A worked example

A product costing $60 and selling for $100 earns $40 gross profit. Its margin is 40% of sales; its markup is 66.67% of cost. Starting from cost $60, a target margin of 40% requires $100, while a target markup of 40% requires $84. At cost $20 and target margin 30%, the formula gives $20 ÷ 0.70 = $28.571428… . The price rounds up to $28.58; $28.57 would fall just below the target margin.

Assumptions & limitations

Calculates per-unit gross figures, not net profit or a recommended market price. It excludes overhead, financing, selling fees and taxes unless already included in your entered cost; percentage selling fees are not modeled separately. Use one currency throughout: the $ symbol is a display label, not currency conversion. Target-price rounding assumes that currency uses 0.01 pricing increments; it does not model cash-rounding rules or other minimum increments. Both cost and current selling price must be positive for the displayed ratios. Target margin must be from 0% to 99.99%; target markup may be zero or positive. The formula-price detail is displayed to six decimal places; the calculation record retains its full stored precision.

Common questions

Why is markup higher than margin?

For a profitable sale, the same profit is divided by a smaller cost base when calculating markup. A 40% markup on $60 produces $84, with about 28.57% gross margin. A 40% gross margin instead needs $100.

Why does the target price round up?

A formula price can fall between 0.01 increments. Rounding down would miss the requested percentage, so target mode rounds up and recalculates the achieved margin and markup at that price.

Can the result be negative?

Yes. In current-price mode, a selling price below cost gives negative gross profit, margin and markup. Target modes accept zero or positive targets only.

Does this include platform fees or give me net profit?

No. Include the cost amounts relevant to your calculation yourself. Unentered business costs, tax and percentage selling fees are not added. The result is not a guarantee that customers will pay the calculated price.

Supporting reference

The method above states this calculator’s assumptions. This reference provides related definitions and technical context.

Business Queensland: break-even and gross profit ↗

Formula and worked example checked against automated test cases. About our methodology.

Answers in seconds

No signup. No spreadsheet. Just your answer.

The math, explained

Clear formulas and useful worked examples.

Your numbers stay yours

Calculations happen right in your browser.