Cost of Goods Sold (COGS) Calculator
Calculate Cost of Goods Sold (COGS) for any business.
Determine gross profit and gross margin from beginning inventory, purchases, and ending inventory.
What Is COGS?
Cost of Goods Sold (COGS) — also called Cost of Sales — represents the direct costs attributable to producing or purchasing the goods that a company sold during a specific period. It is the first and most important cost subtracted from revenue to determine profitability.
The COGS Formula
COGS = Beginning Inventory + Purchases During Period − Ending Inventory
This is the periodic inventory method, which calculates COGS at the end of an accounting period (month, quarter, or year).
Gross Profit and Gross Margin
Gross Profit = Revenue − COGS
Gross Margin % = (Gross Profit / Revenue) × 100
Gross margin is arguably the most important profitability metric for a product business — it shows what percentage of each sales dollar remains after covering the direct cost of goods.
Inventory Valuation Methods
The method used to value inventory affects COGS, especially when costs change over time:
- FIFO (First In, First Out): Oldest inventory is sold first. In rising cost environments, FIFO produces lower COGS and higher gross profit.
- LIFO (Last In, First Out): Newest inventory is sold first. Produces higher COGS in rising cost environments (allowed in the US, but not IFRS).
- Weighted Average Cost: Smooths out price fluctuations by averaging all unit costs. Simpler to administer.
What Is Included in COGS?
- Raw materials and components
- Direct labor (workers who make or handle the product)
- Manufacturing overhead (factory rent, utilities, equipment depreciation)
- Freight and import duties
- Packaging costs
Not included in COGS:
- Selling, General & Administrative (SG&A) expenses
- Marketing and advertising
- Executive salaries
- R&D costs
Industry Gross Margin Benchmarks
| Industry | Typical Gross Margin |
|---|---|
| Software / SaaS | 70% – 90% |
| Healthcare services | 40% – 60% |
| Manufacturing | 25% – 40% |
| Retail | 20% – 50% |
| Food service | 60% – 75% (food cost is 25–40%) |
| Grocery | 20% – 30% |
How to Reduce COGS
- Negotiate better pricing with suppliers
- Buy in larger quantities for volume discounts
- Reduce waste and scrap in production
- Outsource manufacturing to lower-cost regions
- Substitute materials without sacrificing quality
A 2% reduction in COGS on a $5M revenue business adds $100,000 directly to gross profit.