Inputs
Profit$40.00
Ready
Forty of profit on a cost of 80 and a price of 120 is two different percents, and both are correct. Profit is price minus cost, here 40. Margin is profit divided by the selling price: 40/120 is 33.33%. Markup is profit divided by the cost: 40/80 is 50%. Quoting "50%" without saying which base you divided by is how invoices and dashboards disagree.
This page starts from the two money figures and reports all three results. The markup calculator goes the other direction: cost and a markup percent in, selling price out. Use that one when you are setting a tag. Use this one when the tag already exists and you want the ratios. A zero price makes margin undefined, because you would be dividing by zero. A zero cost makes markup undefined for the same reason.
Gross profit here is a single unit or a single total, whichever pair you typed. It does not allocate overhead. If the 80 already includes a share of rent, the margin is a fuller margin. If the 80 is only materials, the margin is a contribution margin wearing a short name. The math does not know which story you brought.
Cost 80. Selling price 120.
Profit 40. Margin 33.33%. Markup 50%.
Oddsock runs this in your browser. It is free, it does not upload the work, and it does not ask for an account.
Subtract cost from price, then divide by the price. (120 − 80) / 120 is 33.33%.
Divide the same profit by the cost. 40 / 80 is 50%. Margin and markup share a numerator and not a denominator.
40 is a third of the 120 price and a half of the 80 cost. Same profit, two bases.
Profit is negative, and both percents are negative. You are describing a loss, and the formulas still divide.
Margin would divide by zero, so the page reports it as undefined. Markup can still be computed if the cost is not zero.