Gross margin calculator for D2C and Shopify brands
This gross margin calculator shows five numbers in one view: gross profit, gross margin, markup, the price you need for a target margin, and your net margin after ads, shipping and overheads. You never switch modes. Results show as soon as the page loads and update as you type.
It is built for online brands that pay for traffic. If your storefront prices include GST or VAT, enter them as they are and set the tax rate. The tool takes the tax out first, so your margin is based on money you actually keep. If you skip this step, a tax-inclusive price makes your margin look better than it really is.
You can work per unit (one product's price and cost) or with period totals (a month of sales and COGS). Currency chips cover ₹, $, £ and €. Rupee figures use Indian grouping, so ₹12,50,000 reads the way you expect.
How to use the gross margin calculator
- Pick your currency chip. Then decide whether you will enter one unit or a period total, and keep every field on that same basis.
- Enter your selling price or revenue. If it includes GST or VAT, enter the tax rate so the tool can remove it.
- Enter COGS: product cost, packaging and inbound freight. The hints next to the field remind you what to leave out, such as ads and rent.
- Set a target margin to see the price you would need to charge.
- Add ad spend, shipping and overheads to see net margin next to gross margin.
- Read the plain-English verdict and the formula steps. Then use Copy link or Save as PDF to share them.
Everything runs in your browser and nothing is stored. The copy link works because your inputs are saved in the URL itself.
Gross margin formula
Gross margin = (Revenue − COGS) ÷ Revenue × 100. It tells you what percentage of each sale is left after paying for the goods you sold. A product priced at ₹1,499 with ₹600 COGS has a gross margin of 60.0%. This is the standard definition used on Wikipedia's gross margin page.
Worked example in ₹ and $
- India: ₹1,499 − ₹600 = ₹899 gross profit.
- ₹899 ÷ ₹1,499 = 0.5997. Multiply by 100 to get a 60.0% gross margin.
- US: $50 − $30 = $20 gross profit.
- $20 ÷ $50 = 0.40, which is a 40% gross margin.
Use net revenue, not the sticker price
Revenue here means net revenue. That is the figure after discounts and refunds, without GST or VAT, as the Xero glossary explains. Say you list a product at ₹1,499 but sell it with a 10% coupon. Your revenue is ₹1,349.10, and your margin falls from 60.0% to 55.5%.
Gross margin can never go above 100%, because that would need COGS below zero. It can go negative. If COGS is higher than your price, you lose money on every unit before you spend anything on ads.
Gross profit formula (and a gross profit calculator)
The gross profit formula is Gross profit = Revenue − COGS. Gross profit is an amount in ₹, $ or £. Gross margin is the same result shown as a percentage of revenue. The inputs are the same. Only the unit changes.
Per unit vs per period
| View | Revenue | COGS | Gross profit | Gross margin |
|---|---|---|---|---|
| Per unit | ₹1,499 | ₹600 | ₹899 | 60.0% |
| One month | ₹12,50,000 | ₹5,00,000 | ₹7,50,000 | 60.0% |
The tool shows gross profit as an amount right next to the percentage, so it works as a gross profit calculator too. Enter period totals in the same fields when you want monthly or quarterly figures. For a period, COGS is usually opening stock plus purchases minus closing stock.
What counts as COGS for a D2C or Shopify store
COGS covers every cost needed to get a product into your warehouse, ready to sell. This is often called landed cost. Indirect costs like rent and admin are not part of COGS.
| Include in COGS | Leave out of COGS (put it in net margin) |
|---|---|
| Product or manufacturing cost | Meta and Google ad spend |
| Packaging and inserts | Outbound shipping to customers, including COD and RTO costs |
| Inbound freight to your warehouse | Payment gateway fees |
| Import duty and customs handling | Rent, salaries, Shopify apps |
Shopify's cost per item
Shopify's profit reports only count products that had a Cost per item recorded at the time of sale. Shopify's example uses the manufacturer price excluding taxes, shipping and other costs. The field is also static. If you enter only the supplier price, your Shopify margin will look higher than your true landed-cost margin. Update the field whenever supplier prices or freight rates change.
Input tax credit
If you are GST-registered and claim input tax credit, use costs excluding GST. If you cannot claim the tax back, the GST you paid on purchases is part of your cost. The same logic applies to VAT.
How to calculate gross margin when prices include GST or VAT
GST and VAT are tax you collect for the government. They are not revenue. Remove the tax before you work out margin. The correct method is to divide by (1 + rate). Do not subtract the rate as a percentage.
| Example | Correct (÷ 1 + rate) | Wrong (minus rate %) |
|---|---|---|
| UK £60 at 20% VAT | £50.00 | £48.00 |
| India ₹1,180 at 18% GST | ₹1,000.00 | ₹967.60 |
| India ₹1,299 at 5% GST | ₹1,237.14 | ₹1,234.05 |
The UK standard rate is 20%, according to GOV.UK. So the VAT inside a VAT-inclusive price is one sixth of it, not 20%.
The bigger mistake is ignoring tax completely. Take a ₹1,180 product with 18% GST and ₹400 COGS. The true margin is (₹1,000 − ₹400) ÷ ₹1,000 = 60.0%. If you treat ₹1,180 as revenue, you get 66.1%. That overstates your margin by about 6 points.
GST 2.0 and Indian D2C margins
GST 2.0 took effect on 22 September 2025. The slabs are now mainly 5% and 18%, plus 40% for sin and luxury goods, as listed by ClearTax. Hair oil, shampoo, toothpaste and soap moved from 18% to 5%. Apparel and footwear priced between ₹1,000 and ₹2,500 moved from 12% to 5%, according to BUSY. Brands that kept the same shelf price now keep more per sale. A ₹1,180 shampoo was ₹1,000 net at 18% and is ₹1,123.81 net at 5%. Check your HSN code and update the rate in the tool.
Gulf sellers should use the current VAT rate from their official tax authority. In the US, sales tax is usually added at checkout, so prices often exclude tax already. In that case, set the rate to 0.
Margin vs markup
Margin and markup start from the same gross profit but divide it by different numbers. Margin divides gross profit by the price. Markup divides it by the cost. That is why a 50% markup is only a 33.3% margin.
Margin = Markup ÷ (1 + Markup)
Markup = Margin ÷ (1 − Margin)
| Markup | Margin |
|---|---|
| 25% | 20% |
| 50% | 33.3% |
| 66.7% | 40% |
| 100% | 50% |
| 150% | 60% |
| 233% | 70% |
To convert a 40% markup to margin, divide 0.40 by 1.40. That gives 0.2857, or a 28.6% margin. Mixing the two up is a common way to underprice. Suppose you want a 40% margin but add 40% to a ₹600 cost. You charge ₹840 and get only 28.6%. The price you actually need is ₹1,000.
How to price for a target gross margin
To find a selling price from cost and a target margin, use Price = Cost ÷ (1 − target margin). A ₹600 cost at a 60% target margin gives a price of ₹1,500 before GST.
- Write the target as a decimal: 60% = 0.60.
- 1 − 0.60 = 0.40.
- ₹600 ÷ 0.40 = ₹1,500 ex-GST.
- Add GST for the shelf price: ₹1,500 × 1.05 = ₹1,575 at 5%, or ₹1,500 × 1.18 = ₹1,770 at 18%.
In dollars, a $30 cost at a 40% margin is $30 ÷ 0.60 = $50. The calculator shows this target price in the same view as your current margin, so you can see the gap at a glance.
Leave room for discounts. A ₹1,500 product sold at 20% off brings in ₹1,200. With ₹600 COGS, that is a 50% margin, not 60%. If you run sales often, set your target with the discount in mind.
Gross margin vs net margin
On gross margin vs net margin: gross margin only takes away COGS. Net margin takes away everything else too, including ad spend, shipping, payment fees and overheads. Net margin = Net profit ÷ Revenue × 100.
| Gross margin | Net margin | |
|---|---|---|
| Costs removed | COGS only | COGS, ads, shipping, fees, overheads |
| Place on the P&L | Near the top | Bottom line |
| What it tells you | Is the product priced well? | Is the business making money? |
D2C example: one month in ₹
- Revenue ₹12,50,000 − COGS ₹5,00,000 = ₹7,50,000 gross profit (60.0% gross margin).
- Other costs: ads ₹3,00,000 + shipping ₹1,20,000 + payment fees ₹25,000 + overheads ₹1,50,000 = ₹5,95,000.
- ₹7,50,000 − ₹5,95,000 = ₹1,55,000 net profit.
- ₹1,55,000 ÷ ₹12,50,000 = 12.4% net margin.
A big gap is normal. In Damodaran's January 2026 data for US listed companies, general retail shows a 33.18% gross margin but only a 5.61% net margin. Apparel shows 56.88% gross and 3.85% net.
In India, cash on delivery (COD) orders that come back as RTO (return to origin) cost you shipping both ways and bring in no revenue. Count those costs in shipping. Contribution margin sits between gross and net. It is gross profit minus per-order costs like payment fees, outbound shipping and ad cost per order, before fixed overheads. Shopify's profit reports work from cost per item, so they show gross profit, not profit after ad spend. For a full P&L, use the Net Profit Calculator.
What is a good gross margin for an e-commerce brand?
There is no single right number. A good gross margin leaves enough room to pay for ads, shipping and fees and still make a profit. Brands that rely on Meta and Google ads usually need a higher gross margin than brands that get most of their sales from organic or repeat traffic.
Gross margin and break-even ROAS
You can get break-even ROAS from your margin. Break-even ROAS = 1 ÷ the share of revenue left before ad spend. Say your gross margin is 60% and shipping plus fees take 15% of the price. That leaves 45%, so you break even at a ROAS of 1 ÷ 0.45 = 2.22. With a 35% gross margin and the same 15%, only 20% is left, so you need a ROAS of 5.0 just to break even. Check your live numbers with the ROAS Calculator.
How the verdict works
The tool sorts your result into one of four bands. Healthy means there is clear room to pay for ads and still profit. Workable means you can profit, but only if ads stay efficient. Thin means small rises in ad costs or returns can wipe out your profit. Losing money means the numbers are below zero right now.
Benchmarks, with caveats
Across about 5,994 US listed firms, the overall gross margin in January 2026 was 37.76%, and apparel was 56.88% (Damodaran). Margins vary widely by sector, so compare within your own category. These figures come from large public companies, not small online stores. Damodaran also dropped the 'Retail (Online)' category from January 2024, so check the date on any online-retail benchmark you find. We could not find a reliable public benchmark for small D2C brands. Compare against your own history and against similar sellers instead.
Every formula step, written out
The tool writes out each step with your own numbers. Here are three complete examples, one per market.
India: T-shirt, ₹1,299 including 5% GST
- Remove GST: ₹1,299 ÷ 1.05 = ₹1,237.14.
- Gross profit: ₹1,237.14 − ₹450 COGS = ₹787.14.
- Gross margin: ₹787.14 ÷ ₹1,237.14 = 63.6%.
- Markup: ₹787.14 ÷ ₹450 = 174.9%.
- Target price for a 70% margin: ₹450 ÷ 0.30 = ₹1,500 ex-GST, or ₹1,575 with GST.
- Net margin: ads ₹350 + shipping with RTO share ₹110 + fees ₹25 + overheads ₹60 = ₹545. Then ₹787.14 − ₹545 = ₹242.14, which is a 19.6% net margin.
UK: £60 including 20% VAT
- Remove VAT: £60 ÷ 1.20 = £50.
- Gross profit: £50 − £18 = £32. Gross margin: 64.0%. Markup: 177.8%.
- Target price for a 70% margin: £18 ÷ 0.30 = £60 ex-VAT, or £72 with VAT.
- Net margin: £32 − (£14 ads + £4 shipping + £1.50 fees + £2.50 overheads) = £10, which is 20.0%.
US: $50, price excludes sales tax
- Gross profit: $50 − $20 = $30. Gross margin: 60%. Markup: 150%.
- Target price for a 70% margin: $20 ÷ 0.30 = $66.67.
- Net margin: $30 − ($15 ads + $6 shipping + $1.75 fees + $3 overheads) = $4.25, which is 8.5%.
Use Copy link or Save as PDF to send these steps to your CA, accountant or agency. To track this margin every day from real orders and Meta and Google ad spend, ScaleWin does it automatically. For more tools, see all free tools or read the blog.