How to use this margin calculator
One tool handles three common margin questions for products, services, and overall business performance. Use the tabs above the form to jump between modes without leaving the page.
Gross margin mode
- Pick your currency symbol for display.
- For Value 1 and Value 2, enter an amount and say what it represents: costs, revenue, margin percentage, or markup percentage.
- Click Calculate. The tool fills in the missing figures and shows gross margin percentage, markup percentage, gross profit, and a gauge meter.
For example, costs of $100 and revenue of $110 works out to 9.09% gross margin, 10% markup, and $10 gross profit. Out of every dollar of revenue, roughly $0.09 stays with you as gross profit.
Sales margin mode
- Enter the cost of production, meaning whatever it costs you to make or buy the item.
- Enter the selling price, what the customer actually pays.
- Click Calculate and you get sales margin percentage, markup percentage, cost percentage, and per-unit profit.
Costs of $100 and a selling price of $120 give you 16.67% sales margin, 20% markup, and a cost that eats up 83.33% of the price. Every unit sold keeps $20 in gross profit.
Net profit margin mode
- Set Value 1 to either total costs or net profit, whichever you have on hand.
- Enter total revenue for the period.
- Click Calculate for net profit margin percentage, net profit dollars, markup on costs, and a revenue-per-dollar breakdown.
Total costs of $100 against revenue of $130 lands at 23.08% net profit margin and $30 net profit. For every dollar of revenue collected, the business is keeping about $0.23 as net profit.
What is margin?
Margin is profit expressed as a percentage of revenue, or how much of each sales dollar you actually keep after costs. It is one of the more useful metrics for pricing, benchmarking, and gauging financial health precisely because it scales across deal sizes.
Gross margin vs net profit margin
Gross margin takes revenue minus direct costs, meaning cost of goods sold, and shows product-level profitability before overhead, taxes, and financing enter the picture. Net profit margin factors in all costs and net profit after operating expenses, giving you the fuller bottom-line view.
Sales margin (unit pricing)
Sales margin applies that same logic to a single item: production cost against selling price. It works well for retail, wholesale, and menu pricing, anywhere you know the per-unit economics.
Margin vs markup
Gross or net profit margin as a share of revenue
Profit relative to cost base
Margin divides profit by revenue. Markup divides profit by costs. A 25% markup is not the same thing as a 25% margin, and when both numbers are positive, markup always comes out higher. This calculator shows both so you can line up with supplier quotes, which usually speak in markup, and financial statements, which speak in margin.
Operating margin
Operating margin sits between gross and net: revenue minus operating expenses, before interest and taxes, divided by revenue. This tool sticks to gross, unit sales, and net profit margins, so pull your operating income line from the P&L if you need operating margin benchmarks.
Examples and use cases
Worked example
Take gross margin mode with costs of $100 and revenue of $110:
- Gross profit = $10
- Gross margin = 10 ÷ 110 × 100 = 9.09%
- Markup on cost = 10 ÷ 100 × 100 = 10%
Real-world use cases
- Menu pricing: A café owner enters food cost and a target selling price per dish to confirm each item clears a 65% gross margin before overhead.
- Wholesale quote review: A retailer checks whether a supplier’s 40% markup actually translates to an acceptable 28.6% margin at the planned shelf price.
- Quarterly P&L review: A founder enters total revenue and net profit from the financial statements to benchmark net margin against industry peers.
Related calculators
- ROI Calculator, for return on invested capital over time
- Sales Tax Calculator, for adding or removing tax from selling prices