How to Calculate Cost of Goods Sold and Gross Margin for a Small Product Business
Revenue tells you how much you sold. Gross margin tells you how much of each sale is left after paying for the product itself, before rent, ads and your time. If you sell physical products, it's the first number to get right.
The definitions
- Cost of goods sold (COGS): what the units you sold cost you. That's purchase price or materials, plus inbound shipping and direct packaging.
- Gross profit = revenue − COGS.
- Gross margin = gross profit ÷ revenue, as a percentage.
Worked example
You buy candles at $6 each including inbound freight and sell them at $18. In a month you sell 100.
| Revenue | 100 × $18 = $1,800 |
| COGS | 100 × $6 = $600 |
| Gross profit | $1,200 |
| Gross margin | $1,200 ÷ $1,800 = 66.7% |
Note it's the units sold. If you bought 300 candles that month, the other 200 are still inventory on hand, an asset, not a cost yet.
The periodic method
If you don't track cost per sale, you can work out COGS for a period from counts: COGS = beginning inventory + purchases − ending inventory, all at cost. This is why an accurate stock count at the end of each period matters.
Common mistakes
- Counting purchases as COGS. Buying a lot of stock in one month makes that month look terrible and the next ones look great.
- Leaving out inbound shipping and packaging, which makes margins look better than they are.
- Mixing in operating costs. Rent, ads and software go below gross profit, not in COGS.
- Confusing margin with markup. A $6 item sold at $18 has a 200% markup but a 66.7% margin.
Use it per product
Gross margin by product shows which items fund the business and which just keep you busy. A best seller with a thin margin may need a price increase more than another reorder.
Our Small Business Inventory Kit keeps stock on hand from an In/Out log and calculates revenue, cost of goods and gross margin, with reorder alerts, for up to 200 products. For reorder timing, see how to set a reorder point.
General information, not accounting or tax advice. Inventory accounting rules for taxes can differ, so ask a tax professional.

Small Business Inventory Kit: instant download for Excel and Google Sheets.
Get the Small Business Inventory Kit on Gumroad