How to Use This Margin Calculator
This calculator works from the margin side of pricing: it answers “what margin am I making?”, “what price hits my target margin?”, and “what can I afford to pay for goods?” — three modes, one tool, with markup shown alongside every answer.
Mode 1 — Cost + Price → Margin: Enter what you pay and what you charge to see your margin, markup, and profit per unit. Use it to audit your existing prices.
Mode 2 — Cost + Target Margin → Price:Enter your cost and the margin you want, and get the selling price that delivers it. This is the accountant’s way to price — most people who ask for “30% margin pricing” actually need this mode, not a 30% markup.
Mode 3 — Price + Target Margin → Cost: Enter a market price and your minimum margin to find the most you can pay for the product and still profit. Use it before negotiating with suppliers or committing to a resale purchase.
The Profit Margin Formula
Profit margin is profit divided by revenue, expressed as a percentage: Margin = (Selling Price − Cost) / Selling Price × 100. If you buy at $40 and sell at $60, the $20 profit is a 33.33% margin — one third of every sales dollar is profit.
Profit Margin = ((Selling Price − Cost) / Selling Price) × 100 Selling Price (for a target margin) = Cost / (1 − Margin% / 100)Working backward from a target margin is where most pricing mistakes happen: to make a 30% margin on a $40 cost you must charge $57.14 — not $52, which is what a 30% markup gives. Mode 2 above does this math for you and shows every step.
Gross vs Net Profit Margin
Gross marginonly subtracts the cost of goods sold (COGS): (Revenue − COGS) / Revenue. It answers “does this product cover its own production cost?” Net marginsubtracts everything — COGS, rent, payroll, marketing, interest, and taxes. It answers “does the whole business make money?”
This calculator computes gross margin on a per-product basis, which is the right lens for pricing decisions. When you hear “our margin is 35%”, always ask which one is meant — a 35% gross margin can coexist with a 3% net margin once overhead is counted, which is exactly the situation in grocery retail.
Margin vs Markup
The two metrics use the same two numbers (cost and price) but different denominators: margin divides profit by price, markup divides profit by cost. So a 50% margin is a 100% markup, and a 30% margin is a 42.86% markup — the same sale, described two ways.
The full explainer — conversion formulas, a printable conversion table, and industry markup benchmarks — lives on our markup calculator page. If you set prices from cost, that tool is the natural starting point; this page is for when you already think in margins.
How to Improve Your Margin
Margin has three levers, and only one of them is price:
- Raise price — every dollar goes straight to margin, but volume may fall. Test with Mode 2 to see what a 2-point margin increase does to price.
- Cut product cost — renegotiate suppliers, change packaging, or buy in volume. Mode 3 shows the cost ceiling for any target margin.
- Reduce leakage — discounts, returns, spoilage, and payment fees quietly eat margin. A 5% coupon on a 30%-margin product cuts the margin to 26.3%.
Before optimizing, measure: run your real numbers through Mode 1 and write down the margin for every product you sell. Most small businesses find that a handful of items carry the margin and several quietly destroy it.
Frequently Asked Questions
What is a good profit margin?
A common rule of thumb for net margin: 5% is low, 10% is average, and 20% or more is excellent. But industry norms vary enormously — grocery stores net 1–3% on huge volume, restaurants often net 3–9%, while software and services can keep 20% or more. Compare your margin against your own industry's benchmark and your own history rather than a universal number.
What is the difference between gross margin and net margin?
Gross margin only subtracts the cost of goods sold (COGS) from revenue — (Revenue − COGS) / Revenue. Net margin subtracts everything: COGS plus rent, payroll, marketing, taxes, and interest. Gross margin tells you whether your pricing covers production costs; net margin tells you whether the whole business makes money after all bills are paid.
Can profit margin be over 100%?
No. Margin is profit divided by revenue, and profit can never exceed revenue, so margin tops out at 100% (a product that costs nothing). Markup, by contrast, can be any number — a $1 item sold for $10 has a 900% markup but only a 90% margin. That asymmetry is exactly why the two metrics are so easy to mix up.
How do I calculate profit margin in Excel or Google Sheets?
Put cost in A1 and selling price in B1, then enter =(B1-A1)/B1 and format the cell as a percentage. For markup instead, use =(B1-A1)/A1. The most common spreadsheet mistake is dividing by the wrong cell — margin divides by price, markup divides by cost. The calculator above shows both so you can sanity-check your sheet.