Work out your cost of goods sold (COGS) from your inventory and purchases. Add revenue to get gross profit, gross margin and COGS as a percentage of sales (food cost % for restaurants), and add units sold for cost per unit. You also get inventory turnover and days of inventory. Free and instant.
COGS formula
COGS = beginning inventory + purchases + other direct costs − ending inventory.
| Term | What to include |
|---|---|
| Beginning inventory | Value of stock on hand at the start of the period – last period’s ending inventory |
| Purchases | Stock, materials and parts bought during the period |
| Other direct costs | Costs of getting goods ready to sell: freight-in, direct labor, packaging |
| Ending inventory | Value of stock left unsold at the end of the period |
Leave out costs that don’t go into the product itself, such as rent, marketing, software and admin salaries. Those are operating expenses, not COGS.
COGS example
A shop starts the quarter with $20,000 of stock, buys $50,000 more, pays $5,000 in freight and packaging, and ends with $15,000 of stock. It sold 2,000 units for $120,000.
- COGS = $20,000 + $50,000 + $5,000 − $15,000 = $60,000
- Gross profit = $120,000 − $60,000 = $60,000, a gross margin of 50%
- COGS % of sales = $60,000 ÷ $120,000 = 50%
- COGS per unit = $60,000 ÷ 2,000 = $30
- Inventory turnover = $60,000 ÷ $17,500 average inventory = 3.43×, or about 106 days of stock
Once you know your cost per unit, set prices with the profit margin and markup calculator, and see what you can spend to win a customer with the marketing metrics calculator.
Frequently asked questions
How do I calculate COGS?
COGS = beginning inventory + purchases − ending inventory, plus any other direct costs such as freight-in or direct labor. For example, $20,000 + $50,000 + $5,000 − $15,000 = $60,000.
What is included in cost of goods sold?
The direct costs of the products you sold: the goods or materials, freight to get them to you, packaging and direct production labor. Rent, marketing, office salaries and software are operating expenses, not COGS.
How do I calculate ending inventory?
Ending inventory = beginning inventory + purchases − COGS. Most businesses get it from a stock count or their inventory system at the end of the period.
How do I calculate food cost percentage?
Food cost % = food COGS ÷ food sales × 100. Use opening food stock + food purchases − closing food stock for COGS, and enter your food sales as revenue. The calculator shows it as COGS % of sales.
What is the difference between COGS and operating expenses?
COGS rises and falls with how much you sell, because it is the cost of the products themselves. Operating expenses such as rent and salaries are mostly fixed. Revenue minus COGS is gross profit; subtract operating expenses to get operating profit.
Do service businesses have COGS?
Often they call it cost of revenue or cost of services: the direct labor and costs of delivering the service. You can enter those under other direct costs and leave the inventory fields empty.
More free tools: see all tools for founders and leaders.