Profit Margin Calculator
Reading a P&L? This profit margin calculator takes revenue and your cost lines and returns all three levels — gross, operating and net — so you can see exactly where the money goes.
Free · No signup · Runs entirely in your browser
Enter what you earned and what it cost. Leave a cost blank and that level simply matches the one above it.
Total sales for the period.
Costs that scale with each sale.
Salaries, rent, tooling. Optional.
Everything below the operating line. Optional.
Of every dollar of revenue, 60.0% survives cost of goods and 20.0% reaches the bottom line. The gap between those two is what the business costs to run, regardless of how much you sell.
Margins tell you whether the business works. If you are building it largely on your own, Tekk turns what you want into specs your coding agent can actually execute.
The three margins
"Profit margin" is three different numbers depending on which costs you subtract. Most calculators give you one and let you assume it's the one you wanted, which is why the profit margin calculator above returns all three.
gross margin % = (revenue − COGS) ÷ revenue × 100
operating margin % = (revenue − COGS − operating expenses) ÷ revenue × 100
net margin % = (revenue − COGS − operating expenses − interest and tax) ÷ revenue × 100
Each one strips out more cost, so each is smaller than the last. Gross margin tells you whether the product works. Operating margin tells you whether the business works. Net margin tells you what the owners actually keep.
Worked example
A company turns over $100,000 in a quarter:
| Line | Amount | Running profit | Margin |
|---|---|---|---|
| Revenue | $100,000 | — | — |
| − Cost of goods sold | $40,000 | $60,000 | 60.0% gross |
| − Operating expenses | $30,000 | $30,000 | 30.0% operating |
| − Interest and tax | $10,000 | $20,000 | 20.0% net |
Quoting "60% margin" to an investor when the business keeps 20% is the single most common version of this mistake.
What counts as COGS
The formula is easy. Deciding what belongs above the gross line is where people get it wrong.
Include anything that scales with each additional sale: raw materials, manufacturing, payment processing fees, per-customer hosting, third-party API calls billed per use, and the support cost that grows with customer count.
Exclude anything you'd pay with zero customers: salaries for staff who aren't delivering the product, rent, software subscriptions, marketing, and legal. Those belong in operating expenses, which is what separates your gross margin from your operating margin.
Software businesses routinely report 75–85% gross margins because the marginal cost of one more customer is close to zero. Retail and food service run far lower. Comparing your margin to a benchmark from another industry tells you very little.
Working backwards from a target
To find the revenue you need for a target gross margin:
revenue = COGS ÷ (1 − target margin)
On $40,000 of COGS, a 60% target means $100,000 of revenue. A 70% target means $133,333. The required revenue climbs steeply as the target rises, which is why margin goals are usually hit by cutting COGS rather than raising prices.
Margin is not markup
A 50% margin is a 100% markup, not a 50% one. Margin divides profit by revenue; markup divides it by cost. The two only agree at zero. If you're pricing up from a known cost rather than analysing a P&L, use the markup calculator instead.
How it works
- 1
Enter revenue and cost of goods
The profit margin calculator updates as you type. Revenue minus COGS gives you gross profit and gross margin — the first and most important of the three levels.
- 2
Add operating expenses and tax
Each cost you add strips another layer out, revealing operating margin and then net margin. Leave a field blank and that level simply matches the one above it.
- 3
Read the gap between gross and net
That difference is what the business costs to run regardless of sales volume. It's the number that decides whether selling more actually helps.
Frequently asked questions
- What is profit margin?
- Profit margin is profit expressed as a percentage of revenue. It answers the question "of every dollar that comes in, how much do we keep?" Because there are several definitions of profit — before or after operating costs, before or after tax — there are several margins, and they can differ by a factor of three on the same business. The profit margin calculator above shows all three at once so you don't have to pick one blind.
- What is the difference between gross, operating and net margin?
- They differ by which costs you subtract. Gross margin subtracts only the cost of goods sold, so it measures whether the product itself is profitable. Operating margin also subtracts salaries, rent and other running costs, so it measures whether the business is profitable. A net profit margin calculator goes furthest, subtracting interest and tax as well to show what actually reaches the owners.
- How do you calculate profit margin?
- Subtract your costs from revenue, divide by revenue, then multiply by 100. Which costs you subtract determines which margin you get: COGS alone gives gross margin, COGS plus operating expenses gives operating margin, and everything including interest and tax gives net margin. This profit margin calculator does all three from one set of numbers.
- Can I use this as a gross margin calculator?
- Yes. Enter revenue and cost of goods sold and leave the other two fields at zero — the gross margin figure is the first result. This works as a gross margin calculator, an operating margin calculator and a net profit margin calculator at the same time, which is the point of showing all three levels together.
- Is there an operating margin calculator here too?
- The same one. Add your operating expenses — salaries, rent, tooling, marketing — and the operating margin appears as the middle result. Operating margin is the number most investors look at first, because it strips out financing and tax decisions and shows the underlying business.
- What counts as cost of goods sold?
- Anything that increases when you sell one more unit: materials, manufacturing, payment processing, per-customer hosting, usage-billed APIs. Anything you would still pay with zero customers — rent, salaries for non-delivery staff, marketing, subscriptions — is an operating expense instead. Getting this line wrong is the most common reason two people calculate different margins for the same business.
- What is a good profit margin?
- It depends almost entirely on the industry. Software businesses often run 75–85% gross and 10–25% net. Grocery retail runs low single-digit net margins and is perfectly healthy. Restaurants typically sit between 3% and 9% net. Whatever figure you land on, it only means something next to others in the same sector.
- Can profit margin be negative?
- Yes, and the level where it turns negative matters. A negative gross margin means you lose money on every sale, so growth makes things worse. A positive gross margin with a negative net margin means the product works but the overheads are too heavy for the current revenue — that one can be fixed by growing.
- What is the difference between margin and markup?
- Margin divides profit by revenue; markup divides it by cost. A 50% margin is the same sale as a 100% markup. They answer different questions, which is why they are separate tools: use this one to analyse a business you already have numbers for, and the markup calculator when you are pricing a single item up from its cost.
- Can margin ever be 100%?
- Not in practice. A 100% margin would mean the costs you're subtracting are zero. Margin approaches 100% as costs approach nothing but never reaches it, which is also why there's no finite revenue that hits a 100% target.
- Does this work for a service business or an agency?
- Yes. Treat billable delivery cost — the loaded cost of the people doing the work — as cost of goods sold, and everything else as operating expenses. The gross margin you get is your delivery margin, which for agencies is usually the number that decides whether the model scales.
- Do you store the numbers I enter?
- No. The calculation runs entirely in your browser. Nothing is sent to a server, nothing is logged, and there is no account. Disconnect from the internet and it will still work.
- Why is this free, and what is Tekk?
- Tekk is a spec-driven development platform for people building software with AI coding agents. This calculator costs us nothing to run, and the people reading a P&L are often the same people building the product behind it. No signup, no run limit, no upsell inside the tool.
Want a real spec for what you’re building?
Drop a sentence. Tekk grounds it in your actual code and turns it into an executable plan.
Free to try · Connect GitHub during signup