How to Calculate Ecommerce Profit Margin
To calculate ecommerce profit, subtract every cost of making a sale and running the business from net sales. Then divide the profit by net sales and multiply by 100 to get your profit margin.
The formula is simple. The useful part is choosing the right profit number. A 30% gross margin, a 30% contribution margin, and a 30% net margin describe three very different businesses.
This guide shows you how to calculate each one, which ecommerce costs to include, and what a 30% or 50% margin really means.
Quick Answer: Ecommerce Profit Margin Formula
Start with these two formulas:
Ecommerce profit = Net sales - All costs
Ecommerce profit margin = Ecommerce profit / Net sales x 100
Net sales means the revenue you keep after discounts and refunds. Do not count sales tax collected for a tax authority as store revenue.
"All costs" depends on the margin you are measuring:
| Margin | Formula | What it tells you |
|---|---|---|
| Gross profit margin | (Net sales - cost of goods sold) / Net sales x 100 | Whether your product price covers the direct product cost |
| Contribution margin | (Net sales - variable costs) / Net sales x 100 | What each order leaves to pay overhead and create profit |
| Net profit margin | (Net sales - all business costs) / Net sales x 100 | What the whole business actually keeps |
Some businesses classify freight, fulfilment, and payment fees differently in their accounts. Use one method consistently and do not move a cost out of the calculation just to make the margin look better.
How to Calculate Ecommerce Profit
Calculate ecommerce profit in five steps.
1. Find Net Sales
Start with gross product sales, then subtract:
- Discounts and promotional credits
- Refunds
- Returns and allowances not already included in refunds
- Sales taxes collected on behalf of a tax authority, if your sales report includes them
This gives you the sales value the business actually earned.
2. Subtract Cost of Goods Sold
Cost of goods sold, or COGS, is the direct cost of the products you sold. It can include:
- Supplier or manufacturing cost
- Raw materials and direct production labour
- Inbound freight, duties, and tariffs
- Product packaging needed to make the item ready for sale
Net sales minus COGS gives you gross profit.
3. Subtract Variable Selling Costs
Variable costs rise and fall with orders. Common ecommerce examples include:
- Outbound shipping and fulfilment
- Pick-and-pack fees
- Payment processing and marketplace fees
- Per-order packaging
- Return shipping and return processing
- Unrecovered product loss from returns
- Ad spend used to acquire the orders
- Sales commissions and creator fees tied to sales
4. Subtract Operating and Other Business Costs
Now include the remaining costs of running and financing the business:
- Payroll and contractor costs, including owner pay when it is a business expense
- Ecommerce platform and app subscriptions
- Accounting, legal, and insurance
- Warehousing, office, and utilities
- Software and equipment
- General marketing and content costs
- Interest and income taxes
After these costs, you have net profit.
5. Divide Profit by Net Sales
Choose the profit figure that matches the question you are asking, divide it by net sales, and multiply by 100.
For example, a store with $10,000 net profit and $100,000 net sales has a 10% net profit margin:
$10,000 / $100,000 x 100 = 10%
Always label the result. Writing "30% margin" without saying gross, contribution, or net can lead to a bad pricing or spending decision.
Ecommerce Profit Calculation Example
Here is a monthly example for an online store:
| Item | Amount |
|---|---|
| Gross product sales | $100,000 |
| Discounts | -$4,000 |
| Refunds | -$3,000 |
| Net sales | $93,000 |
| Cost of goods sold | -$32,000 |
| Gross profit | $61,000 |
| Shipping and fulfilment | -$10,000 |
| Payment and platform fees | -$3,000 |
| Return processing and product loss | -$2,000 |
| Ad spend tied to sales | -$17,000 |
| Contribution profit | $29,000 |
| Payroll and contractors | -$10,000 |
| Software, accounting, insurance, and overhead | -$8,000 |
| Interest and tax provision | -$1,000 |
| Net profit | $10,000 |
The same store has three correct margin figures:
- Gross profit margin: $61,000 / $93,000 = 65.6%
- Contribution margin: $29,000 / $93,000 = 31.2%
- Net profit margin: $10,000 / $93,000 = 10.8%
This is why gross margin cannot answer "Am I actually profitable?" on its own. It does not include shipping, ad spend, payment fees, returns, or operating costs.
Is a 30% Profit Margin Good for Ecommerce?
Yes, a 30% profit margin can be good for ecommerce, but the answer changes based on the type of margin.
If It Is a 30% Gross Margin
For an ecommerce store, 30% gross margin may leave little room for customer acquisition, shipping subsidies, returns, fees, and overhead. It can work for a high-volume or repeat-purchase model, but it needs careful contribution-margin tracking.
If It Is a 30% Contribution Margin
A 30% contribution margin means 30 cents from every sales dollar remains after variable order costs. That can be healthy if fixed operating costs take less than those 30 cents and enough remains for net profit and cash needs.
Check it by product and channel. A 30% store-wide average can hide one product at 50% and another that loses money.
If It Is a 30% Net Margin
Those public-company categories are context, not a target for your store. If your ecommerce net margin is 30%, make sure the calculation includes owner compensation, returns, inventory adjustments, interest, and taxes before treating it as money available to spend.
What Is a 30% Margin on $100?
A 30% margin on a $100 sale means the profit is $30 and the total cost is $70.
$30 profit / $100 selling price x 100 = 30% margin
That is not the same as a 30% markup.
| Scenario | Profit | Effective percentages |
|---|---|---|
| $70 cost sold for $100 | $30 | 30% margin, 42.9% markup |
| $70 cost with a 30% markup, sold for $91 | $21 | 23.1% margin, 30% markup |
If an item costs $100 and you want a 30% margin, divide the cost by 1 minus the target margin:
Selling price = $100 / (1 - 0.30) = $142.86
Adding 30% to the $100 cost would create a $130 selling price, but that is only a 23.1% margin.
Is a 50% Profit Margin Too Much?
No. A 50% profit margin is not automatically too much. First check which margin it is.
A 50% gross margin means half of net sales remains after COGS. That sits within the broad retail range cited above and may be necessary to pay for shipping, returns, advertising, and overhead.
A 50% net margin is uncommon for a physical-product ecommerce business, but it is not inherently a problem. It may reflect strong pricing, low acquisition costs, repeat customers, or an efficient operating model. It may also mean costs are missing from the calculation.
Before trusting a 50% net margin, check:
- Owner pay and team labour
- Inventory write-downs and damaged stock
- Returns, chargebacks, and refund processing
- Payment, marketplace, and platform fees
- Ad and creator costs
- Interest and taxes
- Costs paid personally instead of through the business
Do not lower a price only because the margin looks high. Check whether customers receive fair value, the price is competitive for the category, and the margin holds after every cost is included.
Which Ecommerce Costs Are Most Often Missed?
The formula usually fails because the inputs are incomplete. Common gaps include:
- Discounts and refunds counted as full-price revenue.
- Inbound freight and duties left out of product cost.
- Free shipping treated as free to the business.
- Payment fees and fixed transaction charges ignored.
- Ad spend divided by all orders instead of the orders or customers it acquired.
- Return processing counted, but lost product value missed.
- Monthly software and platform fees never allocated.
- Owner labour treated as having no cost.
- Inventory changes confused with cash spent on stock.
- Taxes and interest excluded from a number called net profit.
How Often Should You Calculate Ecommerce Profit Margin?
Review contribution margin weekly and net profit monthly.
A weekly product and channel view helps you catch changes in ad costs, discounts, shipping, and returns before they become a large loss. A monthly net view gives payroll, software, overhead, interest, and taxes time to settle.
Recalculate immediately when you:
- Change prices or run a discount
- Launch a new product or bundle
- Add a sales or ad channel
- Change supplier, fulfilment, or shipping rates
- See return or customer acquisition costs rise
How to Improve Ecommerce Profit Margin
Start with the part of the margin waterfall that changed:
- Weak gross margin: Review price, supplier cost, landed cost, and product mix.
- Weak contribution margin: Review shipping, fulfilment, returns, payment fees, discounts, and ad cost per order.
- Weak net margin: Review payroll, subscriptions, overhead, debt costs, and low-value work.
Do not cut every cost by the same percentage. Find the product, channel, or cost line causing the change, then protect the parts of the business that create profitable repeat sales.
Track the Margin That Matches the Decision
Use gross margin for product pricing, contribution margin for order and channel decisions, and net margin for the health of the whole business.
Nummbas connects sales, ad, payment, accounting, shipping, return, and expense data so you can see these numbers in one place. The view is only as complete as the sources and costs you connect or enter, so missing data stays visible instead of being treated as profit.
Go deeper on ecommerce profit
Use these guides to move from one margin percentage to product, channel, and store-level decisions.
Ecommerce Contribution Margin
See what each order leaves after product cost, shipping, fees, returns, and ad spend.
Shopify Profit Margin Calculator
Apply the same profit-margin math to a Shopify store with product and order examples.
Ecommerce Benchmarks 2026
Compare gross margin, net margin, ad spend, and growth metrics with the right context.
How to Read an Ecommerce P&L
Trace sales and costs through the statement that produces your final net profit.