Margin Calculator

Choose what you want to calculate, enter the known values, then click Calculate.

What do you want to calculate?

To calculate margin, enter Cost and Revenue.

The selected result field is locked automatically. Enter the known values only.

Margin Formula Table

Requirement Formula Inputs Needed
Calculate Profit Profit = Revenue − Cost Revenue and Cost
Calculate Margin Margin (%) = 100 × Profit ÷ Revenue Revenue and Cost
Calculate Revenue from Margin Revenue = Cost ÷ (1 − Margin ÷ 100) Cost and Margin
Calculate Revenue from Profit Revenue = Cost + Profit Cost and Profit
Calculate Cost from Margin Cost = Revenue × (1 − Margin ÷ 100) Revenue and Margin
Calculate Cost from Profit Cost = Revenue − Profit Revenue and Profit

Margin is based on revenue, not cost. If you want profit as a percentage of cost, that is markup, not margin.

Use this Margin Calculator to calculate profit margin, revenue, cost, or profit from any two known values. Enter cost, margin, revenue, or profit, and the calculator estimates the missing values using standard gross margin formulas.

Important Note: This Margin Calculator estimates cost, revenue, profit, and margin percentage from any two known values. It uses standard gross margin relationships where profit equals revenue minus cost, and margin equals profit divided by revenue.

This calculator is best understood as a gross margin or simple profit margin tool. It does not automatically include overhead, payroll, rent, taxes, VAT/GST, shipping, payment processing fees, platform fees, advertising, discounts, refunds, returns, inventory loss, financing costs, or other operating expenses unless you manually include them in the cost value.

Use this calculator for quick pricing checks, target selling-price estimates, product margin review, and business planning. For official accounting, tax reporting, financial statements, investor reporting, or final pricing decisions, review your full cost structure and consult a qualified accountant or financial professional when needed.

Reviewed by: AjaxCalculators Editorial Team
Last updated: April 26, 2026
Method source: Standard gross profit margin relationships using cost, revenue, profit, and margin percentage
Editorial standards: AjaxCalculators Editorial Policy

What This Margin Calculator Calculates

This calculator estimates the missing values from cost, revenue, profit, and margin. Enter any two known values, and the tool updates the remaining fields automatically.

Input or Result What It Means Use Note
Cost The amount spent to produce, buy, or deliver the product or service. Include all relevant costs if you want the margin result to reflect broader profitability.
Revenue The selling price or income received from the sale. Use the same currency as cost and profit.
Profit The amount left after subtracting cost from revenue. Calculated as revenue minus cost.
Margin percentage Profit shown as a percentage of revenue. Margin is based on revenue, not cost.
Currency selector Changes the displayed currency symbol. It does not convert exchange rates.

What Profit Margin Means

Profit margin shows what percentage of revenue remains as profit after cost is subtracted. In this calculator, margin is based on revenue.

Term Formula Example With $100 Revenue and $60 Cost
Profit Revenue − Cost $100 − $60 = $40
Margin Profit ÷ Revenue × 100 $40 ÷ $100 × 100 = 40%
Markup Profit ÷ Cost × 100 $40 ÷ $60 × 100 = 66.67%

This is why margin and markup are not interchangeable. The same $40 profit gives a 40% margin but a 66.67% markup.

How the Margin Calculator Works

The calculator uses standard relationships between cost, revenue, profit, and margin percentage.

Calculation Formula Example
Profit from revenue and cost Profit = Revenue − Cost 150 − 90 = 60
Margin from profit and revenue Margin = Profit ÷ Revenue × 100 60 ÷ 150 × 100 = 40%
Revenue from cost and margin Revenue = Cost ÷ (1 − Margin ÷ 100) 80 ÷ (1 − 0.20) = 100
Cost from revenue and margin Cost = Revenue × (1 − Margin ÷ 100) 200 × (1 − 0.35) = 130
Revenue from cost and profit Revenue = Cost + Profit 90 + 60 = 150
Cost from revenue and profit Cost = Revenue − Profit 150 − 60 = 90

Margin vs Markup

Margin and markup both compare profit with another value, but they use different denominators.

