How to Calculate Profit Margin for Your Online Store (With Examples)

Disclosure: Some links are affiliate links. We may earn a commission at no extra cost to you.

Profit margin is the single most important number in your ecommerce business. Revenue tells you how much money flows in, but profit margin tells you how much you actually keep. Without understanding your margins, you could be selling thousands of products and still losing money.

Whether you sell on Amazon, Etsy, Shopify, or your own website, knowing how to calculate profit margin for ecommerce is essential for pricing products, managing costs, and building a sustainable business. In this guide, we break down every formula you need, walk through detailed examples, and share actionable strategies to improve your bottom line.

What is Profit Margin?

Profit margin is the percentage of revenue that remains after you subtract your costs. It measures how efficiently your business turns sales into actual profit. There are three types of profit margin every ecommerce seller should understand:

Gross Profit Margin

Gross profit margin measures the profit left after subtracting the direct cost of goods sold (COGS) from your revenue. COGS includes the cost to manufacture or purchase your product, raw materials, and direct labor. It does not include overhead expenses like rent, marketing, or software subscriptions.

Operating Profit Margin

Operating profit margin goes a step further by subtracting operating expenses from gross profit. Operating expenses include rent, utilities, salaries, marketing spend, and software costs. This metric shows how well your core business operations perform before accounting for taxes and interest.

Net Profit Margin

Net profit margin is the bottom line. It accounts for all expenses, including COGS, operating expenses, taxes, interest, and every other cost. This is the truest measure of your business profitability — the percentage of every dollar in revenue that you actually get to keep.

The Profit Margin Formula

The basic profit margin formula is straightforward:

Profit Margin (%) = ((Revenue - Costs) / Revenue) x 100

Let's apply this with a simple example. Say you sell a candle for $25.00 and it costs you $8.00 to make:

Gross Profit = $25.00 - $8.00 = $17.00
Gross Profit Margin = ($17.00 / $25.00) x 100 = 68%

That means for every candle sold, you keep 68 cents of every dollar as gross profit before operating expenses.

Here are the specific formulas for each margin type:

  • Gross Profit Margin = ((Revenue - COGS) / Revenue) x 100
  • Operating Profit Margin = ((Revenue - COGS - Operating Expenses) / Revenue) x 100
  • Net Profit Margin = ((Revenue - All Expenses) / Revenue) x 100

Don't want to do the math by hand? Use our free Profit Margin Calculator to get instant results for any product.

Gross Profit Margin vs Net Profit Margin

Understanding the difference between gross and net profit margin is critical because they answer different questions about your business.

Factor Gross Profit Margin Net Profit Margin
What it measures Production/sourcing efficiency Overall business profitability
Costs included COGS only All expenses (COGS, operations, taxes, etc.)
Best used for Pricing decisions, supplier negotiations Evaluating total business health
Typical ecommerce range 30%–70% 5%–20%

When to use gross margin: Use gross profit margin when you want to evaluate whether a specific product is priced correctly or when comparing suppliers. If your gross margin on a product is below 30%, it may be difficult to turn a net profit once you layer on advertising and fulfillment costs.

When to use net margin: Use net profit margin to assess your business as a whole. A healthy gross margin doesn't help if your advertising, returns, and subscription costs eat up all the profit. Net margin reveals the full picture.

Step-by-Step: Calculate Your Ecommerce Profit Margin

Let's walk through a realistic, detailed example using a product that sells for $39.99 on an online marketplace.

Step 1: Identify Your Selling Price

Selling price: $39.99

Step 2: List All Direct Costs (COGS)

  • Product cost (from supplier): $9.50
  • Inbound shipping (supplier to warehouse): $1.80
  • Packaging materials (box, tape, insert): $1.20

Total COGS: $12.50

Step 3: List All Operating and Selling Costs

  • Marketplace/platform fees (15%): $6.00
  • Payment processing (2.9% + $0.30): $1.46
  • Outbound shipping to customer: $4.50
  • Advertising cost per unit (PPC): $5.00
  • Customer service (allocated per unit): $0.75
  • Software/tools (allocated per unit): $0.50
  • Returns allowance (8% of price): $3.20

Total Operating Costs: $21.41

