Here's a pricing rule I see in a lot of small shops and side projects:

"My item costs $20, I want 30% profit, so I'll sell it for $26."

It feels right. It's wrong twice: it mixes up markup and margin, and it forgets that marketplace fees are charged on the price, not on the cost. Let's put numbers and a bit of JavaScript on it.

Markup and margin are different numbers

  • Markup is profit relative to cost: (price - cost) / cost
  • Margin is profit relative to price: (price - cost) / price

Cost $20, price $30: markup is 50%, margin is 33.3%. Same sale, two very different-looking percentages. When someone says "30% profit", ask which one they mean, because the price you need is different.

const markup = (price, cost) => (price - cost) / cost; const margin = (price, cost) => (price - cost) / price; markup(30, 20); // 0.5 margin(30, 20); // 0.333... 

Fees are a percentage of the price, so they hit margin

On almost every marketplace and payment processor, fees look like this:

fees = price * percentRate + fixedFee 

For the examples below I'll use a made-up but realistic combination: a 10% marketplace fee plus 3% + $0.30 for payment processing. Real rates differ by platform and country and change over time.

const PCT = 0.10 + 0.03; // marketplace + processing const FIXED = 0.30; const fees = (price) => price * PCT + FIXED; const profit = (price, cost) => price - cost - fees(price); 

Now the "$26" price:

profit(26, 20); // 2.32 profit(26, 20) / 26; // 0.089 -> about 9% margin 

The seller wanted 30% and got 9%. On a $26 sale that's $2.32 left over, before income tax, returns, or the one order that gets lost in the mail.

The formula that actually works

If you want a target margin m after fees, solve for price:

price - cost - (price * PCT + FIXED) = m * price price * (1 - PCT - m) = cost + FIXED price = (cost + FIXED) / (1 - PCT - m) 
function priceForMargin(cost, m) { const p = (cost + FIXED) / (1 - PCT - m); return Math.ceil(p * 100) / 100; } const p = priceForMargin(20, 0.30); // 35.62 profit(p, 20) / p; // 0.300 

$35.62, not $26. That gap is the whole bug.

Notice the denominator. If PCT + m gets close to 1, the price shoots up, and if it reaches 1, there is no price that works. With 13% fees you can't ever hit an 87% margin. That sounds obvious, but it's a useful sanity check for ad-heavy channels where the percentage stack gets large.

Discounts hurt more than they look

Run a 20% off sale on that $35.62 item:

const sale = 28.50; // 35.62 minus 20% profit(sale, 20); // ~4.50 profit(35.62, 20); // 10.69 

A 20% discount cut profit by about 58%. Your cost didn't change, and the fee only shrank a little, so almost the entire discount came out of your profit.

How deep can you go before you're selling at a loss?

function maxDiscount(price, cost) { const breakEven = (cost + FIXED) / (1 - PCT); return 1 - breakEven / price; } maxDiscount(35.62, 20); // 0.345 -> about 34% 

Anything past ~34% off loses money on every sale. Good to know before agreeing to a platform-wide promo.

Quick checklist

  • Decide whether you mean markup or margin, and write it down.
  • Put all costs into cost: materials, packaging, shipping you pay, and a share of listing or subscription fees.
  • Model fees on the price, including the fixed part. The fixed fee matters most on cheap items.
  • Calculate the price from the target margin, not by multiplying cost.
  • Before a sale or coupon, compute the break-even discount.

Without the code

If you'd rather plug in numbers, Fee Math has calculators that do this with each platform's actual fee lines: the Etsy target price calculator, the eBay profit calculator, and processor calculators for Stripe and PayPal. Each rate links to its source on the methodology page.

This post isn't financial advice, just arithmetic. But it's the arithmetic I wish more first-time sellers ran before setting their prices. Do you price by markup or by margin?