Article — Margin Calculator
Margin calculator: profit margin, markup, and pricing
Profit margin is profit divided by revenue, expressed as a percent. If you sell a product for $100 that cost you $70 to make, your margin is $30 ÷ $100 = 30%. That ratio is the single most useful number in pricing, and it gets confused with markup more often than any other figure in small business.
The calculator above accepts any two of cost, revenue, or target margin and computes the rest. The article below explains what the numbers mean and where they get used in practice.
What is profit margin?
Profit margin is the share of each dollar of revenue that ends up as profit. A 30% margin means $0.30 of every $1.00 in sales is profit, and $0.70 covers cost. The figure is always between zero and 100% (or negative, if you are selling at a loss).
Margin is the standard pricing metric in retail, restaurants, SaaS, and almost every consumer category. Wall Street uses it to compare companies. Operators use it to decide whether to take on a new product line. Investors use it to spot businesses with pricing power.
NVIDIA posted a net profit margin of roughly 54% in 2024 — meaning more than half of every dollar of revenue ended up as net income after every cost was paid. That is one of the highest margins ever recorded by a large-cap company, and the result of near-monopoly pricing power in AI chips. For comparison, Walmart runs at about 2.4%.
Margin vs. markup: why they are different
Margin and markup describe the same profit but divide by different denominators. Margin uses revenue. Markup uses cost. The two numbers are never equal except at zero.
Margin % = Profit ÷ Revenue × 100Markup % = Profit ÷ Cost × 100The classic example: a product costs $60 and sells for $100. Profit is $40. Margin is $40 ÷ $100 = 40%. Markup is $40 ÷ $60 = 66.7%. Same dollar of profit, two very different percentages.
Retailers usually price by markup (because cost is what they pay the supplier), and report margin (because that is what investors and accountants track). Confusion happens when someone says "I want 50% profit" and applies a 50% markup, expecting a 50% margin. That actually gives a 33.3% margin — about a third less than what they thought they were getting.
If you want a 50% margin and you add 50% to cost, you have undershot by a third. For a true 50% margin you need a 100% markup — double the cost. The shop owner who applies "50% markup" while talking about "50% margin" leaves real money on the table every transaction. At 500 sales a month, the gap is easily four figures.
How to calculate profit margin
Margin needs two numbers: cost and revenue. Subtract cost from revenue to get profit. Divide profit by revenue. Multiply by 100. That is the margin percent.
Worked example. A coffee shop buys beans, milk, and a paper cup for a total cost of $1.20 per latte. The latte sells for $5.00. Profit is $3.80. Margin is $3.80 ÷ $5.00 = 76%. That is the gross margin on the drink itself, before rent, labor, and equipment depreciation.
The same calculation works at company scale. Total revenue minus total cost of goods sold, divided by total revenue, multiplied by 100. Public companies report this number on every quarterly earnings statement.
How to set a selling price from a target margin
This is the reverse calculation, and it is where most small-business pricing errors happen. To find the selling price needed to hit a target margin:
Price = Cost ÷ (1 − Margin ÷ 100)
If a wholesale cost is $14 and you want a 40% margin, divide by (1 − 0.40) = 0.60: $14 ÷ 0.60 = $23.33. Check: ($23.33 − $14) ÷ $23.33 = 40%. The trap is that adding 40% to $14 only gets you to $19.60, which produces a 28.6% margin — not 40%.
Use the calculator above for a one-step answer. Enter cost and target margin, and it returns the exact selling price plus the markup percent that gets you there. The "any two of three" interface saves you from the divide-by-(1−margin) gymnastics.
Average margins by industry
"Is 5% a good margin?" is unanswerable without context. The same 5% net margin is excellent for a grocery store, fine for a restaurant, and worrying for a SaaS company. Rough benchmarks from NYU Stern's Damodaran dataset of US-listed companies:
- Software / SaaS: 70–90% gross, 15–25% net
- Pharmaceuticals: 65–80% gross, 15–25% net
- Banks and financials: 15–25% net
- Apparel and general retail: 40–55% gross, 5–10% net
- Restaurants (full service): 60–70% gross, 3–5% net
- Auto manufacturing: 15–20% gross, 3–7% net
- Grocery stores: 25–30% gross, 2–3% net
- Construction: 15–25% gross, 3–6% net
Two patterns repeat in this table. First, gross margins are highest in industries with low marginal cost (software and pharma). Second, net margins compress toward 3–10% in industries with heavy labor, real estate, or capital costs. The difference between gross and net is overhead, and overhead is harder to compress than cost of goods.
Walmart's net margin is roughly 2.4%. On $650 billion of annual revenue, that produces around $15 billion in net income. The model is volume, not markup. A grocery business hitting Walmart's gross margin (around 25%) and Walmart's net margin (2.4%) is a sign of operational excellence, not weakness.
Gross vs. net margin
Gross margin counts only the direct cost of goods. For a t-shirt company, that is the fabric, the printing, the shipping inbound from the supplier, and nothing else. Gross margin tells you whether the product itself is profitable.
Net margin counts everything: payroll, rent, marketing, software, depreciation, interest on debt, and taxes. Net margin tells you whether the business is profitable. Restaurants are the textbook case: 65% gross margin (food itself is profitable) collapses to 4% net margin (after labor and rent eat almost everything).
Operating margin sits between the two. It uses cost of goods plus operating expenses, but excludes interest and taxes. Operating margin is the cleanest comparison across companies because it strips out capital structure and tax jurisdiction.
How discounts and price changes affect margin
Discounts hurt margin disproportionately. A 10% price cut on a product with a 30% margin does not knock margin down to 20%. It knocks it down to about 22.2%, which is a 26% relative drop in margin. Cost stays the same; only revenue moves.
Worked example. Cost is $70, price is $100, margin is 30%. Cut the price by 10% to $90. New margin is ($90 − $70) ÷ $90 = 22.2%. To make up the lost profit at the new price, you need to sell about 35% more units. That is the math behind why volume sales rarely break even.
Price increases work the same way in reverse and are surprisingly forgiving. A 10% price hike on the same product takes margin from 30% to 36.4% — a 21% relative gain. Even if you lose some customers, the math usually wins, which is why incumbent businesses raise prices every year.
Marketing tools default to "10% off" coupons because they feel small. In margin terms, they almost never are. Before approving a discount, run the math: a 10% price cut on a 30% margin requires 50% more volume to break even on profit. On a 20% margin it requires 100% more volume.
Common margin mistakes
Four mistakes account for most pricing errors:
1. Margin vs. markup confusion. Adding 30% to cost is markup, not margin. To get a 30% margin, divide by 0.70 instead of multiplying by 1.30. The error always favors the customer, never the business.
2. Mistaking gross margin for net margin. A 60% gross margin sounds great until you back out 30% labor, 12% rent, 8% marketing, and 5% other overhead. The number that matters at year-end is net, not gross.
3. Comparing margins across industries. SaaS at 15% net is in trouble. Grocery at 15% net is doing the impossible. Industry benchmarks are the only fair comparison.
4. Ignoring volume sensitivity. Two businesses can have identical 30% margins. The one selling 10,000 units a year is robust. The one selling 100 is a single bad month from bankruptcy. Margin tells you per-unit health; volume tells you survival.