Selling price calculator
Enter your unit cost, per-unit costs, percentage selling fees and the margin you want: the calculator finds the price at which exactly that margin is left after every cost. Fees charged as a percentage of the price are built into the formula instead of being added on top.
Example: Product cost per unit 24 · Shipping cost per unit 3.5 · Packaging and other unit costs 1 · Selling fees 12 % of price · Fee is charged on …: price including tax · Target margin 25 % · Sales tax / VAT included in the price 0 % → Selling price (before tax): 45.24. Source: OpenStax Contemporary Mathematics, 6.2 Discounts, Markups, and Sales Tax (Rice University). Updated: .
How it is calculated
How to calculate selling price from cost and margin
Margin is profit as a share of the price. If no cost depends on the price, price = total unit cost ÷ (1 − margin). A 12 cost and a 20% margin give 12 ÷ 0.8 = 15.
How to calculate a selling price
- Enter the product cost per unit plus shipping and packaging costs.
- Add selling fees in percent and what they are charged on, then your target margin and sales tax or VAT.
- Read the net and gross selling price that leaves exactly that margin.
Why percentage fees can’t simply be added on top
Commissions and payment fees are charged as a percentage of the selling price – the very number you are trying to find. Pricing first and adding the fee afterwards misses the margin. With f = fee rate and m = margin:
profit = price − cost − shipping − packaging − f × price = m × price
price = (cost + shipping + packaging) ÷ (1 − m − f)
This only works while margin plus fee rate stay below 100%.
Example with the default values
| Item | Amount |
|---|---|
| Price: 28.50 ÷ (1 − 0.25 − 0.12) | 45.24 |
| − Product cost | −24.00 |
| − Shipping and packaging | −4.50 |
| − 12% selling fee | −5.43 |
| = Profit (25% of 45.24) | 11.31 |
The naive way – 28.50 ÷ 0.75 = 38.00 – leaves 38.00 − 28.50 − 4.56 fee = 4.94, a margin of only 13% instead of 25%. The markup on product cost in the correct result is (45.24 − 24) ÷ 24 = 88.50%.
Sales tax and VAT
In the US, sales tax is charged on top of the marked price at checkout, and the rate depends on the state and locality, so it is not part of your margin: leave the tax field at 0. If you sell in a country where shelf prices include VAT, enter the VAT rate. The calculator then shows the gross price, and if a marketplace charges its fee on the price including VAT, choose that option – the fee then equals f × (1 + VAT rate) of the net price, and the formula becomes price = cost ÷ (1 − m − f × (1 + t)).
Prices and profit are rounded to the cent, so the actual margin can differ from the target by a few hundredths of a percent.
Related calculators: compare margin and markup with the margin calculator, check marketplace fees with the platform fee calculator, and find the break-even point.
Frequently asked questions
How do I calculate a selling price from cost and margin?
Divide the cost by (1 − margin). For a 40% margin on a 60 cost: 60 ÷ 0.6 = 100. Adding 40% to the cost (84) would only give a 28.57% margin.
How do I include a percentage fee in my price?
Subtract the fee rate in the denominator: price = cost ÷ (1 − margin − fee). With 28.50 cost, 25% margin and a 12% fee: 28.50 ÷ 0.63 = 45.24.
Should I include sales tax in my margin?
No. Sales tax is collected for the government and passed on, so calculate margin on the price before tax.
What is the difference between margin and markup here?
Margin is profit divided by the price, markup is the price increase over product cost divided by the cost. In the example the margin is 25%, the markup on product cost 88.50%.
What is the Excel formula for the selling price?
With cost in A2, other unit costs in B2, fee rate in C2 and margin in D2 (as percentages): =(A2+B2)/(1-D2-C2).
Sources and legal basis
As of: · Editorial policy
Related tools
- Margin calculatorMargin calculator: enter cost or price plus margin, markup or profit and get the rest – with totals by quantity and a margin table for volume price tiers.
- Break-even calculatorBreak-even point calculator for small businesses: units and sales revenue to break even from fixed costs, price and variable cost, plus a target profit.
- Selling Fee Calculator for Etsy, eBay, Amazon and ShopifyCalculate Etsy, eBay, Amazon and Shopify seller fees: commission, payment processing, payout, profit and margin per sale – with sources, as of 09/2026.
- German VAT calculatorGerman VAT calculator: add VAT to a net price or remove it from a gross price at 19%, 7% or a custom rate – rounded to the cent, with formulas.
- VAT calculator for France and SpainAdd or remove French VAT (TVA 20%, 10%, 5.5%, 2.1%) or Spanish VAT (IVA 21%, 10%, 4%) – net to gross and back, rounded to the cent, with official sources.
- Freight Class Calculator (density-based)Freight class calculator: enter the dimensions and weight of a pallet or crate to get its density in lb/ft³ and the LTL freight class on the 13-step NMFC scale.
- UK VAT Calculator: add or remove VATAdd or remove UK VAT at 20%, 5% or 0% in one step. Works from the net price, the gross price or the VAT amount, with the 1/6 VAT fraction shown.
- Marginal cost calculatorMarginal cost calculator: divide the change in total cost by the change in quantity and compare average cost at both quantities.
- Price elasticity of demand calculatorPrice elasticity of demand calculator: midpoint and point method from old and new price and quantity, with elasticity type, revenue effect.