Margin Calculator

Enter any two values. The remaining fields are computed for you.

%
%
Profit
Margin
Markup

Margin is profit as a share of revenue; markup is profit as a share of cost. They describe the same trade in two different ways.

Selling price breakdown

How to calculate profit margin

Profit margin tells you how much of every dollar of revenue you keep after covering the cost of the item you sold. To find it, subtract the cost from the revenue to get the profit, then divide the profit by the revenue and multiply by 100 to express it as a percentage.

For example, if a product costs you $40 to source and you sell it for $100, your profit is $60. Dividing $60 by $100 gives 0.60, or a 60% gross profit margin. That number is the figure analysts, investors, and small business owners use to compare the underlying economics of different products or stores side by side.

This margin calculator does the work for you: enter cost and revenue and the gross profit margin appears immediately. You can also work backwards — enter the margin you want to hit and a known cost, and the tool returns the selling price you need to charge.

Margin vs markup: what's the difference

Margin and markup are easy to confuse because they describe the same dollar amount of profit — but each divides that profit by a different base. Margin is profit divided by the selling price. Markup is profit divided by the cost.

Take a single sale: buy for $100, sell for $150. The profit is $50 either way. Markup is $50 / $100 = 50%. Margin is $50 / $150 ≈ 33.3%. Same deal, two different percentages. That gap is the source of most pricing mistakes — a 50% markup does not give you a 50% margin.

The relationship between the two is fixed: markup = margin / (1 − margin) and margin = markup / (1 + markup). Wholesalers and manufacturers usually think in markup because they start from a known cost. Retailers, finance teams, and investors usually think in margin because revenue is the headline number on the income statement. The cost margin calculator above shows both at once so you never have to convert in your head.

Profit margin formula

The standard profit margin formula is:

Profit margin (%) = ((Revenue − Cost) / Revenue) × 100

Used on a single product, this is the gross profit margin. Applied to a whole company, the same structure gives you operating margin (using operating income) or net margin (using net income). The calculator on this page focuses on the per-item gross margin, which is the most useful figure for pricing decisions and product-level profitability checks.

Gross margin formula

Gross margin is the company-wide version of the same idea:

Gross margin (%) = ((Revenue − Cost of Goods Sold) / Revenue) × 100

Here "Cost of Goods Sold" (COGS) is the direct cost of producing or buying everything you sold during the period — materials, factory labor, freight, and so on. Operating expenses such as rent, marketing, and salaries are not part of gross margin; they show up further down the income statement and reduce operating and net margin instead.

The gross profit margin calculator above produces the same number you'd get by aggregating per-item profit and revenue across all units sold, as long as you feed it your total revenue and total COGS for the period. Used that way, it doubles as a gross margin calculator for your entire product line.

How to use this calculator

Fill in any two of the four fields — cost, revenue, margin, or markup. The calculator solves for the other two plus the dollar amount of profit, and a small chart shows the split between cost and profit inside the selling price.

A few common patterns:

Whether you came looking for a markup percent calculator, a margin cost calculator, or just want to sanity-check the margin cost trade-off on a single sale, this tool covers all of it in one place. All math runs locally in your browser — your inputs are never sent to our servers.