Trendifico
  1. Home
  2. Blog
  3. Ecommerce

Ecommerce guide

How to calculate profit margin (gross, operating and net)

60% ECOMMERCE GUIDE 60% gross margin on a $12cost, $30 price Trendifico

Key takeaways

  • Profit margin is profit divided by revenue, times 100. Gross, operating and net margin differ only in which costs you subtract.
  • A product that costs $12 and sells for $30 has a 60% gross margin.
  • In a spreadsheet, =(B2-A2)/B2 formatted as a percentage gives margin from cost in A2 and price in B2.

To calculate profit margin, subtract your costs from your revenue, divide the result by revenue, and multiply by 100. The only question is which costs you subtract. Take away just the cost of the products and you get gross margin. Take away running costs too and you get operating margin. Take away everything, including interest and tax, and you get net margin.

MarginFormulaWhat it tells you
Gross margin(Revenue − Cost of goods sold) ÷ Revenue × 100How much each sale leaves after paying for the product
Operating marginOperating profit ÷ Revenue × 100How much is left after running the business (ads, software, wages, rent)
Net marginNet profit ÷ Revenue × 100What you actually keep after every cost, interest and tax

How to calculate profit margin for one product

Start with a single unit. Say a phone stand costs you $12 and sells for $30.

  • Gross profit = $30 − $12 = $18
  • Gross margin = $18 ÷ $30 × 100 = 60%

Use the price before VAT or sales tax, and make the cost your landed cost: the supplier price plus inbound shipping, packaging and per-order fees. If shipping and fees add $4.50, the cost is $16.50 and the margin drops to 45%. Try your own numbers here:

Try it here · Profit Margin Calculator

Open full tool
Gross profit per unit
$18.00
Gross margin
60.0%
Markup
150.0%

How to calculate gross, operating and net margin for a business

Here is one month for a small online store, worked through all three margins:

LineAmountMargin
Revenue (before tax)$20,000
Cost of goods sold−$8,000
Gross profit$12,00060% gross margin
Ads, software and wages−$8,000
Operating profit$4,00020% operating margin
Interest and tax−$1,000
Net profit$3,00015% net margin

The same store can look very healthy at the gross level and thin at the net level. That's normal, and it's why you should track both. Gross margin tells you whether your pricing works. Net margin tells you whether the business works.

How to calculate profit margin percentage in Excel or Google Sheets

Put the cost in column A and the selling price in column B, then use the same formula in both Excel and Google Sheets:

  • Margin: =(B2-A2)/B2, then format the cell as a percentage
  • Profit per unit: =B2-A2
  • Markup: =(B2-A2)/A2
  • Price for a target margin in C2: =A2/(1-C2)

Copy the formulas down the column to work out margin for every product at once.

What is a good profit margin?

It depends heavily on the industry. These are average margins for listed US companies from NYU Stern professor Aswath Damodaran's January 2026 data:

IndustryGross marginNet margin
Retail (grocery and food)26.3%1.3%
Retail (general)33.2%5.6%
Retail (special lines)35.3%5.2%
Restaurants and dining32.2%9.4%
Household products51.0%11.7%
Software71.7%25.5%
All US companies37.8%9.7%

These are large companies with buying power, so treat them as context rather than targets. Small online stores usually need a higher gross margin, because shipping, ads and payment fees cost them more per order.

Common profit margin mistakes

  1. Dividing by cost instead of price. That gives markup, not margin. A 60% margin is a 150% markup. See margin vs markup.
  2. Counting VAT or sales tax as revenue. Remove the tax before you calculate.
  3. Using the supplier price as the cost. Freight, packaging and fees are part of the cost of each sale.
  4. Ignoring refunds and discounts. Use the revenue you actually keep. A 20% discount on a product with a 40% margin halves your profit per unit; check it with the discount calculator.
  5. Only tracking gross margin. A high gross margin can still lose money if ads eat it. Check your break-even ROAS before you scale ad spend.

FAQ

What is the formula for profit margin?

Profit margin = (Revenue − Costs) ÷ Revenue × 100. Use only the cost of goods for gross margin, add operating costs for operating margin, and include every cost, interest and tax for net margin.

How do I calculate a 30% profit margin?

Divide your cost by 0.7. A $35 cost needs a $50 price for a 30% margin, because $15 ÷ $50 = 30%. The markup calculator does this for any target.

Is profit margin the same as profit percentage?

Usually, yes. Most people mean profit as a percentage of revenue, which is margin. Some use "profit percentage" for profit as a share of cost, which is markup, so check which one is meant.

Can profit margin be negative?

Yes. If your costs are higher than your revenue, the margin is below zero and each sale loses money.

Sources

  1. Damodaran Online (NYU Stern): Margins by Sector (US), January 2026

Keep reading