SScaleWin Start free
Free tool · D2C & Shopify

Gross Margin Calculator: Margin, Markup & Target Price

Enter your selling price and product cost to get gross margin, gross profit, markup, the price for a target margin and your net margin after ads.

✓ Free · no signupBy Ajay KumarUpdated

Work out your gross margin

₹

One product's price, or total sales for a month. Use what the customer pays after discounts.

₹

Product cost, packaging and inbound freight for the same unit or period. Not ads or rent.

%

We show the selling price you need to reach it.

More: tax and net margin
%
₹

Tax: enter 18 for Indian GST or 20 for UK VAT if your price includes it. We take it out before working out margin. Other costs: use the same unit or period as above. They only affect net margin.

Gross margin

59.96%

Workable margin, but paid ads will take a big share of it.

Gross profit₹599
Markup149.75%
Price for 65% margin₹1,142.86
Net marginAdd costs in More

Formula with your numbers

Gross margin = (Revenue − COGS) ÷ Revenue × 100

See which ads still pay at this margin →

Calculated in your browser. Nothing you type is stored.

What is a gross margin calculator and how do you use it?

A gross margin calculator shows what share of each sale you keep after paying for the product itself. Enter your selling price and your cost of goods sold (COGS). Gross margin = (Revenue − COGS) ÷ Revenue × 100. Example: a $50 product that costs $30 leaves $20 gross profit, which is a 40% gross margin and a 66.7% markup.

Gross margin % = (Revenue − COGS) ÷ Revenue × 100

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

  1. Pick your currency chip. Then decide whether you will enter one unit or a period total, and keep every field on that same basis.
  2. Enter your selling price or revenue. If it includes GST or VAT, enter the tax rate so the tool can remove it.
  3. 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.
  4. Set a target margin to see the price you would need to charge.
  5. Add ad spend, shipping and overheads to see net margin next to gross margin.
  6. 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.

Gross margin % = (Revenue − COGS) ÷ Revenue × 100

Worked example in ₹ and $

  1. India: ₹1,499 − ₹600 = ₹899 gross profit.
  2. ₹899 ÷ ₹1,499 = 0.5997. Multiply by 100 to get a 60.0% gross margin.
  3. US: $50 − $30 = $20 gross profit.
  4. $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.

Gross profit = Net revenue − COGS

Per unit vs per period

ViewRevenueCOGSGross profitGross margin
Per unit₹1,499₹600₹89960.0%
One month₹12,50,000₹5,00,000₹7,50,00060.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 COGSLeave out of COGS (put it in net margin)
Product or manufacturing costMeta and Google ad spend
Packaging and insertsOutbound shipping to customers, including COD and RTO costs
Inbound freight to your warehousePayment gateway fees
Import duty and customs handlingRent, 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.

Net price = Tax-inclusive price ÷ (1 + rate)
ExampleCorrect (÷ 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.

Markup % = Gross profit ÷ COGS × 100
Margin = Markup ÷ (1 + Markup)
Markup = Margin ÷ (1 − Margin)
MarkupMargin
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.

Target price = COGS ÷ (1 − Target margin)
  1. Write the target as a decimal: 60% = 0.60.
  2. 1 − 0.60 = 0.40.
  3. ₹600 ÷ 0.40 = ₹1,500 ex-GST.
  4. 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 marginNet margin
Costs removedCOGS onlyCOGS, ads, shipping, fees, overheads
Place on the P&LNear the topBottom line
What it tells youIs the product priced well?Is the business making money?

D2C example: one month in ₹

  1. Revenue ₹12,50,000 − COGS ₹5,00,000 = ₹7,50,000 gross profit (60.0% gross margin).
  2. Other costs: ads ₹3,00,000 + shipping ₹1,20,000 + payment fees ₹25,000 + overheads ₹1,50,000 = ₹5,95,000.
  3. ₹7,50,000 − ₹5,95,000 = ₹1,55,000 net profit.
  4. ₹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

  1. Remove GST: ₹1,299 ÷ 1.05 = ₹1,237.14.
  2. Gross profit: ₹1,237.14 − ₹450 COGS = ₹787.14.
  3. Gross margin: ₹787.14 ÷ ₹1,237.14 = 63.6%.
  4. Markup: ₹787.14 ÷ ₹450 = 174.9%.
  5. Target price for a 70% margin: ₹450 ÷ 0.30 = ₹1,500 ex-GST, or ₹1,575 with GST.
  6. 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

  1. Remove VAT: £60 ÷ 1.20 = £50.
  2. Gross profit: £50 − £18 = £32. Gross margin: 64.0%. Markup: 177.8%.
  3. Target price for a 70% margin: £18 ÷ 0.30 = £60 ex-VAT, or £72 with VAT.
  4. Net margin: £32 − (£14 ads + £4 shipping + £1.50 fees + £2.50 overheads) = £10, which is 20.0%.

US: $50, price excludes sales tax

  1. Gross profit: $50 − $20 = $30. Gross margin: 60%. Markup: 150%.
  2. Target price for a 70% margin: $20 ÷ 0.30 = $66.67.
  3. 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.

Track your real margin every day

ScaleWin connects your Shopify orders with Meta and Google ad spend, so you see gross and net margin without rebuilding the sums by hand.

Try ScaleWin free →

Frequently asked questions

Is gross margin the same as gross profit?

No. Gross profit is an amount: revenue minus COGS, for example ₹899. Gross margin is that amount as a percentage of revenue, for example 60%. Both use the same inputs. Use gross profit to see how much money is left, and gross margin to compare products or months of different sizes.

Is a 50% markup the same as a 50% margin?

No. A 50% markup means you add half the cost on top. A ₹600 item then sells for ₹900, and ₹300 ÷ ₹900 is a 33.3% margin. To get a real 50% margin, you need a 100% markup, which means selling at double the cost.

Should I include GST or VAT when calculating gross margin?

No. Remove it first, because the tax belongs to the government. Divide the tax-inclusive price by 1 plus the rate. For example, ₹1,180 ÷ 1.18 = ₹1,000, or £60 ÷ 1.20 = £50. Leaving tax in can overstate your margin by several percentage points.

Do Meta and Google ad costs count as COGS?

No. Ad spend is a marketing cost, not part of the cost of the product. Leave it out of gross margin and subtract it when you work out net margin or contribution margin. For paid-ads brands, ad cost per order is often the biggest gap between gross and net margin.

Is shipping part of COGS?

Inbound freight, the cost of bringing stock to your warehouse, is part of COGS. Outbound shipping to customers, including COD charges and RTO return costs in India, is usually treated as an operating cost. Put it in the net margin fields so your gross margin stays comparable over time.

Can gross margin be negative or over 100%?

It can be negative. That happens when COGS is higher than your net price, so you lose money on every sale before any other costs. It cannot go above 100%, because that would need a COGS below zero. If you see over 100%, check your inputs.

How do I find the selling price for a 40% margin?

Divide your cost by 0.60, which is 1 minus 0.40. A $30 cost gives $50, and a ₹600 cost gives ₹1,000. That price excludes tax, so add GST or VAT on top for your shelf price. Do not just add 40% to cost, because that only gives a 28.6% margin.

Why is my Shopify gross margin different from my bank balance?

Shopify's profit reports work from the Cost per item you entered, which often excludes freight and duty. They also leave out ad spend, shipping, payment fees and overheads. Your bank balance reflects all of these, plus timing of payouts and stock purchases. Net margin is closer to what you actually keep.

Related free tools