Step 4: Calculate Gross Profit Margin

Gross Profit = $39.99 - $12.50 = $27.49
Gross Profit Margin = ($27.49 / $39.99) x 100 = 68.7%

Step 5: Calculate Net Profit Margin

Total Costs = $12.50 + $21.41 = $33.91
Net Profit = $39.99 - $33.91 = $6.08
Net Profit Margin = ($6.08 / $39.99) x 100 = 15.2%

So even though the gross margin looks excellent at 68.7%, the actual net profit is just $6.08 per unit, or a 15.2% net margin. This is exactly why tracking all costs matters.

Want to run these numbers for your own products? Try our Profit Margin Calculator or, if you sell on Amazon, use the Amazon FBA Calculator to factor in FBA-specific fees.

What's a Good Profit Margin for Ecommerce?

Profit margins vary widely across product categories. Here are industry benchmarks to help you understand where you stand:

Product Category Average Gross Margin Average Net Margin
Apparel & Fashion 30%–50% 4%–13%
Beauty & Cosmetics 50%–80% 10%–25%
Electronics & Gadgets 10%–20% 2%–8%
Health & Wellness 40%–60% 8%–18%
Home & Garden 30%–50% 5%–12%
Food & Beverage 25%–40% 3%–10%
Pet Supplies 40%–60% 8%–15%
Jewelry & Accessories 50%–75% 10%–20%

Key takeaways from these benchmarks:

  • Beauty and cosmetics enjoy the highest margins because formulation costs are low relative to perceived value and strong branding.
  • Electronics have thin margins due to intense price competition, rapid obsolescence, and high return rates.
  • Apparel margins can be high for private label brands but shrink quickly with returns (often 20%–30% in fashion).
  • A net margin above 10% is generally considered healthy for ecommerce.
  • If your net margin is below 5%, you're in a danger zone — one bad month of returns or an ad cost spike could push you into losses.

Hidden Costs That Kill Your Margins

Many ecommerce sellers calculate their margins based on product cost and selling price alone. That's a recipe for unpleasant surprises. Here are the hidden costs that quietly destroy profitability:

1. Returns and Refunds

Ecommerce return rates average 15%–30% depending on category (fashion is the worst offender). When a customer returns a product, you lose the outbound shipping cost, the return shipping cost, and often the product itself if it can't be resold. Some sellers lose 5%–10% of total revenue to returns alone.

2. Packaging and Unboxing Experience

Custom boxes, branded tissue paper, thank-you cards, and stickers add up fast. A premium unboxing experience can cost $2–$5 per order. Decide whether the branding benefit justifies the margin impact.

3. Advertising and Customer Acquisition

Facebook, Google, and Amazon ad costs continue to rise year over year. Many sellers spend 15%–25% of revenue on advertising. If your cost per acquisition (CPA) is higher than your profit per order, you're paying to lose money.

4. Software Subscriptions

Shopify, email marketing tools, inventory management, accounting software, review platforms, analytics dashboards — these monthly fees add up to hundreds or thousands of dollars. At low order volumes, the per-unit cost of software can be surprisingly significant.

5. Taxes and Compliance

Sales tax collection and remittance, income taxes, import duties, and VAT compliance all eat into margins. International sellers face currency conversion fees on top of everything else. Don't forget to budget for an accountant or tax software.

6. Storage and Warehousing

Whether you use FBA, a 3PL, or your own garage, storage has a cost. Amazon's FBA storage fees spike during Q4, and long-term storage fees can destroy margins on slow-moving inventory.

7. Chargebacks and Fraud

Fraudulent orders and chargebacks cost you the product, the shipping, and often a $15–$25 chargeback fee from your payment processor. Budget 0.5%–1% of revenue for fraud-related losses.

7 Ways to Improve Your Profit Margin

1. Negotiate Better Supplier Pricing

Don't accept the first price quote. Request bulk discounts, compare multiple suppliers, and renegotiate annually. Even a 10% reduction in COGS on a $10 product adds $1 of pure profit per unit. Over thousands of units, this is transformative.

2. Raise Your Prices Strategically

Many sellers undercharge out of fear. Test small price increases ($1–$3) and monitor conversion rates. Often, a 5%–10% price increase has minimal impact on sales volume but a significant impact on margins. Use A/B testing if your platform supports it.

