Free calculator · No sign-up · Sources cited
Cost of Goods Sold Calculator
Cost of goods sold (COGS) is what the things you sold cost you: beginning inventory, plus what you bought, minus what's still on the shelf. Across all US public companies it took 62.24% of sales in Damodaran's January 2026 data. Enter your inventory counts and purchases to get yours, and your gross margin with it.
COGS as a share of sales
- Cost of goods sold as a share of sales, all US companies
- 62.24%[1]
- Cost of goods sold as a share of sales, general retail
- 66.82%[1]
- Cost of goods sold as a share of sales, specialty retail
- 64.7%[1]
- Cost of goods sold as a share of sales, grocery and food retail
- 73.69%[1]
- Cost of goods sold as a share of sales, restaurants
- 67.76%[1]
COGS calculator
The formula, and why it works
You rarely know directly what the goods you sold cost, because you sell them one at a time and restock in batches. What you do know is what you started with, what you bought, and what's left. Whatever isn't left was sold (or lost, which counts too).
Goods available for sale = beginning inventory + purchases + freight in and direct costs COGS = goods available for sale − ending inventory Gross profit = sales − COGS Gross margin = gross profit ÷ salesThink of it as a bucket. Beginning inventory is what's in it, purchases pour more in, and the ending count is what's still there. The difference went out the door. Shrink (theft, damage, spoilage) ends up in COGS this way, which is correct: it's a real cost of the goods, even though nobody paid for them.
A worked example
A hardware store starts the year with $42,000 of stock at cost. During the year it buys $180,000 of goods and pays $6,000 in inbound freight. The year-end count comes to $38,000. Sales were $300,000.
- Goods available: $42,000 + $180,000 + $6,000 = $228,000
- COGS: $228,000 − $38,000 = $190,000
- Gross profit: $300,000 − $190,000 = $110,000, a 36.67% gross margin
- COGS as a share of sales: 63.33%
General retailers in Damodaran's data spend 66.82% of sales on COGS, so this store keeps a little more of each sale than the big chains do. Notice the inventory fell $4,000 over the year: the store sold some of its opening stock rather than buying all of it fresh. If it had restocked to $42,000, purchases would have been higher and COGS the same.
COGS by industry
These are 100% minus Damodaran's January 2026 gross margins for US public companies, so they include whatever each company books as cost of sales. Treat them as a sense of scale.
| Industry | COGS as % of sales |
|---|---|
| All US public companies | 62.24%[1] |
| General retail | 66.82% |
| Specialty retail | 64.7% |
| Grocery and food retail | 73.69% |
| Auto dealers and parts | 78.04% |
| Restaurants | 67.76% |
| Engineering and construction | 84.54% |
Getting the inputs right
- Count at cost, not retail. Ending inventory valued at shelf prices overstates it and makes COGS look too small.
- Use the same method every period. FIFO, average cost or another method can each be fine, but switching between periods distorts the comparison. Your accountant will tell you which one your tax return uses.
- Keep overhead out. Rent, utilities and the owner's salary belong below gross profit, in operating expenses.
Once you have COGS, the profit margin calculator takes you down to operating and net margin, and the markup calculator turns a target margin into shelf prices. To see how fast stock moves, use the inventory turnover calculator.
Frequently asked questions
What is the formula for cost of goods sold?
COGS = beginning inventory + purchases − ending inventory. Add the direct costs of getting goods ready to sell, such as freight in and, for a maker, direct labor. Everything else, like rent and office wages, is an operating expense, not COGS.
How do you calculate COGS without inventory?
If you don't carry inventory, COGS is simply what you spent on the goods or materials you sold in the period. A service business with no product may have no COGS at all, or count only the direct cost of delivering the service, such as subcontractors.
Can cost of goods sold be negative?
Not in real life. A negative result means the ending inventory count or value is wrong, purchases are missing, or the period's counts don't match. Recount before you rely on the number.
Is COGS the same as operating expenses?
No. COGS moves with sales: sell more, buy more. Operating expenses mostly don't: rent is the same whether you sell 100 items or 1,000. Keeping the two apart is what makes gross margin meaningful.
Keep running the numbers
Sources
- Margins by Sector (US) (Aswath Damodaran, NYU Stern School of Business, January 2026). Accessed 2026-11-06. US public companies grouped by industry. Small private businesses differ; use these as context, not targets.