boringperformanceTHE ECOMMERCE MATHS DESK
← ALL CALCULATORS

06 Nov 2026 / BORING COMMERCE PERFORMANCE TEAM

Profit margin calculator for ecommerce

To calculate margin, divide profit by net revenue and multiply by 100. The formula for percentage profit uses cost as the denominator: profit ÷ cost × 100.

04 / PROFIT MARGINWORKED EXAMPLE
Enter your figures
Margin after entered costs20.00%

₹200.00 remaining per order

Match costs to net revenue, excluding GST. Include all expenses to model net margin; enter only product cost to model gross margin.

Calculated in your browser. Inputs are not sent or saved.

To calculate margin, use (net revenue minus costs) ÷ net revenue × 100. The formula for percentage profit on cost is (selling price minus cost) ÷ cost × 100. Margin measures the share of revenue left over; profit percentage measures the return on cost.

Worked example: a ₹1,000 order with ₹800 of costs leaves ₹200. Its margin is ₹200 ÷ ₹1,000 × 100 = 20%. Its profit percentage on cost is ₹200 ÷ ₹800 × 100 = 25%. The calculator above shows margin and the rupees remaining.

How to use the profit margin calculator

Enter revenue after discounts and refunds, on a consistent tax-exclusive basis. For an order-level calculation, enter net revenue per order and costs per order. For a period calculation, enter period revenue and period costs. The arithmetic is the same, but do not mix the two bases.

The calculator subtracts cost from revenue, shows the rupee remainder and divides it by revenue. A positive result means revenue exceeds the selected costs. A negative result means the selected costs exceed revenue. Keep the negative result visible when reviewing a loss-making offer.

Shopify's profit margin calculator uses the selling-price denominator to explain margin. Its contribution and gross margin guide distinguishes the cost scopes. Our method keeps the scope explicit because an ecommerce team may need several margin rows from the same order.

Keep the supporting cost sheet even if only one total enters the tool. The result is easy to reproduce when the reviewer can see which invoices and allocations created that total.

Worked example: where a ₹1,000 sale goes

The example store earns ₹1,000 from an order after discounts, excluding GST. The following cost sheet shows how different margin views emerge:

LineCostRevenue remaining
Net order revenue₹1,000
Product cost₹400₹600
Packaging₹30₹570
Outbound shipping₹80₹490
Payment and collection fees₹20₹470
Allocated failed-delivery and return costs₹70₹400
Advertising cost allocated to this order₹150₹250
Allocated overhead₹50₹200

The product-only view leaves ₹600, or 60% of revenue. Pre-ad contribution is ₹400, or 40%. After advertising, contribution is ₹250, or 25%. After the included overhead, ₹200 remains, or 20%.

Enter ₹1,000 and ₹800 in the calculator to reproduce the final row. Enter ₹1,000 and ₹600 to inspect contribution before ads. The output changes because the costs included change, even though the selling price is identical.

The final 20% is the margin after all costs entered in this sheet. Reconcile overhead and other period expenses with your accounts before using the result to set a profit target.

Gross margin versus contribution versus net margin

Gross margin compares revenue with cost of goods sold. It helps assess the economics of making or buying the product. Use the COGS definition agreed in your accounts, since production-related cost allocations can affect that figure.

Contribution compares revenue with the variable expenses associated with sales. For an advertising decision, keep a distinct contribution-before-ads row. It shows the money available for acquisition, overhead and profit before the campaign takes its share.

A final net margin view needs the whole expense picture. Allocate recurring overhead across a period rather than attaching arbitrary numbers to a favourite SKU. If finance already produces a monthly profit statement, reconcile the order worksheet back to it.

These views answer different operating questions. A buyer negotiating product cost may focus on gross margin. A marketer deciding acquisition spend needs pre-ad contribution. The owner assessing business profit needs the complete period result.

Use the break-even ROAS calculator after assembling pre-ad contribution. Including advertising in that particular margin and then solving again for advertising would reduce the allowance twice.

Formula for percentage profit versus margin

Shopify's markup versus margin guide distinguishes the two denominators. Profit percentage on cost uses the same denominator as markup: cost. Margin uses revenue. Start with profit = selling price minus cost, then choose the denominator the question requires. A cost of zero leaves profit percentage undefined; revenue must be positive to calculate margin.