Metric Formula Based On Use Case
Margin Profit ÷ Revenue × 100 Selling price or revenue Shows what percentage of revenue remains as profit.
Markup Profit ÷ Cost × 100 Cost Shows how much the selling price is increased above cost.

For example, if a product costs $60 and sells for $100, profit is $40. The margin is 40%, but the markup is 66.67%. Confusing markup with margin can cause pricing errors.

Gross Margin vs Net Margin

This calculator is best treated as a gross margin calculator unless you manually include all expenses in the cost field. Gross margin and net margin answer different profitability questions.

Margin Type What It Usually Includes What It Usually Excludes Best Use
Gross margin Revenue and direct cost or cost of goods sold. Overhead, rent, payroll, taxes, interest, advertising, software, and administrative expenses. Checking product, service, or sale-level profitability before overhead.
Operating margin Revenue minus operating costs. Often excludes interest, taxes, and non-operating items. Reviewing business operations after normal operating expenses.
Net margin Revenue after all expenses included in net profit. Nothing material should be excluded if true net profit is used. Understanding bottom-line profitability.

Xero explains profit margin as profit expressed as a percentage of revenue, with the type of profit margin depending on which expenses are deducted.

Assumptions and Important Notes

Assumption or Limitation What It Means
Uses simple gross margin formulas The calculator works from cost, revenue, profit, and margin percentage only.
Margin is based on revenue It does not calculate markup unless you use the markup formula separately.
Same currency required Cost, revenue, and profit should use the same currency. The currency selector changes display only.
No automatic overhead inclusion Overhead, rent, payroll, software, advertising, taxes, and financing costs are not included unless entered in cost.
No automatic fee inclusion Payment fees, platform fees, marketplace commissions, shipping, packaging, and fulfillment costs are not included unless added manually.
No tax or VAT/GST handling The calculator does not separate tax-inclusive and tax-exclusive prices.
No refund or discount modeling Returns, refunds, discounts, allowances, and chargebacks must be included manually if relevant.
100% margin limitation A 100% margin is not realistic when cost is greater than zero because revenue formula division becomes invalid.
Negative margin warning A negative margin means cost is higher than revenue.

Worked Example: Find Margin From Cost and Revenue

Suppose a product costs $70 and sells for $100.

Step Calculation Result
Find profit Profit = Revenue − Cost $100 − $70 = $30
Divide profit by revenue $30 ÷ $100 0.30
Convert to percentage 0.30 × 100 30%

So, a product with a $70 cost and $100 revenue has a $30 profit and a 30% margin.

Worked Example: Find Revenue From Cost and Target Margin

Suppose your cost is $120 and you want a 40% margin.

Step Calculation Result
Convert margin to decimal 40% ÷ 100 0.40
Subtract from 1 1 − 0.40 0.60
Calculate revenue Revenue = 120 ÷ 0.60 $200
Check profit Profit = 200 − 120 $80
Check margin 80 ÷ 200 × 100 40%

So, to earn a 40% margin on a $120 cost, the selling price or revenue should be $200.

Worked Example: Margin vs Markup

Suppose a product costs $50 and sells for $80.

Metric Calculation Result
Profit $80 − $50 $30
Margin $30 ÷ $80 × 100 37.5%
Markup $30 ÷ $50 × 100 60%

The margin is 37.5%, but the markup is 60%. This difference matters when setting target selling prices.

How to Use This Margin Calculator

  1. Enter any two known values: cost, margin, revenue, or profit.
  2. Use the same currency for cost, revenue, and profit.
  3. Select the currency symbol you want displayed if needed.
  4. Review the automatically updated missing values.
  5. Check whether the result reflects gross margin or whether you need to include more costs.
  6. Use Refresh to clear the fields and start again.

The currency selector changes the displayed symbol only. It does not convert exchange rates.

How to Interpret the Result

Result What It Means Important Caution
Cost The amount spent to make, buy, or deliver the product or service. If cost excludes fees or overhead, the margin may look better than real profitability.
Revenue The selling price or sales income. Use net sales after discounts, returns, or allowances if that is the number you want to analyze.
Profit Revenue minus cost. This may be gross profit, not net profit, unless all expenses are included.
Margin Profit as a percentage of revenue. Do not confuse it with markup, which uses cost as the denominator.
Negative margin Cost is higher than revenue. This usually means the sale loses money before considering other expenses.
Very high margin A large percentage of revenue remains after the entered cost. Check that all relevant costs have been included before relying on the result.

