Gross margin is the percentage of revenue left after you subtract the direct cost of making or buying what you sell
Gross margin tells you how much money stays with your business after paying for the goods themselves — before you pay for rent, staff, marketing, or anything else. It is expressed as a percentage. A product that costs you $40 to make and sells for $100 has a gross margin of 60 percent. The formula is straightforward: subtract your cost of goods sold (COGS) from your revenue, divide by revenue, then multiply by 100 to get a percentage.
The reason this number matters is that it shows you the raw profitability of what you actually sell, separate from how you run the business. Two companies with identical overhead costs can have very different gross margins if one negotiates better supplier prices or manufactures more efficiently. Gross margin is also the pool from which you pay all your other expenses — if your gross margin is only 15 percent, you have less room to cover salaries, utilities, and other costs than a business with a 50 percent gross margin.
Key Takeaways
- Gross margin = (Revenue − Cost of Goods Sold) ÷ Revenue × 100, expressed as a percentage.
- Cost of goods sold includes only the direct materials and labor to make or acquire what you sell, not overhead like rent or salaries.
- A higher gross margin means more money is left to cover operating expenses, debt, and profit.
- You can improve gross margin by negotiating lower supplier prices, reducing waste in production, or raising prices without losing customers.
The formula: revenue minus cost of goods sold
Start with your total revenue — the money you brought in from selling your products or services. Then subtract your cost of goods sold (COGS). COGS includes only the direct costs of producing or acquiring what you sell: raw materials, packaging, shipping to your warehouse, and the wages of workers who directly make the product. It does not include your own salary, rent for your office, utilities, insurance, or marketing spend.
Once you have that number, divide it by your revenue and multiply by 100. The result is your gross margin percentage.
Example: You run a bakery. In one month you sell $5,000 worth of bread and pastries. Your flour, butter, eggs, yeast, and packaging cost $1,500. Your baker's hourly wage is $800 for the month. Your gross profit is $5,000 − $1,500 − $800 = $2,700. Your gross margin is ($2,700 ÷ $5,000) × 100 = 54 percent.
What counts as cost of goods sold and what does not
The most common mistake is including expenses that belong in operating costs, not COGS. This inflates your COGS and makes your gross margin look worse than it is. COGS is only the cost of the thing itself: ingredients, materials, components, direct labor to assemble or prepare it, and freight to get it into your hands. If you buy finished goods to resell, COGS is what you paid the supplier.
Operating expenses — rent, your salary, office staff, utilities, insurance, advertising, accounting, equipment that lasts more than a year — do not go into COGS. Neither does the cost of delivering the product to the customer (that is sometimes called fulfillment cost and is tracked separately). The reason for this distinction is that COGS changes with how much you sell, while many operating expenses stay the same whether you sell one unit or one thousand.
If you are unsure whether a cost belongs in COGS, ask: "Does this cost go away if I sell nothing this month?" If the answer is yes, it is probably COGS. If the answer is no, it is probably an operating expense.
Calculating gross margin for a product business versus a service business
For a product business, the calculation is straightforward because COGS is tangible: you know what materials cost and what labor went into making each unit. For a service business, COGS is trickier because there is no physical product. In a service business, COGS is the direct labor cost of delivering the service — the hours your technician, consultant, or contractor spent on the client's work, at their hourly rate or salary.
If you run a plumbing business and a job takes 5 hours of your technician's time at $30 per hour, COGS for that job is $150 (plus any parts you installed). If you charge the customer $500, your gross profit on that job is $350, and your gross margin is 70 percent. Your truck payment, insurance, and office rent do not factor into the margin on that specific job — they come out of your gross profit.
For a software or digital product business, COGS is often very low or zero once the product is built, because there is no material cost and no direct labor per unit sold. This is why software companies often have very high gross margins — 70 to 90 percent is common. The cost of building the software is an operating expense, not COGS.
How to track and improve your gross margin over time
To track gross margin, calculate it monthly or quarterly using your accounting records. Most accounting software (QuickBooks, FreshBooks, Wave) can generate a report that shows revenue and COGS automatically, so you can see your gross profit and margin without manual math. If you sell multiple products or services, calculate the margin for each one separately — you may find that some are much more profitable than others.
To improve gross margin, you have three levers: raise prices, lower COGS, or change your product mix toward higher-margin items. Raising prices works only if customers will pay it without walking away. Lowering COGS means negotiating better rates with suppliers, reducing waste in production, or finding cheaper materials without sacrificing quality. Changing your mix means selling more of the products or services that have the highest margins — if your premium product has a 70 percent margin and your budget product has a 30 percent margin, shifting sales toward the premium line improves your overall margin.
Watch out for the trap of cutting COGS by using cheaper materials or skipping steps — this can hurt your reputation and lead to returns or complaints that cost more than you saved. Small, sustainable improvements usually work better than drastic cuts.
Gross margin versus net profit margin
Gross margin and net profit margin are related but different. Gross margin is what is left after COGS. Net profit margin is what is left after you subtract all expenses — COGS, rent, salaries, utilities, taxes, everything. A business can have a healthy gross margin but a negative net profit if operating expenses are too high. Conversely, a business with a lower gross margin might still be profitable if it runs lean.
Think of gross margin as the health of your core product or service, and net profit margin as the health of your whole business. Both matter, but they tell you different things. If your gross margin is shrinking, your product itself is becoming less profitable. If your net margin is shrinking while gross margin stays the same, your operating expenses are growing too fast.
Frequently Asked Questions
What is a good gross margin?
It depends on your industry. Retail stores often run 20 to 40 percent gross margins because they buy finished goods and resell them. Restaurants typically have 60 to 70 percent gross margins on food cost alone (though labor and rent eat most of that). Software and digital products often exceed 80 percent. Compare your margin to others in your field, not to an absolute number.
Can gross margin be negative?
Yes, if you are selling products for less than they cost you to make or buy. This sometimes happens during a clearance sale or if you miscalculated your costs. A negative gross margin means you lose money on every unit sold, so it is not sustainable long-term.
Should I include shipping costs to the customer in COGS?
No. Shipping to the customer is a fulfillment or delivery cost, not COGS. COGS is only the cost to acquire or make the product. However, shipping from your supplier to you is part of COGS because it is part of getting the product into your inventory.
How do I calculate gross margin if I sell different products with different costs?
Calculate the total revenue from all products and the total COGS for all products, then use the formula once. This gives you your blended gross margin across your whole business. If you want to know the margin on each product separately, calculate revenue and COGS for that product alone.
Does gross margin include my salary?
No. Your salary as the owner is an operating expense, not COGS. COGS includes only the wages of people directly making the product. This is why a solo freelancer can have a very high gross margin — they have almost no COGS — but a low net profit if they do not charge enough to cover their own living expenses.