Use the worked order's ₹600 pre-ad cost total and ₹1,000 net revenue. The remainder is ₹400. Margin is ₹400 ÷ ₹1,000 × 100 = 40%. Markup on that cost base is ₹400 ÷ ₹600 × 100 = 66.67%.

Write the cost base beside each percentage. Use the markup calculator to turn landed cost and a chosen markup into a selling price. Use this margin calculator to check how much of the resulting revenue remains after the costs you include.

To find price from a desired margin, divide cost by one minus the desired margin as a decimal. With ₹600 cost and a desired 40% margin, price is ₹600 ÷ 0.60 = ₹1,000. Multiplying ₹600 by 1.40 gives ₹840, which applies a 40% markup rather than a 40% margin.

Update payment fees and commissions at the new price before approving it. Percentage-based charges change with revenue, so include their revised rupee amount in the cost sheet.

How discounts affect profit margin

A discount reduces realised revenue. Product and delivery costs may stay unchanged. Recalculate from the discounted net revenue rather than subtracting the discount percentage from the previous margin percentage.

In the worked order, reduce revenue from ₹1,000 to ₹900 and hold the included ₹800 cost fixed. The remainder falls from ₹200 to ₹100. Margin becomes ₹100 ÷ ₹900 × 100 = 11.11%. A 10% reduction in revenue has halved the rupee remainder in this setup.

Before approving an offer, write its own cost row. Update percentage-based fees and any changes in delivery or handling. A bundle may change product mix and weight, while free shipping can change both conversion and the cost carried by the store.

Use the actual price realised after discounts. A product-page list price is not the revenue available to pay bills when customers routinely buy below it. Reconcile discount reporting once, then keep the same definition in the calculator and campaign target.

Shipping, returns and GST in the cost sheet

Match delivery costs to the sales they support. If a month includes failed deliveries that earn no revenue, the cost still belongs somewhere in the period result. Allocating those costs across retained orders can make an order model useful, provided the total reconciles to the bills.

For returns, remove refunded sales from revenue and include the costs left behind. Do not subtract the refund again as a cost after removing it from revenue. Consider whether the product was recovered, damaged or written off rather than treating every returned item as the same loss.

Use tax-exclusive revenue and a matching expense basis. Have your accountant confirm recoverable tax treatment, then use that basis consistently across the cost sheet.

Keep customer-paid delivery charges consistent too. If they are included in net revenue, include the corresponding fulfilment expense. If the analysis uses merchandise-only revenue, identify how delivery collections and freight are being reconciled before comparing its margin with the business accounts.

How to compare margins across products

Calculate each product or basket using the same cost scope. A gross margin for one SKU and an after-ad margin for another are not comparable, even if both appear as percentages on a dashboard.

For the whole store, sum revenue and costs first. Divide the combined remainder by combined revenue. Do not average SKU margin percentages without weighting by their revenue. A low-volume accessory should not carry the same influence as the store's main revenue line.

Separate a cost improvement from a mix change. The store's aggregate margin can improve because more customers bought its higher-contribution products even if no supplier price changed. Keep revenue and cost totals beside the percentage so that movement can be explained.

Finally, test the next budget or offer against current costs. The ROAS calculator shows the revenue ratio ads report; this worksheet establishes how much of that revenue is available to fund the spend. Update landed costs, realised prices and return expenses before carrying an old target into a new selling period.

Questions at the desk

What is the formula for percentage profit?

Profit percentage on cost equals (selling price minus cost) divided by cost times 100. With the worked example's ₹1,000 revenue and ₹800 cost it is 25%. Margin uses revenue as the denominator and is 20%.

How do I calculate margin?

Subtract costs from net revenue then divide by net revenue and multiply by 100. The worked example leaves ₹200 from ₹1,000 revenue giving a 20% margin.

How is a gross profit margin calculator different?

Gross margin subtracts cost of goods sold from revenue and divides by revenue. Keep advertising and other operating expenses in separate rows.

Can I use this as a net profit margin calculator?

Yes. Include all expenses matched to the same sales and period. For an order estimate allocate overhead consistently and reconcile the total with the period accounts.

How does a markup calculator differ from margin?

Markup divides the amount above cost by cost. Margin divides that amount by selling price. Use the markup calculator to set price from a cost and chosen markup.

NEXT CALCULATION

Keep the working connected.

PUT YOUR NUMBERS TO WORK

A formula is a start.
Your margins set the budget.

Bring your actual costs. The Boring Commerce performance team will work through the ROAS and spend your orders can carry.