When a Margin Calculator Is Useful

This Margin Calculator is useful for quick pricing and profitability checks.

Use Case How the Calculator Helps
Setting product prices Find the selling price needed for a target margin.
Checking profit per sale Calculate how much profit remains after cost.
Reviewing cost increases See how higher costs affect margin if price stays the same.
Comparing products Compare which product keeps more revenue as profit.
Estimating service margins Check whether a service price covers labor, materials, and other entered costs.
Discount planning Check whether a sale price still leaves enough profit.
Small business pricing Estimate pricing scenarios before deeper accounting review.
Marketplace selling Test margin after including platform fees, payment fees, shipping, and packaging in cost.

Common Mistakes to Avoid

Mistake Why It Causes Problems
Confusing margin with markup Margin uses revenue as the denominator, while markup uses cost.
Dividing profit by cost when trying to calculate margin That calculates markup, not margin.
Forgetting hidden costs Shipping, packaging, platform fees, payment fees, refunds, discounts, and labor can reduce real margin.
Assuming gross margin equals net margin Net margin includes more expenses than a simple product-level margin.
Using a 100% target margin when cost is greater than zero The revenue formula becomes impossible because it requires division by zero.
Comparing margins across industries without context Different industries have different cost structures and normal margin ranges.
Ignoring sales volume A high margin on low sales volume may produce less total profit than a lower margin on high volume.
Ignoring cash flow Margin does not show timing of payments, inventory cost, debt service, or working-capital needs.
Using margin alone for business decisions Pricing decisions should also consider demand, competitors, costs, volume, customer value, and profit goals.

Formula Summary

What You Want to Find Formula Use Note
Profit Profit = Revenue − Cost Finds the amount left after cost.
Margin percentage Margin (%) = Profit ÷ Revenue × 100 Shows profit as a percentage of revenue.
Revenue from cost and margin Revenue = Cost ÷ (1 − Margin ÷ 100) Finds the selling price needed for a target margin.
Cost from revenue and margin Cost = Revenue × (1 − Margin ÷ 100) Finds the allowed cost for a given revenue and margin.
Revenue from cost and profit Revenue = Cost + Profit Use when cost and target profit are known.
Cost from revenue and profit Cost = Revenue − Profit Use when revenue and profit are known.
Markup percentage Markup (%) = Profit ÷ Cost × 100 Useful for comparison, but markup is not the same as margin.

When You May Need More Than This Calculator

This calculator is best for quick margin math. Some business decisions need a more complete financial model.

Need Better Method or Additional Check
Net profit margin Include all operating expenses, taxes, interest, fees, and other business costs.
VAT/GST-inclusive pricing Separate tax-inclusive and tax-exclusive prices before calculating margin.
Marketplace selling margin Include platform commission, payment processing, fulfillment, returns, ads, and shipping subsidies.
Discount planning Model the sale price, reduced revenue, and whether volume increases enough to offset lower margin.
Profit forecasting Use sales volume, fixed costs, variable costs, refunds, taxes, and cash-flow timing.
Inventory business decisions Include inventory holding cost, shrinkage, damaged goods, storage, and stockout risk.
Official accounting Use accounting records, full expense categories, and professional guidance where needed.

When You May Need More Than This Calculator

This calculator is best for quick margin math. Some business decisions need a more complete financial model.

Need Better Method or Additional Check
Net profit margin Include all operating expenses, taxes, interest, fees, and other business costs.
VAT/GST-inclusive pricing Separate tax-inclusive and tax-exclusive prices before calculating margin.
Marketplace selling margin Include platform commission, payment processing, fulfillment, returns, ads, and shipping subsidies.
Discount planning Model the sale price, reduced revenue, and whether volume increases enough to offset lower margin.
Profit forecasting Use sales volume, fixed costs, variable costs, refunds, taxes, and cash-flow timing.
Inventory business decisions Include inventory holding cost, shrinkage, damaged goods, storage, and stockout risk.
Official accounting Use accounting records, full expense categories, and professional guidance where needed.

