What Is Cost of Goods Sold (COGS)?
Cost of Goods Sold (COGS) represents the direct costs of producing or purchasing the goods a business sold during an accounting period. It includes the cost of raw materials and merchandise but excludes indirect expenses like distribution, marketing, and overhead. COGS is subtracted from revenue to calculate gross profit, making it one of the most important figures on an income statement.
How to Use This Calculator
Enter three values: your beginning inventory (the value of stock at the start of the period), purchases (inventory or materials bought during the period), and ending inventory (the value of stock left at the period's end). The calculator instantly returns your COGS along with goods available for sale.
The Formula Explained
The COGS formula is: $$\text{COGS} = \text{Beginning Inventory} + \text{Purchases} - \text{Ending Inventory}$$ The logic is simple: take everything you had available to sell (opening stock plus new purchases), then subtract what's still on the shelf at the end. Whatever's missing must have been sold — that's your cost of goods sold.
Worked Example
Suppose a retailer starts the quarter with $10,000 in inventory, buys $5,000 more during the quarter, and ends with $4,000 in inventory. $$\text{COGS} = 10{,}000 + 5{,}000 - 4{,}000 = \$11{,}000$$ Goods available for sale were $15,000, of which $4,000 remained, leaving $11,000 sold.
Interpreting Your COGS Result
Cost of Goods Sold (COGS) is the direct cost of the products you sold during a period, calculated as beginning inventory + purchases − ending inventory. On its own it is just a cost figure. It becomes useful when you compare it with revenue, with prior periods, and with the inventory you carry.
Gross profit and gross margin
COGS feeds directly into gross profit and gross margin:
$$\text{Gross Profit} = \text{Revenue} - \text{COGS}$$
$$\text{Gross Margin \%} = \frac{ \text{Revenue} - \text{COGS} }{ \text{Revenue} } \times 100$$
Example: with revenue of $80,000 and COGS of 40,000 dollars, gross profit is \(80{,}000 - 40{,}000 = 40{,}000\) and gross margin is \(\frac{40{,}000}{80{,}000} \times 100 = 50\%\).
Where COGS appears on the income statement
COGS is reported near the top of the income statement, directly below revenue (net sales). Subtracting it gives gross profit. Operating expenses such as marketing, rent for offices and administrative salaries come after that line, leading to operating income and then net income.
What rising or falling COGS signals
- COGS rising in line with revenue: normal when sales volume grows; the gross margin stays roughly stable.
- COGS rising faster than revenue: gross margin is shrinking. Possible causes include higher supplier prices, freight costs, waste or shrinkage, or discounting.
- COGS falling relative to revenue: gross margin is improving, perhaps through cheaper sourcing, higher selling prices or a better product mix. It can also result from a large ending inventory (stock bought but not yet sold), a counting error or a valuation change, so check these before drawing conclusions.
Link to inventory turnover
$$\text{Inventory Turnover} = \frac{ \text{COGS} }{ \text{Average Inventory} }, \quad \text{Average Inventory} = \frac{ \text{Beginning} + \text{Ending} }{2}$$
Using the example above, average inventory is \(\frac{10{,}000 + 10{,}000}{2} = 10{,}000\), so turnover is \(\frac{40{,}000}{10{,}000} = 4\) times per period. A higher turnover generally means stock sells faster; a lower one means money is tied up in inventory for longer. What counts as a good turnover varies widely by industry.
Important caveats
Your COGS result depends on the inventory valuation method you use (FIFO, LIFO or weighted-average) and on the accuracy of your inventory counts and purchase records. Allowed methods and reporting rules differ by country and accounting standard. For example, LIFO is permitted under US GAAP but not under IFRS. This tool and article are informational only and are not financial, tax or accounting advice; consult a qualified accountant for your situation.
COGS Under Different Inventory Scenarios
All scenarios start with the same beginning inventory of $10,000. Goods available for sale = beginning inventory + purchases, and COGS = goods available for sale − ending inventory.
| Scenario | Beginning Inventory | Purchases | Goods Available for Sale | Ending Inventory | COGS |
|---|---|---|---|---|---|
| Baseline (stock level unchanged) | $10,000 | $40,000 | $50,000 | $10,000 | $40,000 |
| Higher purchases | $10,000 | $60,000 | $70,000 | $12,000 | $58,000 |
| Lower ending stock | $10,000 | $40,000 | $50,000 | $4,000 | $46,000 |
| Stock build-up (high ending inventory, low COGS) | $10,000 | $40,000 | $50,000 | $25,000 | $25,000 |
How to read this: with the same $40,000 of purchases, COGS ranges from $25,000 to $46,000 depending only on how much stock is left at period end. Building up inventory defers costs: they stay on the balance sheet as inventory rather than being expensed as COGS. That is not necessarily better, because unsold stock ties up cash and can become obsolete. Compare COGS together with sales and inventory turnover.
Key COGS Terms
- Beginning inventory
- The cost value of inventory on hand at the start of the period; it equals the prior period's ending inventory.
- Purchases
- The cost of inventory bought or produced during the period, usually including freight-in and net of returns and purchase discounts.
- Ending inventory
- The cost value of unsold inventory on hand at the end of the period, based on a physical count or perpetual records.
- Goods available for sale
- Beginning inventory plus purchases: the total cost of stock that could have been sold during the period.
- Direct costs
- Costs tied directly to producing or acquiring the goods sold, such as materials, direct labor and freight-in. These are generally included in COGS.
- Indirect costs / overhead
- Costs that support the business generally, such as office rent, administrative salaries and marketing. They are usually operating expenses rather than COGS, although manufacturers allocate production overhead to inventory cost.
- Freight-in
- Shipping and handling costs paid to bring purchased goods to your location. It is typically added to the cost of inventory. Shipping to customers (freight-out) is generally a selling expense.
- FIFO (first-in, first-out)
- Assumes the oldest inventory costs are sold first, so ending inventory reflects the most recent purchase costs.
- LIFO (last-in, first-out)
- Assumes the most recently purchased costs are sold first, so older costs remain in ending inventory. It is permitted under US GAAP but not under IFRS.
- Weighted-average cost
- Assigns each unit the average cost of all goods available for sale: total cost of goods available divided by total units available.
- Gross profit
- Revenue minus COGS; the amount left to cover operating expenses, interest and taxes.
FAQ
Does COGS include shipping or labor? Direct labor and freight-in to acquire inventory are typically included; selling and administrative costs are not.
What if COGS comes out negative? A negative result usually means ending inventory exceeds beginning inventory plus purchases — double-check your figures, as it often signals a data entry or valuation error.
How does inventory method affect COGS? FIFO, LIFO, or weighted-average methods change how inventory values are assigned, which can alter beginning and ending inventory and therefore your COGS.