Build your retirement plan for free.Explore Plan Builder →

Cost of Goods Sold (COGS) Calculator

Enter your beginning inventory, purchases, and ending inventory to calculate COGS, inventory turnover, and key stock metrics for your business.
Luis GonzalezCreated by Luis GonzalezLast updated:

How to Use This Calculator

  1. 1

    Enter Beginning Inventory

    Enter the value of the inventory you had on hand at the start of the accounting period.

  2. 2

    Enter Purchases and Ending Inventory

    Use Purchases for inventory bought or produced during the period, and Ending Inventory for the value still on hand at the end.

  3. 3

    Review COGS and inventory metrics

    The calculator subtracts Ending Inventory from Beginning Inventory plus Purchases. Its Inventory Turnover result uses ending inventory as the denominator, so compare it with other turnover calculations only if they use the same method.

Example Calculation

A retailer starts the period with $50,000 of inventory, buys or produces $120,000 more, and has $30,000 left at the end.

Beginning Inventory ($)

50,000

Purchases ($)

120,000

Ending Inventory ($)

30,000

Results

Cost of Goods Sold

$140,000.00

Goods Available for Sale

$170,000.00

Inventory Turnover

4.67x

Ending Inventory Ratio

17.6%

Net Inventory Change

-$20,000.00

COGS to Opening Inventory

2.80x

Tips

A $10,000 increase in ending stock lowers calculated COGS by $10,000

Change Ending Inventory from $30,000 to $40,000 while keeping the other inputs unchanged. COGS falls from $140,000 to $130,000 because unsold goods are excluded from the period's cost of goods sold.

A $20,000 increase in Purchases raises goods available by $20,000

Change Purchases from $120,000 to $140,000 and keep Ending Inventory fixed. COGS rises to $160,000, showing how additional inventory cost affects the period result.

A different turnover denominator changes the interpretation

This calculator divides COGS by Ending Inventory. Compare that result with COGS divided by average inventory if you want the conventional average-inventory turnover measure.

What this calculator estimates

Cost of goods sold (COGS) is the value of inventory sold or used to produce sales during an accounting period. This calculator estimates COGS from opening inventory, purchases, and ending inventory; it does not determine which costs your accounting method should include.

How the calculation works

COGS = Beginning Inventory + Purchases − Ending Inventory
Goods Available for Sale = Beginning Inventory + Purchases
Inventory Turnover = COGS ÷ Ending Inventory
Ending Inventory Ratio = Ending Inventory ÷ Goods Available for Sale
Net Inventory Change = Ending Inventory − Beginning Inventory
COGS to Opening Inventory = COGS ÷ Beginning Inventory

Beginning Inventory is the value of stock at the period's start. Purchases includes inventory bought or produced during the period. Ending Inventory is the value left unsold at the period's end.

For the example, goods available for sale are $50,000 + $120,000 = $170,000. Subtract the $30,000 ending balance to get COGS of $140,000. The ending inventory ratio is $30,000 ÷ $170,000 = 17.6%, and net inventory change is $30,000 − $50,000 = −$20,000.

The calculator's turnover is $140,000 ÷ $30,000 = 4.67x. This is specifically COGS divided by ending inventory; a common alternative uses average inventory, calculated as (Beginning Inventory + Ending Inventory) ÷ 2. On the same figures, that alternative is $140,000 ÷ $40,000 = 3.50x. The ratios answer similar questions but are not interchangeable.

How inventory changes affect COGS

With goods available held constant, each additional dollar in Ending Inventory reduces COGS by one dollar. If inventory counts fall, the calculated COGS rises by the same amount.

Beginning Inventory Purchases Ending Inventory Goods Available COGS
$50,000 $120,000 $20,000 $170,000 $150,000
$50,000 $120,000 $30,000 $170,000 $140,000
$50,000 $120,000 $40,000 $170,000 $130,000

A rising COGS can reflect higher sales volume, higher purchase or production costs, or a lower ending stock balance. Compare it with sales revenue and gross profit before deciding whether costs or inventory management have worsened.

What to check before using the result

Use the same accounting period and valuation basis for all three inputs. Include only costs that belong in inventory under your accounting method; the IRS guide to inventory and COGS describes federal tax treatment. The Small Business Administration's guide to managing business finances also covers tracking income and expenses.

When to use a different calculator

Frequently Asked Questions

What is cost of goods sold?

Cost of goods sold (COGS) is the direct cost assigned to the goods a business sold during an accounting period. It generally includes inventory cost and production costs attributable to those goods, but not ordinary selling or administrative expenses.

How do I calculate cost of goods sold?

1. Add Beginning Inventory to Purchases. 2. Subtract Ending Inventory from that total. 3. The result is COGS. For example, $50,000 + $120,000 − $30,000 = $140,000.

Does COGS include rent, marketing, and office salaries?

Usually, those are operating expenses rather than COGS because they are not direct costs of the goods sold. How a business classifies production overhead depends on its accounting method; the IRS explains inventory and cost-of-goods-sold rules in Publication 334.

Is this calculator's inventory turnover the standard accounting ratio?

Not necessarily: this calculator divides COGS by Ending Inventory, while a common turnover ratio divides COGS by average inventory. The denominator matters, so compare businesses or periods only when they use a consistent method.

Why can a physical inventory count change COGS?

Ending Inventory is subtracted from goods available for sale, so a higher verified ending balance lowers calculated COGS and a lower balance raises it. Investigate count differences, damaged goods, theft, and recording errors before treating the change as a business trend.