How to Calculate Profit Margin for an Online Store: Formulas and Examples

Learn how to calculate profit margin for an online store, with simple formulas, worked examples, and the real costs of fees, returns and ads.

By Liam Aurther · · 9 min read

Shop owner in an apron checking numbers on a smartphone
In this guide
  1. The formula, and the difference between margin and markup
  2. The three margins you should track
  3. How to calculate profit margin for an online store, step by step
  4. How to set a price from a target margin
  5. What discounts really do to your margin
  6. What's a good profit margin?
  7. Your next step

To calculate profit margin for an online store, subtract all your costs for an order from the selling price, divide the result by the selling price, and multiply by 100. A $30 order that costs you $16.17 to fulfil leaves $13.83, so the margin is 46.1%. That's the short answer, but the number is only useful if you include every cost, and most new sellers don't.

This guide starts with one order and works up to your real profit after returns, ads and monthly bills. All the product figures are examples, so replace them with your own quotes.

The formula, and the difference between margin and markup

Here are the two formulas side by side:

  • Margin = (price - cost) ÷ price × 100
  • Markup = (price - cost) ÷ cost × 100

The top of each formula is the same. The difference is what you divide by. Margin is your profit as a share of the selling price. Markup is your profit as a share of the cost.

Take a product that costs $10 and sells for $20. You make $10 of profit. That's a 100% markup, because the profit equals your cost, but it's only a 50% margin, because the profit is half the price.

Mixing these up is an expensive mistake. If you want a 50% margin and you add 50% to your $10 cost, you'll charge $15 and make a margin of 33.3%. Here's how the two compare at a $10 cost:

MarkupSelling priceProfitMargin
25%$12.50$2.5020.0%
50%$15.00$5.0033.3%
100%$20.00$10.0050.0%
150%$25.00$15.0060.0%
200%$30.00$20.0066.7%
300%$40.00$30.0075.0%

Margin can never reach 100%, because that would mean your cost was zero. Markup has no upper limit. If a supplier or a blog says you'll get a "300% margin", they mean markup.

I'd use margin for running the business, since fees, ads and your accounts all work as a share of sales. Markup is handy only as a quick pricing shortcut.

The three margins you should track

People often say "my margin" without saying which one. For a small online store, these three cover it:

MarginIncludesWhat it tells you
Gross marginSelling price minus the cost of the goodsWhether the product itself is priced well
Contribution marginAlso subtracts shipping, payment fees, returns and adsWhether each order makes money
Net marginAlso subtracts monthly costs such as apps and your platformWhether the business makes money

The next sections build all three from one example.

How to calculate profit margin for an online store, step by step

Step 1: Find your true product cost

Your product cost isn't the supplier's unit price. It's the landed cost, which is everything you pay to get one sellable unit into your hands. Here's an example first order:

Cost for the orderAmount
200 units at $7.00$1,400
Freight$200
Import duties$80
Samples and inspection$120
Total$1,800
Landed cost per unit ($1,800 ÷ 200)$9.00

The supplier's quote was $7.00, but the true cost is $9.00, which is 29% higher. If some units arrive damaged, the cost goes up again. If 10 of those units couldn't be sold, you'd divide $1,800 by 190 and get $9.47 a unit.

Step 2: Calculate gross margin

Add the product's packaging to reach your cost of goods. With $1.00 of packaging, that's $10.00.

  • Gross profit: $30.00 - $10.00 = $20.00
  • Gross margin: $20.00 ÷ $30.00 = 66.7%

That looks excellent, but plenty of costs still sit between that number and your bank account.

Step 3: Subtract the cost of completing the order

Next, take off shipping and payment processing. As of November 2026, Stripe's standard US rate is 2.9% + $0.30 for a domestic card online. On a $30 order, that's $0.87 + $0.30 = $1.17.

ItemAmount
Selling price$30.00
Cost of goods-$10.00
Shipping you pay-$5.00
Payment processing-$1.17
Profit before returns and ads$13.83

Your total costs are $16.17, and $13.83 ÷ $30.00 gives a 46.1% margin. That's the number from the opening paragraph. For comparison, the markup on those same total costs is $13.83 ÷ $16.17 = 85.5%.

If the customer pays for shipping separately, count that money as revenue and calculate the processing fee on the full total, since the fee applies to everything charged.

Step 4: Check what your sales channel really charges

Your fees depend on where you sell, and they can move your margin by several points. Here's the same $30 order through three routes, using published US rates as of November 2026:

RouteHow it works outFee on $30Profit before returns and adsMargin
Stripe2.9% + $0.30$1.17$13.8346.1%
PayPal Checkout3.49% + $0.49$1.54$13.4644.9%
Etsy$0.20 listing, 6.5% transaction, 3% + $0.25 processing$3.30$11.7039.0%

The Etsy line is $0.20 + $1.95 + $1.15, assuming the $30 includes shipping. Etsy's transaction fee applies to shipping charges as well as the item price. It's a fair price for access to Etsy's shoppers, but you have to count it, along with Offsite Ads fees if you get a sale that way.

Marketplaces can be higher still. Amazon says most categories have referral fees of 8% to 15%, and the Professional plan costs $39.99 a month. FBA and other services are extra.

