Free calculator · No signup
Gross Margin Calculator
Enter your revenue and the direct cost of what you sold. See your gross profit and gross margin, and how far you are from the margin you want.
Your numbers
Sales for one period, or the price of one unit. Leave out sales tax you collect.
Direct costs of what you sold in the same period: materials, stock, packaging, delivery labor, shipping to customers.
Optional. The margin you want to reach. Must be below 100%.
Your gross margin
Gross margin
62%
You keep $0.62 of every $1 of sales to pay overheads and make a profit.
- Gross profit
- $31,000
- Cost of goods sold as % of revenue
- 38%
- Markup on cost
- 163.2%
- Revenue needed for target margin
- $63,333
- Price change needed for target
- +26.7%
Short answer
Gross margin is the share of your revenue left after paying the direct cost of what you sold. The formula is (revenue - cost of goods sold) / revenue x 100. If you sell $50,000 and the goods cost you $19,000, your gross profit is $31,000 and your gross margin is 62%.
Updated · Team Fonda
How to use the gross margin calculator
- Revenue: what customers paid you in one period, such as last month. Leave out sales tax you collect for the government. You can also enter the price of a single item to see the margin on that item.
- Cost of goods sold: the direct cost of what you sold in the same period. For products, that is the stock or materials, packaging and the labor that makes them. For a service, it is the cost of delivering it, such as subcontractors or the hours of staff who do the work. Rent, marketing and office software are not part of it.
- Target gross margin: optional. Enter the margin you want, and the calculator shows the revenue you would need at your current cost of goods sold, and the price change that implies.
If you have not launched yet, use the price you plan to charge and the costs from supplier quotes. That tells you whether the idea works on paper before you buy stock.
The gross margin formula
Formula
Gross profit = revenue - cost of goods sold. Gross margin % = gross profit / revenue x 100. Markup % = gross profit / cost of goods sold x 100. Revenue needed for a target margin = cost of goods sold / (1 - target margin % / 100).
Cost of goods sold (often shortened to COGS) is the accounting name for the direct cost of the things you sold in the period, not everything you bought. Stock still on the shelf is not counted until it sells.
The "price change needed" row assumes you sell the same number of units at the same cost each, so the extra revenue comes only from a higher price. It is (revenue needed - current revenue) / current revenue x 100. In practice, a higher price can mean fewer sales, so treat it as a starting point for a price test.
A worked example
Say you run a small coffee roasting business. Last month you sold $50,000 of coffee. Green beans, bags, labels and the wages of the person who roasts came to $19,000. You want to reach a 70% gross margin.
Scroll sideways to see the whole table.
| Step | Calculation | Result |
|---|---|---|
| Gross profit | $50,000 - $19,000 | $31,000 |
| Gross margin | $31,000 / $50,000 | 62% |
| Cost of goods sold as % of revenue | $19,000 / $50,000 | 38% |
| Markup on cost | $31,000 / $19,000 | 163.2% |
| Revenue needed for 70% margin | $19,000 / (1 - 0.70) | $63,333 |
| Price change needed | ($63,333 - $50,000) / $50,000 | +26.7% |
These are example numbers, not benchmarks. They are the values the calculator starts with.
A 26.7% price rise is large, so look at the other side too. To reach 70% at the same $50,000 of sales, cost of goods sold would need to fall to $15,000 (30% of $50,000), which is $4,000 a month less. Most businesses close a gap like this with a mix of a smaller price rise and cheaper sourcing.
What is a good gross margin?
It depends on the industry. The table shows average gross margins by industry for US companies, from the data set that NYU Stern professor Aswath Damodaran publishes, with data as of January 2026.
Scroll sideways to see the whole table.
| Industry | Firms in the data set | Gross margin |
|---|---|---|
| Software (system and application) | 309 | 71.72% |
| Apparel | 35 | 56.88% |
| Retail (general) | 23 | 33.18% |
| Restaurant and dining | 64 | 32.24% |
| Retail (grocery and food) | 15 | 26.31% |
| Food processing | 78 | 23.23% |
| Total market | 5,994 | 37.76% |
Source: Aswath Damodaran, Margins by Sector (US), data as of January 2026. A new business with small volumes can look very different, so use the figures as a rough guide to how industries differ, not as a target.
The pattern is what matters for a founder. Businesses that sell software or digital products have few direct costs per sale, so their gross margin is high. Businesses that sell physical goods or food pay for every unit, so theirs is lower and they need more volume or lower overheads to make a profit. If your plan shows a margin far above others in your industry, check that you counted every direct cost.
How to improve your gross margin
- Test a higher price. Every dollar of price goes straight to gross profit. Ask in customer interviews what buyers pay today for the problem you solve, and price against that rather than against your costs. Fonda's Validate phase has you talk to real customers before you get a go, refine or pivot Verdict, and it is free to start.
- Lower the cost per unit. Get quotes from more than one supplier, order in larger batches once demand is proven, and cut packaging that customers do not value.
- Change the mix. Promote the products or services with the highest margin. Run each one through the calculator separately to find them.
- Add higher-margin items. A digital add-on, a service plan or a subscription can lift the average margin of every order.
Gross margin is one line of the picture. The profit margin calculator adds overheads, interest and taxes to show net margin, and the contribution margin calculator shows what each sale leaves to pay fixed costs. To turn a target margin into a selling price for one item, use the markup calculator.
What the calculator leaves out
- Operating costs. Rent, marketing, software and salaries outside production are not in gross margin. A healthy gross margin can still end in a loss.
- What counts as cost of goods sold. Businesses draw the line in different places, for example with shipping or payment fees. Be consistent from month to month and ask an accountant how to treat costs for your tax return, because rules differ by country.
- Volume effects. The target figures assume your cost of goods sold stays the same and you sell the same number of units at the new price.
- Stock and timing. Gross margin uses the cost of what you sold, not what you paid for this month. Cash spent on stock still on the shelf does not show here. See cash flow.
Frequently asked questions
What is the difference between gross margin and markup?
Both use the same gross profit, but they divide it by different numbers. Gross margin divides by revenue and markup divides by cost. An item that costs $19 and sells for $50 has a 62% gross margin and a 163.2% markup. Mixing them up leads to prices that are too low.
What is the difference between gross profit and gross margin?
Gross profit is an amount of money: revenue minus cost of goods sold. Gross margin is the same thing shown as a percentage of revenue. Gross profit tells you how much you have to pay overheads. Gross margin lets you compare months, products or businesses of different sizes.
Can gross margin be negative?
Yes. It is negative when the direct cost of what you sold is higher than the revenue from it, for example after heavy discounts or a supplier price rise you did not pass on. In that case selling more makes the loss bigger, so fix the price or the cost first.
Can gross margin be 100%?
Only if the cost of goods sold is zero, which is rare. Even digital products usually carry hosting, payment fees or support costs per sale. That is why the target field accepts values below 100% only.
Related tools and guides
Add this calculator to your website
Free to use on any site. Paste this code where you want the calculator to appear, and keep the credit link.
<iframe src="https://fonda.co/embed/gross-margin-calculator" title="Gross Margin Calculator" width="100%" height="720" style="border:0;max-width:960px" loading="lazy"></iframe>
<p style="font-size:13px"><a href="https://fonda.co/tools/gross-margin-calculator">Gross Margin Calculator</a> by Fonda</p>