Frequently Asked Questions

How do I calculate profit margin?

Subtract cost from revenue to find profit, then divide profit by revenue and multiply by 100. The formula is margin = profit ÷ revenue × 100.

What is the formula for profit?

The formula is profit = revenue − cost.

What is the formula for revenue from cost and margin?

The formula is revenue = cost ÷ (1 − margin ÷ 100). For example, with $80 cost and 20% margin, revenue = 80 ÷ 0.80 = $100.

What is the difference between margin and markup?

Margin is profit divided by revenue. Markup is profit divided by cost. They are related, but they are not the same percentage.

Is this a gross margin calculator or net margin calculator?

It is best treated as a gross margin or simple margin calculator. It can estimate net margin only if you manually include all relevant expenses in the cost value.

Can margin be negative?

Yes. A negative margin means cost is higher than revenue, so the sale loses money based on the values entered.

Can margin be 100%?

A 100% margin is not realistic when cost is greater than zero. A 100% margin would mean all revenue is profit and cost is zero.

Does the currency selector convert exchange rates?

No. The currency selector changes the displayed symbol only. It does not convert USD, EUR, GBP, BDT, or any other currency.

Should I include shipping and fees in cost?

Yes, if you want the margin result to reflect real profitability. Include shipping, packaging, platform fees, payment fees, labor, refunds, and other relevant costs when they apply.

Can I use this calculator for official accounting?

Use it for quick estimates only. For official accounting, tax reporting, financial statements, or pricing decisions, use full records and professional guidance when needed.

References

  1. OpenStax Principles of Financial Accounting — Gross Profit Margin Ratio
  2. Investopedia — Gross Profit Margin: Formula and What It Tells You
  3. Investopedia — Profit Margin vs. Markup
  4. Xero — What Is Profit Margin?
  5. Corporate Finance Institute — Gross Profit
  6. U.S. Chamber of Commerce — How to Calculate Small Business Profit

Related Calculators

Margin Calculator Disclaimer

This Margin Calculator provides educational and planning estimates only. It calculates cost, revenue, profit, and margin percentage from the values entered by the user using standard gross margin relationships.

The calculator does not automatically include overhead, payroll, rent, taxes, VAT/GST, shipping, packaging, inventory loss, payment fees, platform fees, advertising costs, discounts, refunds, returns, chargebacks, financing costs, depreciation, software costs, professional fees, or other operating expenses unless those amounts are manually included in the cost value.

This calculator does not provide accounting, tax, legal, investment, financial, or business advice. For official business reporting, tax filing, financial statements, investor reporting, pricing strategy, or major business decisions, review your full cost structure and consult a qualified accountant, tax professional, or financial professional when needed.

More of our calculators...

Mortgage Calculator with Taxes and Insurance

Estimate monthly mortgage payment with principal, interest, taxes, insurance, HOA, PMI, closing costs, loan amount, and amortization preview.

Amortization Calculator

Generate a loan amortization schedule with monthly payment, principal, interest, balance, payoff date, total interest, and optional extra payments.

Refinance Calculator

Compare your current mortgage with our Refinance calculator. Estimate new payment, monthly savings, closing costs, break-even time, interest, and payoff dates.

Credit Card Interest Calculator

Estimate credit card interest from APR, billing-cycle days, and average daily balance. Project monthly interest, payments, purchases, and ending balance.

Balance Transfer Calculator

Compare keeping your current credit card balance vs transferring it to a promo APR card. Estimate interest, transfer fees, savings, and payoff time.

Interest Rate Calculator

Calculate the interest rate needed to grow a present value into a future value. Supports annual, monthly, daily, and continuous compounding.

Inflation Calculator

Calculate how inflation changes money value over time. Estimate future value, today’s purchasing power, cumulative inflation, and monthly inflation schedule.

Salary calculator

Convert hourly, weekly, biweekly, semi-monthly, monthly, and annual pay. Estimate gross salary from hours per week and paid weeks per year.

PayPal Fee Calculator

Calculate PayPal fees, net received amount, and required gross payment. Enter percentage and fixed fees to estimate seller transaction costs.