3. Reduce Return Rates

Better product descriptions, accurate sizing charts, high-quality photos, and video demos all reduce returns. Each avoided return saves you $10–$20 in costs. Consider adding a detailed FAQ section to your product pages addressing common reasons for returns.

4. Optimize Your Advertising Spend

Audit your ad campaigns regularly. Pause keywords and audiences with high cost-per-acquisition. Focus budget on your best-performing products and channels. Many sellers find that 80% of their profit comes from 20% of their ad spend.

5. Bundle Products to Increase Average Order Value

Bundling increases revenue per transaction while shipping costs remain roughly the same. A product that sells for $20 with $5 shipping might be bundled as two for $35 with the same $5 shipping. Your margin per order jumps significantly.

6. Cut Unnecessary Software and Subscriptions

Audit every recurring charge. Cancel tools you don't actively use. Look for free or cheaper alternatives. Consolidating from five $30/month tools to two $50/month tools saves $50/month — that's $600/year back in your pocket.

7. Switch to More Efficient Fulfillment

Compare your current fulfillment costs against alternatives. If you're self-fulfilling, a 3PL might offer better shipping rates due to volume discounts. If you use FBA, consider whether Seller Fulfilled Prime or a third-party warehouse might be cheaper for certain products. If you sell on Etsy, use our Etsy Fee Calculator to understand how platform fees affect your margins.

Using Tools to Track Your Margins

Manually calculating margins for every product across every channel is tedious and error-prone. That's where dedicated tools come in.

SellerGains Calculators

Our free calculators make it easy to understand your true profitability:

  • Profit Margin Calculator — Input your selling price and all costs to instantly see your gross and net margins. Perfect for evaluating new products before you commit to inventory.
  • Amazon FBA Calculator — Factors in FBA fees, referral fees, storage costs, and advertising to show your true Amazon profit per unit.
  • Etsy Fee Calculator — Accounts for Etsy's listing fees, transaction fees, payment processing, and Offsite Ads fees so you know exactly what you keep from each sale.

Spreadsheets and Accounting Software

For a complete picture, combine calculator tools with accounting software that tracks all expenses over time. This lets you see monthly and quarterly trends in your margins, spot cost increases early, and make data-driven decisions about which products to keep, drop, or promote.

The most profitable ecommerce sellers don't guess — they measure. Start by calculating the profit margin for your top 10 products using our Profit Margin Calculator, and you'll immediately see where your biggest opportunities (and biggest problems) are.

Frequently Asked Questions

What is the difference between profit margin and markup?

Profit margin and markup both measure profitability, but they use different bases. Markup is calculated as a percentage of cost, while profit margin is calculated as a percentage of revenue. For example, a product that costs $10 and sells for $20 has a 100% markup but a 50% profit margin. Markup will always be a higher number than margin for the same product, which is why some sellers accidentally overestimate their profitability by confusing the two.

How often should I recalculate my profit margins?

At minimum, recalculate your margins monthly. Costs fluctuate — supplier prices change, shipping rates adjust seasonally, ad costs vary, and platform fees get updated. Quarterly deep-dive reviews are also recommended where you examine margins by product, category, and sales channel. If you notice a sudden drop in profitability, investigate immediately rather than waiting for the next review cycle.

Can I have a high revenue but low profit margin?

Absolutely, and it's more common than you think. A store doing $500,000 in annual revenue with a 3% net margin earns just $15,000 in profit — less than many part-time jobs. High revenue with low margins is especially common in electronics, commodity products, and highly competitive niches where sellers compete primarily on price. Focus on margin per unit rather than total revenue as your primary metric.

Should I drop products with low profit margins?

Not necessarily. Some low-margin products serve strategic purposes: they attract customers who then buy higher-margin items, they round out your catalog, or they generate enough volume to negotiate better supplier rates. However, if a product has a low margin and low sales volume and high return rates, it's likely costing you money and should be discontinued. Use the Profit Margin Calculator to evaluate each product individually before making a decision.

Use the guide, then run the numbers.

SellerGains keeps editorial content and calculators together so you can move from reading to pricing without switching context.

Open calculators More guides