Money & shopping

Margin & markup calculator

Distinguish gross margin from markup on cost.

Margin & markup calculator
Esc to restore

Your inputs

Results update as you type. Larger files run when you press Update result.

Your result

Your result will appear here.

More actions

What if? Vary one input and watch the result

Pick an input and a result, choose a range, and Toolmoz runs this calculation at each step on your device. Every other input stays as you entered it.

Your inputs stay in this browser. Nothing is uploaded, and nothing is saved unless you choose “Save result”.

A clear answer. Here’s how.

Gross profit = price − cost. Gross margin = profit ÷ price × 100; markup = profit ÷ cost × 100. Markup is undefined for zero cost. Excludes tax, overhead and other charges unless you include them in your inputs.

How this is checked

3 reference checks passed These 3 cases were run when this page was built, on 3 December 2026, and all reproduce within the stated tolerance. The same cases are part of the automated tests that run on every change to Toolmoz. Engine version 1.

See the checks and where each expected answer comes from
  1. Case 1

    Inputs
    Cost per item 80Selling price per item 100
    Expected, and what Toolmoz gave
    Gross profit per item expected 20, Toolmoz 20Gross margin expected 20%, Toolmoz 20%Markup on cost expected 25%, Toolmoz 25%
    Where the expected answer comes from
    Profit = 100 − 80 = 20; margin = 20 ÷ 100 = 20%; markup = 20 ÷ 80 = 25%
    Allowed difference
    ±1e-12
  2. Case 2

    Inputs
    Cost per item 50Selling price per item 100
    Expected, and what Toolmoz gave
    Gross profit per item expected 50, Toolmoz 50Gross margin expected 50%, Toolmoz 50%Markup on cost expected 100%, Toolmoz 100%
    Where the expected answer comes from
    Profit = 50; margin = 50 ÷ 100 = 50%; markup = 50 ÷ 50 = 100%
    Allowed difference
    ±1e-12
  3. Case 3

    Inputs
    Cost per item 200Selling price per item 250
    Expected, and what Toolmoz gave
    Gross profit per item expected 50, Toolmoz 50Gross margin expected 20%, Toolmoz 20%Markup on cost expected 25%, Toolmoz 25%
    Where the expected answer comes from
    Profit = 50; margin = 50 ÷ 250 = 20%; markup = 50 ÷ 200 = 25%
    Allowed difference
    ±1e-12

What this shows: the engine reproduces independently worked values for these cases. It does not prove every possible input is right. To test an answer you were given, see how to check a number; to see what is and is not checked across Toolmoz, see the accuracy ledger.

See a worked example

Worked example

A fixed demonstration, separate from the values you enter above.

Cost per item
40
Selling price per item
60

Example result

Gross profit per item
20
Gross margin
33.3333333333%
Markup on cost
50%