Skip to content

COGS Calculator: Cost of Goods Sold, FIFO & Inventory Turnover

Cost of goods sold from inventory and purchases, or by FIFO, LIFO and weighted average, with gross margin and inventory turnover.

Your details

Method
$

Net cost of goods bought (or produced) during the period.

$
$
$

Cost of the stock still on hand at the end of the period (physical count).

$

Gives gross profit and gross margin.

$

365 for a year, 90 for a quarter.

Results update as you type

Cost of goods sold

$200,000.00

Goods available for sale
$260,000.00
Gross profit
$120,000.00
Gross margin
37.5%
Inventory turnover
3.64 ×
Days inventory outstanding
100.4 days

Step-by-step solution
  1. Goods available: $50,000.00 + $210,000.00 + $6,000.00 − $6,000.00 = $260,000.00
  2. COGS: $260,000.00 − $60,000.00 = $200,000.00
  3. Turnover: $200,000.00 ÷ (($50,000.00 + $60,000.00) ÷ 2) = 3.64
  4. Gross margin: ($320,000.00 − $200,000.00) ÷ $320,000.00 = 37.5%

This calculator gives estimates for information only. It is not financial, tax or legal advice. Check figures with a qualified professional before making decisions.

Cost of goods sold (COGS) is what the products you sold during a period cost you: the purchase price of merchandise for a retailer, or materials, direct labour and production overhead for a manufacturer. It is the first expense on the income statement, and revenue minus COGS gives gross profit.

Most small businesses work it out at period end with the inventory equation: what you had at the start, plus what you bought, minus what is left on the shelves. This calculator does exactly that, including freight-in and purchase returns or discounts, then derives the gross margin, the inventory turnover and the days inventory outstanding (how many days of sales your stock represents).

When prices change during the year, which units were "sold" matters. Switch to Purchase layers to enter each batch with its unit cost and compare COGS under FIFO, LIFO and the weighted average method side by side.

How to use this calculator

  1. Inventory totals mode: enter beginning inventory, purchases, freight-in, purchase returns and discounts, and ending inventory from your physical count, all at cost.
  2. Optionally enter net sales to see gross profit and gross margin.
  3. Set the days in period (365 for a year, 90 for a quarter) for days inventory outstanding.
  4. Purchase layers mode: list the beginning inventory and each purchase in date order with units and unit cost, enter the units sold, and pick FIFO, LIFO or weighted average. The table compares all three.
  5. Read COGS and the ratios; the steps show each calculation.

The formula

Periodic inventory equation:

Goods available=Beginning inventory+Purchases+Freight-in−Returns & discounts\text{Goods available} = \text{Beginning inventory} + \text{Purchases} + \text{Freight-in} - \text{Returns \& discounts}
COGS=Goods available−Ending inventory\text{COGS} = \text{Goods available} - \text{Ending inventory}

Gross profit and margin:

Gross margin=Net sales−COGSNet sales×100\text{Gross margin} = \frac{\text{Net sales} - \text{COGS}}{\text{Net sales}} \times 100

Inventory turnover and days inventory outstanding (DIO), with average inventory Iˉ=(Ibegin+Iend)/2\bar I = (I_{\text{begin}} + I_{\text{end}})/2:

Turnover=COGSIˉDIO=days in periodTurnover\text{Turnover} = \frac{\text{COGS}}{\bar I} \qquad \text{DIO} = \frac{\text{days in period}}{\text{Turnover}}

Some textbooks compute days' sales in inventory from ending inventory instead of the average; the two differ when stock grows or shrinks during the year.

Worked example

A hardware store starts the year with inventory of $50,000, buys goods for $210,000, pays $6,000 of freight-in and receives $6,000 of returns and early-payment discounts. The year-end count values the shelves at $60,000. Net sales were $320,000.

  • Goods available: 50,000 + 210,000 + 6,000 − 6,000 = $260,000
  • COGS: 260,000 − 60,000 = $200,000
  • Gross profit: 320,000 − 200,000 = $120,000, a gross margin of 37.5%
  • Turnover: 200,000 ÷ 55,000 = 3.64, so stock is held about 100.4 days

With purchase layers of 200 units at $10, 300 at $12 and 250 at $13, and 500 units sold, COGS is $5,600 under FIFO, $6,250 under LIFO and $5,900 at the weighted average cost of $11.8.

FIFO, LIFO and weighted average compared

The three methods share the same goods available for sale; they only split it differently between COGS and ending inventory. In the example above ($8,850 available):

Method COGS Ending inventory
FIFO (oldest units sold first) 5,600 3,250
LIFO (newest units sold first) 6,250 2,600
Weighted average 5,900 2,950

When prices rise, FIFO gives the lowest COGS and highest profit, with a balance sheet close to current prices; LIFO does the opposite and lowers taxable income in the US. IAS 2 allows FIFO, weighted average and specific identification but not LIFO, so LIFO is only found under US GAAP. This calculator uses the periodic system; a perpetual system recalculates the average after every purchase and can give slightly different figures.

Inventory turnover and days inventory outstanding

Turnover tells you how many times the average stock was sold and replaced during the period. A grocery store may turn its inventory 15 to 20 times a year; a jeweller once or twice. Days inventory outstanding converts the same idea into days: a lower figure means less cash tied up in stock, but too low can mean stock-outs. Track the trend and compare with businesses in the same trade.

What goes into COGS, and what does not

Include the purchase price, import duties, freight-in and, for manufacturers, raw materials, direct labour and production overhead. Exclude selling costs (shipping to customers, sales commissions), administrative expenses and abnormal waste: IAS 2 says these are expensed when incurred, not added to inventory. Service businesses with no stock usually report a "cost of revenue" or "cost of services" instead.

Frequently asked questions

How do you calculate cost of goods sold?

Add purchases (plus freight-in, minus returns and discounts) to beginning inventory to get goods available for sale, then subtract ending inventory.

Is COGS the same as operating expenses?

No. COGS covers only the cost of the goods sold. Rent of the head office, marketing and salaries of non-production staff are operating expenses, deducted after gross profit.

Which inventory method should I use?

Under IFRS, FIFO or weighted average for interchangeable items and specific identification for unique ones. US companies may also use LIFO. Whatever you choose, apply it consistently from year to year.

What is a good inventory turnover?

It depends on the sector: fast-moving food and consumer goods turn far more often than furniture or machinery. Compare with peers and with your own past years rather than with a single benchmark.

Can COGS be negative?

No. If ending inventory exceeds goods available for sale, a figure is wrong: a purchase may be missing, or the inventory count may include goods not yet paid for or belonging to someone else.

Sources

Last updated:

More Finance calculators

People also use