Margin calculator Calculate

Margin calculator

Compare gross margin and markup from cost and selling price. Set a target percentage to calculate a price and see the margin it produces after rounding.

Updated 2 sources

Margin calculator

MyCalc · Calculation date 2026-12-01
https://mycalc.xyz/margin-calculator/#margin
Calculation mode
Range: 0.01–10,000,000
Range: 0.01–1,000,000,000
Inputs
Calculation modePrice and cost
Unit cost$60.00
Selling price$100.00

Results

Selling price
$100.00
Gross profit
$40.00
Gross margin
40%
Markup
66.67%

Embed

How it’s calculated
  1. Subtract cost
    G = S − C
    $100.00 − $60.00 = $40.00
  2. Divide by price
    m = G ÷ S × 100
    $40.00 ÷ $100.00 × 100 = 40%
  3. Divide by cost
    u = G ÷ C × 100
    $40.00 ÷ $60.00 × 100 = 66.67%

How to use the margin calculator

  1. Enter the direct Unit cost for the same unit you plan to sell.
  2. Use Price and cost with an existing selling price, Target margin with a margin goal, or Target markup with a cost-based uplift.
  3. Enter the selected price or percentage. Read the selling price, gross profit and both ratios together.
  4. If you sell in a currency with rounding, compare the achieved ratio to the target before committing to a price.

Gross margin and markup formulas

G=S−C,m=100GS,u=100GC,S=C1−m/100=C(1+u/100)G=S-C,\qquad m=100\frac{G}{S},\qquad u=100\frac{G}{C},\qquad S=\frac{C}{1-m/100}=C(1+u/100)

SS denotes selling price, CC is the cost, GG is gross profit, mm is gross margin and uu is markup. The two expressions for SS use different inputs. Both ratios need a positive denominator. If you want only to work out the size of a discount, use the percentage calculator.

Worked example

Check the margin on a retail sale

A retailer buys an item for 75 and lists it for 120 before tax. Compare what the profit represents as a share of the price and as a share of the cost.

Calculation mode: Price and cost · Unit cost: $75.00 · Selling price: $120.00

Selling price
$120.00
Gross profit
$45.00
Gross margin
37.5%
Markup
60%

Price a product from a target margin

Given a unit cost of 80, use the target margin mode to price an item and review the resulting gross profit.

Calculation mode: Target margin · Unit cost: $80.00 · Target margin (%): 35

Selling price
$123.08
Gross profit
$43.08
Gross margin
35%
Markup
53.85%

Selling prices by gross margin target

Each row uses the same unit cost so you can compare the selling price needed for each target and the resulting markup.

Target margin (%)Selling priceGross profitMarkup
10 $111.11$11.1111.11%
20 $125.00$25.0025%
30 $142.86$42.8642.86%
40 $166.67$66.6766.67%
50 $200.00$100.00100%

Plan a price after discounts and taxes

Start with what you actually retain from the sale after discounts and refunds. For a VAT-inclusive price, use the VAT calculator to estimate the amount before tax when comparing revenue against a net cost. Use consistent figures for cost and sale: including tax on one side can shift the ratio even when the deal stays the same.

Compare products with different selling prices

A large percentage can correspond to a small gross profit in currency when the ticket price is low. Compare both the profit per unit and how many units you expect to sell. If you are comparing categories of merchandise, total the net sales and corresponding costs before calculating the combined margin. A simple average of the product percentages gives a small seller the same weight as your best seller.

Frequently asked questions

What is the difference between margin and markup?

Both ratios use gross profit as their numerator. Margin divides by the selling price and shows how much of a sale remains after cost. Markup divides by cost and shows how much the selling price adds to that cost. Read the denominator before entering a pricing target.

How do I get the price from a target gross margin?

Divide unit cost by one minus the target margin expressed as a decimal. Dividing accounts for the fact that the target is a share of the final selling price. A markup instead multiplies the cost by one plus its decimal rate. Check the percentage after currency rounding.

Can a gross margin be negative?

Yes. If the selling price falls below unit cost, gross profit becomes negative and both ratios reflect a loss. Enter the actual figures in Price and cost mode. For a clearance sale, compare the loss with other options such as returning the item or continuing to store it.

Which costs belong in a gross margin estimate?

Use the direct cost that belongs to the item or batch you are pricing. Depending on your accounting policy, that may include inbound freight or direct production labor. Track overhead, payment processing and other operating costs separately when the goal is to compare reported gross margins.

Why did a price discount cut profit more than expected?

A discount reduces the selling price while unit cost usually stays the same. Gross profit therefore drops by the full cash value of the discount. Re-enter the discounted selling price to check the remaining margin before comparing it with the extra sales you expect from the promotion.

Method and sources

The engine keeps monetary values in minor currency units and rounds the calculated selling price half up before evaluating profit, margin and markup. It shows the achieved ratios based on the rounded sale price.

Sources

  1. SEC · Beginners’ Guide to Financial Statements
  2. OpenStax · Prealgebra 2e, 6.2 Solve General Applications of Percent

Updated

This calculation is for pricing estimates and does not replace financial or accounting advice. Verify the classification of costs with your accounting policy.

Search calculators