Gross Profit Margin Calculator
See how much of every sales dollar your business actually keeps — margin, markup, and the difference between them.
COGS = materials, direct labor, and production costs only — not rent or salaries.
Margin is measured on revenue; markup is measured on cost. The same numbers always give a higher markup than margin — that is normal, not an error.
Revenue is vanity, profit is sanity — and gross profit margin is the number that connects the two. A business doing $500,000 in sales sounds impressive until you learn it keeps only 8 cents of every dollar. Another doing $200,000 at a 55% margin is quietly far healthier.
The Gross Profit Margin Calculator takes your total revenue and cost of goods sold and reveals what is really going on: your gross profit in dollars, your margin as a percentage, and your markup — the figure people constantly confuse with margin.
Whether you are pricing products, reviewing a P and L, or deciding if a business is worth buying, this is the first ratio to check and the one most worth understanding deeply.
What Does the Gross Profit Margin Calculator Do?
This calculator takes total revenue and cost of goods sold (COGS) — the direct costs of producing what you sold — and computes three things. Gross profit in dollars (revenue minus COGS), gross profit margin as a percentage of revenue, and markup as a percentage of cost.
It also translates the margin into plain language — how many cents of every sales dollar you keep — and flags margins that look unusually thin or suspiciously high, so you know whether to investigate your costs or double-check your inputs.
How to Use the Gross Profit Margin Calculator
Enter your total revenue for the period and your cost of goods sold. COGS means direct production costs only: materials, direct labor, packaging, and freight-in. Do not include rent, salaries, marketing, or other overhead — those come later, below the gross profit line.
Press Calculate. The two headline boxes show your margin and markup side by side, with detail rows for the dollar figures beneath. Use Reset to clear the form.
The Margin Formula
Gross profit margin measures profit against revenue. The formula is:
margin = (revenue − COGS) ÷ revenue × 100
With $50,000 in revenue and $32,000 in COGS: ($50,000 − $32,000) ÷ $50,000 × 100 = 36%. You keep 36 cents of every dollar sold; the other 64 cents went to producing the goods.
The Markup Formula — and Why It Differs
Markup measures the same profit against cost instead of revenue. The formula is:
markup = (revenue − COGS) ÷ COGS × 100
Same numbers: ($50,000 − $32,000) ÷ $32,000 × 100 = 56.25%. The markup is always higher than the margin for the same figures, because the denominator (cost) is smaller than revenue. This is not an error — it is arithmetic.
Margin Versus Markup: The Confusion That Costs Money
This is the most expensive mix-up in small business. A retailer who wants a “40% margin” but prices at a 40% markup actually earns a 28.6% margin — and wonders where the profit went. The two are related but never equal.
The conversion is simple. From markup m to margin: margin = m ÷ (1 + m). From margin g to markup: markup = g ÷ (1 − g). A 40% markup (m = 0.40) gives 0.40 ÷ 1.40 = 28.6% margin. Memorize the direction that matters to you and stop leaving money on the table.
Worked Example: The $50,000 Product Business
A small brand sells $50,000 in a quarter with $32,000 in COGS.
First: gross profit. $50,000 − $32,000 = $18,000.
Then: margin. $18,000 ÷ $50,000 × 100 = 36%.
Then: markup. $18,000 ÷ $32,000 × 100 = 56.25%.
Answer: $18,000 profit, 36% margin, 56.25% markup — a healthy profile for a product business, keeping 36 cents per dollar.
Worked Example: The Thin-Margin Wholesaler
A wholesaler moves $400,000 of goods with $368,000 in COGS.
First: gross profit. $400,000 − $368,000 = $32,000.
Then: margin. $32,000 ÷ $400,000 × 100 = 8%.
Then: markup. $32,000 ÷ $368,000 × 100 = 8.7%.
Answer: 8% margin. Thin, but normal for wholesale — the model works on volume, and the calculator correctly flags it as thin rather than wrong.
Worked Example: Pricing for a Target Margin
You want a 50% margin and your unit cost is $20. What price do you set?
First: rearrange the margin formula. Price = cost ÷ (1 − margin).
Then: $20 ÷ (1 − 0.50) = $40.
Answer: price at $40. Note the trap: a 50% markup would give $30 — only a 33.3% margin. Always price from the margin formula when margin is the goal.
Worked Example: The Software Business
A SaaS company has $120,000 in revenue and $18,000 in COGS (hosting and support).
First: gross profit. $120,000 − $18,000 = $102,000.
Then: margin. $102,000 ÷ $120,000 × 100 = 85%.
Answer: 85% margin. The calculator flags this as software-like — correct for SaaS, but a red flag if claimed by a physical-goods business that probably forgot costs in COGS.
What Counts as COGS (and What Does Not)
COGS includes everything directly tied to production: raw materials, components, direct labor, manufacturing overhead, packaging, and inbound freight. For a retailer, it is essentially the wholesale cost of goods sold.
It excludes rent, utilities for the office, administrative salaries, marketing, insurance, and interest. Those are operating expenses, deducted after gross profit to reach operating profit. Putting rent into COGS understates your margin and makes period-to-period comparisons meaningless.
What Is a Good Gross Profit Margin?
It depends entirely on the industry. Grocery and wholesale run 5–15%, restaurants 60–70% on food (before labor), general retail 25–50%, manufacturing 20–40%, and software 70–90%. There is no universal “good” — only good for your business model.
What matters is the trend and the comparison: is your margin stable or sliding, and how do you compare to direct competitors? A 36% margin is excellent for a grocer and alarming for a SaaS company. Context is the whole game.
How Margin Connects to the Rest of the P and L
Gross profit is the first profit line, not the last. From it you subtract operating expenses (rent, salaries, marketing) to get operating profit, then interest and taxes to reach net profit. Each step down, the margin shrinks.
A business can have a fine gross margin and still lose money — the classic case is high overhead eating a decent product margin. That is why investors read the whole statement, but they always start here: if the gross margin is broken, nothing below it can fix it.
How Discounts Destroy Margin
Discounts feel like a sales tool; mathematically they are a margin tax. A 10% discount on a product with a 36% margin does not cut the margin by 10% — it cuts it to roughly 29%, because the COGS stays fixed while revenue falls. The formula is brutal: every discount point costs more than a margin point.
Before any promotion, recompute the margin at the discounted price with the calculator. If the discounted margin cannot cover overhead, the sale loses money on every unit — and “making it up on volume” just multiplies the loss. Discount from strength, with the post-discount margin known in advance.
Margin by Sales Channel
The same product carries different margins in different channels. Selling direct at $50 with $32 COGS gives the 36% margin from the worked example. Selling wholesale at $40 with the same COGS gives ($40 − $32) ÷ $40 = 20%. Selling through a marketplace that takes 15% gives ($42.50 − $32) ÷ $42.50 = 24.7%.
Run the calculator separately for each channel instead of blending them into one average. Channel-level margins reveal which outlets deserve more inventory and marketing — and which are quietly subsidized by the profitable ones.
Common Gross Margin Mistakes
The number-one mistake is the margin/markup mix-up described above — pricing with the wrong formula and silently earning less than intended. Number two is polluting COGS with overhead, which makes margins incomparable across periods.
Number three is ignoring margin when chasing revenue: discounting to “drive sales” while the margin quietly collapses. And number four is comparing your margin to the wrong industry’s benchmark and drawing false comfort — or false alarm — from it.
Where Margin Calculations Are Useful
Founders use them to set prices that actually sustain the business. Buyers use them in due diligence — a declining margin is one of the earliest signs of a business under competitive pressure.
Lenders check margins to judge whether a borrower can service debt, and managers track margin by product line to decide what to promote, reprice, or discontinue. One ratio, an entire operating system of decisions.
How to Interpret Your Result Correctly
Read the result as a starting diagnosis. A healthy margin means your pricing power and cost control are working; a thin one points at either prices that are too low or costs that are too high — the fix differs completely.
Always pair the margin with the markup so you speak the same language as your suppliers and pricers, and always compare against your own history and your industry. A single period’s margin is a data point; the trend is the story.
Frequently Asked Questions
1. What is gross profit margin?
The share of revenue left after direct production costs: (revenue − COGS) ÷ revenue × 100. A 36% margin means you keep 36 cents of every sales dollar before overhead.
2. What is the difference between margin and markup?
Margin divides profit by revenue; markup divides the same profit by cost. Markup is always higher for the same numbers. Convert with margin = markup ÷ (1 + markup).
3. How do I calculate markup from margin?
Use markup = margin ÷ (1 − margin). A 36% margin gives 0.36 ÷ 0.64 = 56.25% markup — matching the worked example exactly.
4. What is a good gross profit margin?
It varies by industry: 5–15% for grocery/wholesale, 25–50% for retail, 20–40% for manufacturing, 70–90% for software. Compare against competitors, not a universal number.
5. What counts as cost of goods sold?
Direct production costs: materials, direct labor, manufacturing overhead, packaging, inbound freight. Exclude rent, admin salaries, marketing, and interest — those are operating expenses.
6. Can gross profit margin be negative?
Yes — when COGS exceeds revenue, meaning you sell below direct cost. It signals severe pricing or cost problems and is unsustainable outside deliberate loss-leader strategies.
7. How do I price for a 40% margin?
Price = cost ÷ (1 − 0.40). A $25 cost needs a $41.67 price. Do not use a 40% markup ($35) — that yields only a 28.6% margin.
8. Why is my margin falling while revenue grows?
Usually discounting, rising input costs, or a shift toward lower-margin products. Revenue growth with margin decay is a classic warning sign — investigate before celebrating the top line.
9. Is gross margin the same as net margin?
No. Gross margin stops after COGS; net margin subtracts everything — operating expenses, interest, and taxes. Net margin is always lower, sometimes dramatically.
10. Do service businesses have COGS?
Yes — direct labor delivering the service counts. A consultancy’s COGS is largely the cost of billable staff time. Pure pass-through or marketplace models may have near-zero COGS and very high gross margins.
11. How often should I check my margin?
Monthly for most small businesses, per product line quarterly. Margins move slowly until they move suddenly — regular checks catch cost creep early.
12. What is a good markup percentage?
Retail commonly uses 50–100% markup (keystone is 100%, i.e., double the cost). Convert any markup target to margin before judging it: 100% markup is exactly a 50% margin.
13. Can margin exceed 100%?
No — margin caps at 100% (zero cost). Markup has no cap. If your “margin” exceeds 100%, you computed a markup by mistake.
14. How do discounts affect margin?
Directly and brutally: a 10% discount on a 36% margin product drops the margin to about 29%. Discount from a margin-aware price, or the promotion costs more than it earns.
15. Should I include shipping costs in COGS?
Inbound freight (getting goods to you) belongs in COGS. Outbound shipping to customers is usually a selling expense below the gross profit line — though practices vary, so stay consistent period to period.