Margin Calculator
Enter your cost and selling price to find your gross margin and markup โ or work backwards from a target margin to find the price you need to charge. Useful for product businesses, freelancers, and anyone pricing something for the first time.
Margin: Calculated relative to the selling price.
Markup: Calculated relative to the cost price.
The Most Expensive Mistake in Pricing
Margin and markup are not the same number
This is the single most common pricing error in small business โ and it's costly because the two figures sound similar but produce very different selling prices. If someone asks you for a "50% margin" and you give them a "50% markup", you've underpriced by a significant amount.
Markup
How much you added above your cost. The reference point is what you paid.
Gross Margin
What percentage of the final price is profit. The reference point is what the customer paid.
The practical trap
If a buyer says "we need at least 50% margin on this product" and your cost is $100, the correct price is $200 โ not $150. A 50% margin means half the selling price is profit. A 50% markup gets you to $150, which is only a 33.3% margin. The confusion can quietly make every sale unprofitable.
The Math
Three questions, three formulas
Every pricing calculation is a variation of the same triangle: cost, price, and profit. Know any two and you can solve for the third. Here's each version with a worked example you can verify manually.
What's my margin?
Use this when you already have a price and want to know how profitable it is.
What price do I need?
Use this when working backwards from a required margin to set a price.
What's my markup?
Use this when your buyer or supplier frames things in markup terms.
Quick conversion: Margin โ Markup equivalents
| Target Margin | Required Markup | Price on a $100 cost |
|---|---|---|
| 20% | 25% | $125 |
| 25% | 33.3% | $133 |
| 33.3% | 50% | $150 |
| 40% | 66.7% | $167 |
| 50% | 100% | $200 |
| 60% | 150% | $250 |
Formula: Required Markup = Margin / (1 โ Margin)
Inputs
What actually belongs in your cost figure
Gross margin is only meaningful if your cost (COGS) is accurate. Underestimating your cost inflates your margin on paper and erodes your actual profit in the bank. Here's what counts and what doesn't.
Physical products
Include in COGS
- +Raw materials
- +Manufacturing labor
- +Inbound freight
- +Packaging
- +Import duties
Exclude from COGS
- โMarketing spend
- โWarehouse rent
- โAdmin salaries
- โCustomer support
Digital / SaaS
Include in COGS
- +Cloud hosting (per-user)
- +Third-party API costs
- +Payment processing fees
- +Data storage costs
Exclude from COGS
- โEngineering salaries
- โOffice costs
- โSales commissions
- โR&D spend
Services / Freelance
Include in COGS
- +Your hourly rate (cost to produce)
- +Software licenses used on the project
- +Subcontractor fees
Exclude from COGS
- โOverhead not tied to this job
- โBusiness insurance
- โUnbillable admin time
Why this matters
Gross margin intentionally excludes operating expenses (rent, salaries, marketing). That's a feature, not a bug โ it isolates how efficiently you convert raw inputs into sellable output. Operating expenses come out later to give you operating margin and net margin. Gross margin is just the first layer.
Benchmarks
What's a healthy margin in your industry?
There's no single "good" gross margin. A 20% margin is a disaster for a software business and a strong result for a restaurant. The only benchmark that matters is what's typical for your sector โ and whether your trend is moving in the right direction.
SaaS / Software
75% โ 90%
Near-zero marginal cost of serving an additional customer makes software the highest-margin business model at scale. Below 70% usually signals heavy infrastructure or third-party API dependency.
Professional Services (agencies, consulting)
50% โ 70%
Labor is the primary cost. Utilization rate (how many billable hours vs available hours) is the lever. A 60% utilization rate with strong billing rates can sustain healthy margins.
Retail / Apparel / DTC
40% โ 60%
Must absorb inventory risk, returns, and seasonal discounting. Brands that control their supply chain (direct manufacturing) typically land at the higher end.
Restaurants / Food Service
60% โ 70%
This is gross margin on food alone (before labor and rent, which are enormous). Net margins in restaurants are typically 3โ9%, which is why volume and table turns matter so much.
E-commerce (reselling)
20% โ 40%
Thin margins are the trade-off for low capital requirements. Paid acquisition costs and platform fees (Amazon, Shopify) frequently erode this further if not managed tightly.
Grocery / Supermarket
2% โ 5%
The most extreme example of a volume model. Grocery chains compensate with massive scale, supplier rebates, and private-label products that carry higher margins.
For Freelancers & Agencies
Pricing your time with margin logic
Your "cost" as a freelancer is your effective hourly cost to operate โ salary expectation, software subscriptions, and overhead divided into billable hours. If that works out to $45/hr, and you bill clients $135/hr, your gross margin is 66.7%.
Most freelancers who feel underpaid have simply never run this calculation. They quote a "market rate" without knowing whether that rate actually covers their cost structure โ and the margin calculator makes that visible in seconds.
For Product Businesses
Working backwards from required margin
Retail buyers and wholesale distributors will often state a minimum margin requirement upfront. If a buyer needs 50% margin and your COGS is $24, use the price formula: $24 / (1 โ 0.50) = $48 minimum sell price. Quote anything below that and the deal doesn't work for them.
The same logic applies when raising prices. A cost increase from $24 to $28 on a product you sell at $48 drops your margin from 50% to 41.7%. The calculator shows you exactly how much to raise the price to restore it.
Tips
Getting your numbers right
Don't include shipping in COGS unless you absorb it
If you offer free shipping but charge a flat rate, the outbound freight eats into margin. If customers pay separately for shipping, it's not part of your product margin. Many e-commerce businesses miscategorize this and believe their margins are worse than they are.
Track margin by product line, not just overall
A blended 40% margin across your entire catalog hides wide variation. One product might be carrying the others. Calculating margin per SKU or service tier reveals which products to push and which to reprice or discontinue.
Payment processing fees belong in your margin calculation
Stripe, PayPal, and similar processors typically charge 2.5โ3% of revenue. On a product with a 15% margin, that fee alone wipes out 20% of your profit. Include it in your cost or price accordingly โ especially for low-margin, high-volume products.
Markup over 100% is normal โ and not a cause for alarm
A 200% markup sounds aggressive but only translates to a 66.7% margin. In industries like specialty retail, craft goods, or B2B software, markups of 200โ500% are standard. The markup percentage is a less useful number than the margin โ focus on margin when evaluating profitability.
Limitations
What gross margin doesn't tell you
Gross margin isn't the same as profitability
A 70% gross margin looks impressive, but if your operating expenses (salaries, rent, marketing) consume 75% of revenue, the business is losing money. Gross margin is the first health check, not the final verdict.
It doesn't account for returns and discounts
If you sell at $150 but regularly issue 20% discount codes and accept 10% returns, your effective revenue per unit is closer to $108. Use actual collected revenue in your calculation, not list price.
Volume changes the picture
A 30% margin on 10 units per month is a different business than 30% margin on 10,000 units. Gross margin is a rate โ absolute profit dollars depend on volume. This calculator doesn't factor in scale.
Taxes and currency
The calculator works with any currency but doesn't apply VAT, sales tax, or local levies to the cost or price. If your COGS includes taxed inputs or your selling price includes collected tax, adjust your inputs manually before entering them.
FAQ
Common questions
Questions that come up when people are pricing something for the first time โ or trying to explain their numbers to a buyer, investor, or business partner.
Can markup exceed 100%? Does that mean I'm overcharging?+
Markup has no ceiling, and exceeding 100% is entirely normal. A 100% markup simply means you doubled your cost. If your product costs $20 and you sell it for $60, your markup is 200% and your margin is 66.7%. Whether that's fair or sustainable depends on your market, not the percentage itself.
How do I use this for a service quote where I don't have a traditional 'cost'?+
Calculate your effective hourly cost to operate โ what you need to earn per hour to cover your salary target, software tools, and a share of overhead. That figure becomes your "cost" input. Your quoted rate becomes the "price". The margin percentage tells you how much buffer you have for slower months, unexpected costs, or reinvestment.
Example: if your hourly cost is $50 and you quote $100/hr, you're running a 50% margin. That means every dollar earned above your baseline cost goes to business growth or profit.
What's the difference between gross margin and net margin?+
Gross margin subtracts only COGS from revenue. Net margin subtracts everything โ COGS, operating expenses (rent, salaries, marketing, R&D), interest, and taxes. A business can have an excellent 70% gross margin and a poor 5% net margin if its operating costs are very high. This calculator works at the gross level only.
How does a price increase affect margin if costs stay the same?+
Margin improves non-linearly when you raise prices with fixed costs. If your cost is $60 and you raise price from $100 to $110, your margin goes from 40% to 45.5% โ a meaningful gain from a modest price increase. This is why pricing power (the ability to raise prices without losing customers) is so valuable in business.
Is my pricing data private?+
Yes. Everything runs in your browser. Your cost, price, and margin figures are never transmitted to any server, logged, or associated with your account in any way.