Gross Margin Calculator
Calculate gross margin and markup from revenue and cost of goods sold — the core profitability metric for any product business.
Gross margin is the ratio, so the cost field decides everything
Gross margin is gross profit as a share of revenue: (revenue − COGS) ÷ revenue × 100. The calculator labels its headline result Profit margin; because the second field is cost of goods sold, that number is your gross margin. With the defaults, $100 of revenue and $60 of COGS give 40.00%, with $40 of gross profit and a 66.67% markup underneath.
The ratio is what makes gross margin useful. It lets you compare a month with a year, a small product line with a large one, or this quarter with last quarter, without the size of the numbers getting in the way. The figure is only as good as what you count as COGS, so the rest of this page is about that.
What belongs in cost of goods sold
COGS is the cost of producing or delivering what you sold, and nothing else. A practical test: would this cost go up if you sold one more unit or served one more customer?
- Product businesses: purchase price or materials, inbound freight, direct production labour, packaging that ships with the product.
- Software and subscriptions: hosting and infrastructure, third-party licences built into the product, customer support, payment processing.
- Agencies and consultancies: the pay of the people doing client work for the hours they bill, and subcontractors.
Rent, admin salaries, marketing and your own accounting software usually sit below gross profit as operating expenses. Two examples, run through the calculator:
| Business | Revenue | COGS | Gross margin |
|---|---|---|---|
| Software, one month: hosting $3,200 + support $4,500 + payment fees $1,300 | $40,000 | $9,000 | 77.50% |
| Agency project: delivery staff and freelancers | $18,000 | $11,700 | 35.00% |
If the software business counted only hosting as COGS, the calculator would show 92.00%. That number looks better and is less useful, because support and payment costs grow with every customer too.
Tracking gross margin from quarter to quarter
A single gross margin tells you little. The trend tells you whether pricing and costs are moving together. Run each period from its own totals:
| Quarter | Revenue | COGS | Gross profit | Gross margin |
|---|---|---|---|---|
| Q1 | $120,000 | $72,000 | $48,000 | 40.00% |
| Q2 | $135,000 | $83,700 | $51,300 | 38.00% |
| Q3 | $150,000 | $96,000 | $54,000 | 36.00% |
Revenue and gross profit both rose every quarter, so a report that shows only those lines looks fine. The margin column shows costs growing faster than prices: 4 points lost in two quarters. Typical causes are supplier increases you haven't passed on, more discounting, a shift in the mix towards cheaper products, or rising shipping costs that you count in COGS.
Gross margin, contribution margin and the markup line
Contribution margin goes one step further than gross margin. It subtracts every cost that varies with sales, including ones that usually sit below gross profit, such as sales commissions or outbound shipping. To get it here, enter all your variable costs in the cost field. Contribution margin is the figure a break-even calculation needs.
The markup line is the same profit divided by COGS instead of revenue. Use it when you set prices from supplier costs; use the margin when you compare with your accounts. A 40% gross margin and a 66.67% markup describe the same sale.
Frequently asked questions
Can gross margin be negative?+
Yes. If COGS is higher than revenue, the calculator shows a negative margin and a negative profit. It means you lose money on each sale before any overheads, which no increase in volume can fix. Raise the price or cut the unit cost first.
Is gross margin the same as gross profit?+
No. Gross profit is the amount in currency, revenue minus COGS. Gross margin is that amount divided by revenue, as a percentage. This calculator shows both: the percentage at the top and the dollar figure on the Profit line.
What gross margin should I use in an LTV calculation?+
Use the margin on recurring revenue from your own accounts, calculated with the same COGS definition every time. If you leave support or payment fees out of COGS here, your lifetime value estimate will come out higher than the cash a customer actually leaves you.
Embed this tool on your website
Free to use on blogs, school sites and intranets. Paste this code into your page's HTML; please keep the credit line.
<iframe src="https://utilityapp.lat/embed/business/gross-margin-calculator" title="Gross Margin Calculator" width="100%" height="660" style="border:0;max-width:760px" loading="lazy"></iframe> <p style="font-size:13px"><a href="https://utilityapp.lat/business/gross-margin-calculator">Gross Margin Calculator</a> by UtilityApp</p>