Explore / Pricing and finances / Unit economics

Unit economics · Starting Up

How do I calculate gross margin?

Checked 16 November 2026

Gross margin is revenue minus the cost of goods sold, divided by revenue, as a percentage. It is the share of each sale left after paying for what you sold, before rent, salaries and marketing.

The steps4 steps

  1. Take revenue for the period after discounts and returns, and leave GST out.

    The official page on accountingcoach.com

  2. Add up the cost of goods sold: materials, packaging, direct labour and anything else it cost to make or deliver what you sold.

  3. Subtract the cost of goods sold from revenue to get gross profit.

    The official page on accountingcoach.com

  4. Divide gross profit by revenue and show it as a percentage; in Excel, with revenue in B2 and the cost in C2, type =(B2-C2)/B2 and format the cell as a percentage.

The figuresEach with where it was read

Where it differs

  • India

    Leave GST out of both revenue and costs, since it is collected for the government and is not your income; claim the GST on purchases as input credit instead.

What goes wrong

  • Confusing margin with markup: markup divides gross profit by cost, so it is always the bigger number.

  • Putting rent, office salaries or marketing into the cost of goods sold, which understates gross margin.

  • Stopping at gross margin when shipping, payment fees and ad spend per order decide whether each sale pays; that is contribution margin.

A worked example

AccountingCoach's example: net sales of $600,000 and cost of goods sold of $320,000 give gross profit of $280,000, a gross margin of 46.7%. The markup on the same figures is $280,000 divided by $320,000, or 87.5%, and the contribution margin, after variable costs only, is 73.3%.

Go deeper5 sources

  • Gross Margin Ratio: formula and example

    Corporate Finance Institute · corporatefinanceinstitute.com · Article · 8 min read

    A clear explainer of the gross margin ratio with the formula, (Revenue minus COGS) divided by revenue, a worked income statement example and a downloadable template.

  • Contribution Margin vs. Gross Margin: What's the Difference?

    Shopify · Article · About 8 minute read

    This is the cleanest plain-language separation of the two margins we found, and it walks through both formulas with actual dollar numbers instead of jargon. It is written for operators who are not finance people, which is exactly where most early founders sit. Treat it as your starting point for getting the definitions straight before you decide which number to steer by.

  • Financial Ratio Analysis (Varsity, Fundamental Analysis)

    Karthik Rangappa, Zerodha Varsity · zerodha.com · Course · 20 min read · India

    Zerodha Varsity's chapter on profitability ratios, worked on a real Indian company's results. It defines EBITDA as operating revenue minus operating expense and walks through EBITDA margin and PAT margin.

  • What is the difference between gross margin and contribution margin?

    Harold Averkamp (AccountingCoach) · AccountingCoach · Article · 5 min read

    This is the cleanest side-by-side we found: it defines both margins in plain language and then walks the exact same $600,000 sales figure through both formulas, so you see gross margin land at 46.7% and contribution margin at 73.3% on identical numbers. The punchline is the one founders miss: gross margin strips out all product costs (fixed and variable), while contribution margin isolates only the variable costs, which is what actually tells you whether one more sale earns money. Treat it as your starting point for the vocabulary, not the last word on your own P&L.

  • Understanding the P&L Statement (Part 1)

    Karthik Rangappa, Zerodha Varsity · zerodha.com · Course · 20 min read · India

    Varsity's line-by-line reading of an Indian company's profit and loss statement: revenue, other income, expenses and how they are presented in an annual report.