Skip to content

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

33.33%

$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

Profit
Cost
$100.00
Gross profit
$50.00
Selling price
$150.00

Calculation

(selling price − cost) ÷ selling price × 100

Result33.33%
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

Choose the correct pricing mode
ModeEnterCalculator returns
Cost and selling priceCost and current priceGross profit, gross margin, markup, cost share, and profit status
Cost and target marginCost and desired gross-margin percentageRequired selling price, profit, and corresponding markup
Cost and target markupCost and desired markup percentageRequired selling price, profit, and corresponding margin

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.

Margin and markup for the same transaction
CostSelling priceGross profitMarginMarkup
$100$125$2520%25%
$100$150$5033.33%50%
$100$200$10050%100%

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

What the gross-profit calculation includes and excludes
IncludedNot included unless entered as cost
Direct cost for one unit or matching quantityPayroll, rent, software, advertising, and administrative overhead
Selling price and gross profitSales tax, payment-processing fees, shipping, refunds, and discounts not entered
Gross margin and markupNet margin, contribution margin, break-even volume, and tax liability
Target-price calculationsDemand, competitor prices, price elasticity, and customer willingness to pay

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
Gross profit
Gross margin
Markup on cost
Cost share of selling price
Selling price from target margin
Selling price from target markup
Markup from margin
Margin from markup

Examples

Review an existing selling price

1

Input

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

2

Input

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

3

Input

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

4

Input

Cost $80; selling price $80.

Show result

Result

Gross profit $0; margin 0%; markup 0%; status Break-even.

Measure a gross loss

5

Input

Cost $100; selling price $75.

Show result

Result

Gross loss $25; gross margin -33.33%; markup -25%.

Check a rounded target price

6

Input

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.