Skip to content
Simple ecommerce economics tool

Profit Margin Calculator

Enter selling price and total cost to calculate profit per sale, profit margin, markup and the selling price needed for your target margin.

Margin and markup are different: margin compares profit with selling price, while markup compares profit with cost. This calculator shows both so you can avoid mixing them up.

Margin Inputs

⚡ Real-time update
$
$

Include whichever per-sale costs you want the margin to reflect.

%
Optional cost breakdown
Profit / Sale
$0.00
Profit Margin
0.0%
Markup
0.0%
Cost % of Revenue
0.0%
Selling Price:$0.00
Total Cost:$0.00
Target Margin:0.0%
Price Needed for Target: $0.00
Planning estimate. The result only reflects the costs you include.

Recommended seller tools

Optional tools for your next step

Choose a tool only when its workflow fits your store and its benefit can justify the cost. These links do not change your calculation.

Affiliate disclosure: ProfitCalcTools may earn a commission if you use one of these links, at no additional cost to you. How recommendations work

Quick formulas
Profit = Selling Price − Total Cost
Margin = Profit ÷ Selling Price × 100
Markup = Profit ÷ Total Cost × 100
Target price = Total Cost ÷ (1 − Target Margin)
Interactive tool

1. Measure profit margin and the selling price needed for a target

The calculator above compares selling price with the total cost assigned to one sale. Enter price and total cost to see profit dollars, profit margin, markup and cost as a percentage of revenue. You can also enter a target margin to solve for the selling price required to reach that margin. The optional cost builder lets you add product cost, shipping, advertising and fees or other costs before copying their total into the main calculation.

The result is only as complete as the cost number you enter. If total cost includes only inventory, the calculator shows a gross-style product margin. If it also includes fulfillment, marketplace or payment fees, advertising, expected returns and other variable expenses, the result is closer to contribution or order-level net margin. Keep the definition consistent when comparing products.

Mathematical formulas

2. Profit margin, markup and target-price formulas

Profit = Selling Price − Total Cost
Profit Margin (%) = Profit ÷ Selling Price × 100
Markup (%) = Profit ÷ Total Cost × 100
Cost Percentage = Total Cost ÷ Selling Price × 100
Target Selling Price = Total Cost ÷ (1 − Target Margin)

Margin and markup should not be used interchangeably. A product that costs $20 and sells for $30 generates $10 profit. Its margin is 33.3% because $10 is one-third of the selling price. Its markup is 50% because $10 is half of the $20 cost. Pricing decisions can be distorted when one metric is mistaken for the other.

Worked scenario and cost table

3. Example: pricing a product with $21 of total cost

Assume product cost is $12, fulfillment is $4, advertising averages $3 per sale and marketplace or payment fees plus packaging total $2. Total cost is $21. At a $30 selling price, profit is $9, margin is 30% and markup is about 42.9%. If you want a 40% margin while the same $21 cost remains, the target-price formula gives $35.00. That price leaves $14 profit, which is 40% of revenue.

Cost layerExampleInclude when
Product / landed cost$12.00Always for product-level profitability
Shipping / fulfillment$4.00When seller economics absorb the cost
Advertising$3.00When evaluating profit after acquisition
Fees / packaging / other$2.00When those costs are attributable to the order

Fixed monthly overhead can be handled separately or allocated per order by dividing it by expected monthly orders. Whichever approach you choose, use the same cost definition across products so margin comparisons remain meaningful. A high margin calculated before advertising is not directly comparable with a lower margin calculated after advertising.

FAQ and structured data

4. Profit margin calculator FAQ

What is net profit margin?

Net profit margin for this order model is profit divided by selling price, multiplied by 100. It depends on which costs you include in the total cost per sale.

What is the difference between margin and markup?

Margin divides profit by selling price. Markup divides profit by cost. The same sale can therefore have a 30% margin and a much higher markup percentage.

How do I calculate a selling price for a target margin?

Target price equals total cost divided by one minus the target margin expressed as a decimal. A $20 cost at a 40% target margin requires about $33.33.

Should advertising and payment fees be included in total cost?

Include every cost you want the reported margin to represent. For ecommerce order economics, that commonly includes product, fulfillment, payment or marketplace fees, advertising and expected returns.

See our calculation methodology for cost definitions and the Product Pricing Calculator for more detailed pricing scenarios.

Refund rate and profit-loss rate are different

The returns guide models a kept-order profit of $20.96 and a returned-order outcome of −$30.04. At 10% returns, expected profit is $15.86 per original order. The $5.10 reduction includes inventory recovery and added handling.

Use either the full outcome model or an equivalent expected-loss allowance. Do not deduct both. Recovered inventory value is not cash received.

Work through a returned-order example →

Original hypothetical worked example. Read the guide for all assumptions, formulas and exclusions.