A couple of other fees can catch you out:

  • International cards. Stripe adds 1.5% for these, and another 1% if currency conversion is needed. That would add $0.45 to $0.75 to a $30 order.
  • Third-party payment providers on Shopify. If you don't use Shopify Payments, Shopify's pricing page lists an extra 2% fee on the Basic plan, 1% on Grow and 0.6% on Advanced. On a $30 order, that 2% is $0.60.

Fees change, so check the official pages before you set prices.

Step 5: Include returns

Beginners often skip this, but a return costs much more than the lost sale. Assume the customer returns the $30 item, you pay for the return label, and the product can go back on the shelf.

Cost of one returnAmount
Original shipping$5.00
Return shipping$5.00
New packaging$1.00
Processing fee you don't get back$1.17
Total loss on the order$12.17

Stripe confirms that its processing fees from the original transaction aren't returned when you refund. Check your own provider's policy.

Say 5% of your orders come back. That rate is an example, so use your own, or a cautious guess if you're new. Out of 100 orders:

  • 95 kept orders × $13.83 = $1,313.85
  • 5 returned orders × -$12.17 = -$60.85
  • Total profit: $1,253.00
  • Average per order: $1,253.00 ÷ 100 = $12.53

So a 5% return rate costs you $1.30 per order, not the $0.61 you'd get if you only counted the loss on each return. You also lose the $13.83 you would have made on the sale. If returned items can't be resold, take off your cost of goods for those units as well.

Step 6: Include marketing

Now take off what you spend to win the order. Use your average ad spend per order across all orders, which is total monthly ad spend divided by total monthly orders. In this example, it's $6.00.

  • Contribution profit: $12.53 - $6.00 = $6.53
  • Contribution margin: $6.53 ÷ $30.00 = 21.8%

This is the most useful number on the page. The product that looked like it had a 66.7% margin actually keeps 21.8% of each order. That's fine, as long as you know it.

It also gives you your ad limit. You can spend up to $12.53 per order before you lose money. Expressed as return on ad spend, that's $30.00 ÷ $12.53 = 2.39, which means you need about $2.39 in sales for every $1 of ads just to break even.

Step 7: Divide your monthly costs by your orders

Finally, include what you pay whether or not anyone orders. Say you spend $60 a month: $39 for Shopify Basic billed monthly (the US price as of November 2026; it varies by location), plus $21 for apps and email software as an example. How much that hurts depends on your order volume:

Orders per monthMonthly costs per orderNet profit per orderNet margin
10$6.00$0.531.8%
20$3.00$3.5311.8%
50$1.20$5.3317.8%
100$0.60$5.9319.8%

To break even, divide your monthly costs by your contribution profit: $60 ÷ $6.53 = 9.19, so you need 10 orders a month. Your own time isn't included here, and it should be. If you're still planning, our breakdown of what it costs to start an online store will help you estimate these monthly costs.

How to set a price from a target margin

You can also work backwards from the margin you want. Ignoring percentage fees, the formula is:

Price = cost ÷ (1 - target margin)

So a $10 cost with a 60% target gives $10 ÷ 0.40 = $25.

To include payment fees, use this version:

Price = (costs + fixed fee) ÷ (1 - percentage fee - target margin)

Say your costs are $15 ($10 cost of goods plus $5 shipping), and you want a 40% margin before returns and ads, using 2.9% + $0.30:

  • Top: $15.00 + $0.30 = $15.30
  • Bottom: 1 - 0.029 - 0.40 = 0.571
  • Price: $15.30 ÷ 0.571 = $26.80

I'd round that to $27. At that price, the fee is $1.08 and you keep $10.92, which is a 40.4% margin. Then compare it with what competitors charge. A formula gives you the lowest price you can live with, but the market decides whether anyone pays it.

What discounts really do to your margin

A discount comes straight off your profit, which makes it far more costly than it looks. Take 20% off the $30 product:

Full price20% off
Selling price$30.00$24.00
Cost of goods and shipping$15.00$15.00
Payment processing$1.17$1.00
Profit before returns and ads$13.83$8.00
Margin46.1%33.3%

A 20% discount cuts profit per order by about 42%. To earn the same total, you'd need about 73% more orders ($13.83 ÷ $8.00 = 1.73). Before running a sale, ask whether it'll really bring that many extra orders. Offers that don't cut your price, such as a bundle or free gift, are often a better choice.

What's a good profit margin?

There's no single right number, and I'd be wary of anyone who gives you one without knowing your category, sales channel and ad costs. Use your own numbers to answer two practical questions instead:

  1. Does each order leave enough to pay for winning it?
  2. Does the monthly total pay your bills and your time?

As a personal rule, I'd want at least 40% left after product, shipping and payment fees before relying on paid ads. Below that, a small rise in ad costs or returns can wipe out the profit. If you sell through search or email rather than ads, you can live with less. That's a big reason to invest early in SEO and email marketing.

If your margin is too low, here's where I'd look, in order:

  1. Raise the price. It costs nothing and goes straight to profit.
  2. Bundle items. A larger order often ships for little more than a single item.
  3. Reduce returns. Better photos and sizing information are cheap fixes.
  4. Negotiate with suppliers. This works better once you can place repeat orders.

Your next step

Put one product into a spreadsheet with a line for each cost above: landed cost, packaging, shipping, payment fee, returns, ads and a share of monthly costs. Do it with real quotes, then see what's left.

If the numbers look thin, go back to how to find products to sell online for other ideas. If they look good, how to validate a product idea will show you how to test the demand before you commit your money.

Keep reading