Margin Calculator
Use three pricing modes to review an existing selling price, calculate a required price from a target gross margin, or apply a markup to cost. See gross profit or loss, margin, markup, cost share, pricing status, formulas, and a downloadable CSV summary.
Pricing inputs
Compare price, margin, and markup
Review an existing price and calculate gross profit, margin, and markup.
Use the direct cost for the same unit or quantity as the selling price.
Use the price before indirect costs and operating expenses.
Gross margin
$50.00 gross profit on a selling price of $150.00.
- Selling price
- $150.00
- Gross profit
- $50.00
- Markup on cost
- 50%
- Cost share of price
- 66.67%
Pricing breakdown
Price composition
Cost and gross profit inside the selling price
- Cost
- $100.00
- Gross profit
- $50.00
- Selling price
- $150.00
Calculation
(selling price − cost) ÷ selling price × 100
- Gross margin
- 33.33%
- Markup on cost
- 50%
Gross profitability excludes operating expenses, payment fees, shipping, taxes, refunds, and overhead.
How to Use the Margin Calculator
Choose Price to review an existing selling price, Margin to find the price required for a target gross margin, or Markup to add a target percentage to cost.
Enter costs and prices for the same unit or matching quantity. Mixing a per-item cost with revenue for several items produces a meaningless result.
The primary result shows either gross margin or the required selling price. Supporting results show gross profit or loss, markup, cost share, and status.
Open the pricing breakdown to inspect the formula, price composition, calculation notes, print view, and CSV export.
Choose the correct pricing mode
Swipe horizontally to view the full table.
Gross Profit, Gross Margin, and Markup
Gross profit is selling price minus direct cost. It is the amount left before operating expenses and other indirect costs.
Gross margin divides gross profit by selling price. It answers: what percentage of the sale remains after the entered direct cost?
Markup divides the same gross profit by cost. It answers: how much was added relative to the cost base?
Because margin and markup use different denominators, the percentages should not be used interchangeably.
Why Margin Is Lower Than the Matching Markup
For a profitable sale, selling price is larger than cost. Dividing profit by the larger selling-price denominator produces a lower percentage than dividing by cost.
A product costing $100 and selling for $150 produces $50 gross profit. The gross margin is 33.33%, while markup is 50%.
A 50% margin requires a 100% markup. Adding a 50% markup does not produce a 50% margin.
Margin and markup for the same transaction
Every row uses a $100 direct cost. Margin divides profit by selling price; markup divides profit by cost.
Swipe horizontally to view the full table.
Finding a Selling Price From Target Margin
A target margin treats gross profit as a share of the final selling price. The cost therefore represents the remaining share of revenue.
For a 40% target margin, cost must equal 60% of selling price. A $60 cost therefore requires a $100 selling price.
A target margin of 100% is impossible when cost is positive because it leaves no share of revenue available to cover cost.
Finding a Selling Price From Target Markup
Markup starts with cost. A 35% markup multiplies cost by 1.35.
For example, a $200 cost with 35% markup produces a $270 selling price and $70 gross profit. The matching gross margin is about 25.93%.
Negative markup down to -100% can model selling below cost. A -100% markup produces a zero selling price.
Profit, Break-Even, and Loss Scenarios
A selling price above cost produces gross profit. Equal price and cost produce break-even gross profit of zero. A price below cost produces a gross loss.
A loss creates negative margin and negative markup when their denominators are non-zero.
Selling below direct cost may be intentional in a promotion or loss-leader strategy, but this calculator does not evaluate whether the wider strategy is profitable.
Cost of Goods Sold Must Match the Price
Use the direct cost attributable to the same product, service, unit, order, or quantity represented by the selling price.
For products, direct cost may include purchase or production cost assigned to the item. For services, use the direct delivery cost appropriate to the pricing decision.
Accounting treatment varies. Use the business's accounting policy or professional advice when deciding which costs belong in cost of goods sold.
Gross Margin Is Not Net Profit Margin
Gross profitability does not deduct operating expenses such as payroll, rent, software, advertising, insurance, administration, interest, or income tax.
It also excludes payment-processing charges, shipping, refunds, marketplace commissions, and sales taxes unless those amounts are included in the cost entered.
A product can have a positive gross margin while the business still reports a net loss.
What the gross-profit calculation includes and excludes
Swipe horizontally to view the full table.
Rounding a Required Selling Price
A target-price result can contain more decimal places than the currency normally uses.
Rounding upward can produce a slightly higher margin or markup, while rounding downward can produce a slightly lower one.
After choosing a practical price, switch to Price mode and enter the rounded amount to check the profitability actually achieved.
Pricing Requires More Than One Percentage
A mathematical target does not account for customer demand, competitor prices, perceived value, tax treatment, minimum advertised pricing, or price elasticity.
Use margin and markup to understand cost recovery and gross profitability, then combine them with market research and the complete cost structure.
Review pricing whenever direct costs, channel fees, discount policies, packaging, shipping, or product mix changes.
Privacy and Appropriate Use
The calculation and CSV creation run locally in the browser.
The tool is suitable for testing product, service, wholesale, retail, and ecommerce pricing scenarios.
The output is not a financial statement, tax calculation, accounting policy, or guarantee that a price will produce a desired sales volume.
Margin and Markup Formulas
Margin and markup describe the same gross profit using different reference values. Target-price formulas rearrange those relationships.
Formula variables
- Direct cost or cost of goods sold
- Selling price or revenue for the matching unit or quantity
- Gross profit or gross loss
- Gross margin percentage
- Markup percentage measured against cost
- Cost as a percentage of selling price
Examples
Review an existing selling price
1Input
Cost $100; selling price $150.
Show result
Result
Gross profit $50; gross margin 33.33%; markup 50%; cost share 66.67%.
Set a price from target margin
2Input
Cost $60; target gross margin 40%.
Show result
Result
Required selling price $100; gross profit $40; markup 66.67%.
Set a price from target markup
3Input
Cost $200; target markup 35%.
Show result
Result
Required selling price $270; gross profit $70; gross margin about 25.93%.
Check a break-even price
4Input
Cost $80; selling price $80.
Show result
Result
Gross profit $0; margin 0%; markup 0%; status Break-even.
Measure a gross loss
5Input
Cost $100; selling price $75.
Show result
Result
Gross loss $25; gross margin -33.33%; markup -25%.
Check a rounded target price
6Input
Calculate a target price, round it to a practical currency amount, then enter that value in Price mode.
Show result
Result
Shows the margin and markup produced by the price that will actually be charged.
Frequently Asked Questions
What is the difference between margin and markup?
Margin divides gross profit by selling price. Markup divides gross profit by cost. They describe the same transaction using different reference values.
Why is markup higher than margin?
For a profitable sale, cost is smaller than selling price. Dividing profit by the smaller cost base produces the higher percentage.
How do I calculate gross margin?
Subtract cost from selling price, divide the result by selling price, and multiply by 100.
How do I calculate markup?
Subtract cost from selling price, divide the result by cost, and multiply by 100.
How do I calculate selling price from a target margin?
Divide cost by one minus the target margin written as a decimal. A $60 cost at 40% target margin requires a $100 selling price.
How do I calculate selling price from markup?
Multiply cost by one plus the markup written as a decimal. A $200 cost with 35% markup produces a $270 price.
Is a 50% markup the same as a 50% margin?
No. A 50% markup produces a 33.33% margin. A 50% margin requires a 100% markup.
Can gross margin be negative?
Yes. Selling below cost produces a gross loss and a negative margin when the selling price is above zero.
Why is margin undefined when selling price is zero?
The margin formula divides gross profit by selling price. Division by zero is undefined.
Why is markup undefined when cost is zero?
The markup formula divides gross profit by cost. Division by zero is undefined.
Does this calculator show net profit?
No. It calculates gross profitability before operating expenses and other indirect costs.
Can I use this calculator for services?
Yes. Use the direct cost of delivering the service and a selling price for the same scope of work.
Does the calculator include sales tax or payment fees?
No. Those amounts are excluded unless they are deliberately included in the cost entered.
Why can a rounded price miss the exact target?
Rounding changes the selling price used by the formula. Recheck the rounded amount in Price mode to see the margin actually achieved.
Are my pricing inputs uploaded?
No. Calculations and CSV creation occur locally in the browser.
References
You might also like
Percentage Calculator
Calculate percentages, percent change, increase, decrease, difference, discount, markup, markdown, tax, tips, and equal bill splits.
Sales Tax Calculator
Add tax to a price or remove included tax to recover the original price and tax amount.
Platform Payout & Fee Calculator
Estimate platform payout, fee leakage, tax reserves, or the gross sales needed to reach a target take-home amount.
Cake Pan Size Converter
Calculate how much batter you need when changing between round, square, or rectangular cake pans.