Profit Margin Calculator
Calculate gross profit per unit, gross margin and markup from cost and selling price.
Last updated · View algorithm, constants and default inputs (JSON)
About this calculator
Calculate gross profit per unit, gross margin and markup from cost and selling price. Choose per-unit values and a quantity, or total revenue and cost. Quantity does not affect the totals mode. Margin uses revenue as its denominator; markup uses cost.
Worked example
calculated with the default values below
Amount basis Per unit · Cost on the same basis 30 $ · Revenue / selling price 50 $ · Units sold 100 units Gross margin 40.00 % · Profit on entered basis 20.00 $ · Total profit 2,000.00 $ · Markup 66.67 %
General background references
Disclaimer
These calculators give estimates for general information only. They are not financial, tax or investment advice and do not take your personal circumstances into account. Before borrowing, investing or filing, confirm the numbers with a qualified adviser in your jurisdiction.
Implementation source
This record describes the implementation used by this page. It is not independent validation. External references, when available, support only the stated formula or definition; estimates and custom rules retain their own assumptions.
Formula and variables
M = (P − C) ÷ P × 100; Mk = (P − C) ÷ C × 100; T = (P − C) × q
- C
- Unit cost
- P
- Selling price
- q
- Quantity sold
- M
- Profit margin (%)
- Mk
- Markup (%)
- T
- Total profit
Gross profit per unit = selling price − unit cost; margin = profit / selling price × 100; markup = profit / cost × 100. Margin is undefined at zero selling price and markup at zero cost.
Frequently asked questions
Why is a percentage result blank when the denominator is zero?
A percentage based on zero is undefined, so the calculator leaves price-per-area or margin percentages blank instead of displaying 0%. Enter a positive area or selling price for that ratio.
Why is my profit margin lower than my markup percentage?
Margin divides profit by the selling price while markup divides it by cost, so they are never equal unless profit is zero. At the default $30 cost and $50 price the profit is $20, giving a 40% margin but a 66.7% markup. Managers watch margin because it reflects what each sales dollar keeps; markup only shows the cost loading.