Cost of Goods Sold Calculator

Enter your beginning inventory, purchases and ending inventory to find the cost of the goods you sold in the period.

Updated

Enter to calculate Esc to clear

Cost of Goods Sold (COGS) Calculator

Our Cost of Goods Sold Calculator works out the direct cost of the products a business sold in a period. Enter the inventory at the start of the period, the purchases made during it and the inventory left at the end, and it returns COGS along with the goods available for sale and how much of that stock was sold. It is useful for small business owners, online sellers, accountants, students and anyone preparing an income statement or a tax return.

Quick answer

Cost of goods sold is beginning inventory + purchases − ending inventory: $50,000 + $20,000 − $10,000 = $60,000.

  • Goods available for sale: beginning inventory + purchases ($70,000)
  • Gross profit: revenue − COGS ($100,000 − $60,000 = $40,000)
  • Included: materials, direct labour and the cost of stock bought for resale
  • Not included: rent, marketing, office salaries and other operating costs

What Is Cost of Goods Sold?

Cost of goods sold (COGS), also called cost of sales, is the direct cost of the products a business sold during a period. It is the first expense on the income statement and is subtracted from revenue to give gross profit.

COGS includes only costs tied directly to the goods:

  • Raw materials and parts
  • Direct labour spent making the products
  • Factory overhead such as production utilities
  • Products bought for resale, plus freight to bring them in

Selling and general costs such as rent for an office, advertising, sales commissions, shipping to customers and administrative salaries are operating expenses, not COGS.

How to Calculate COGS

COGS = BI + P - EI Available = BI + P
  • BI is the beginning inventory: the value of stock at the start of the period (last period's ending inventory).
  • P is the purchases: the cost of stock bought or made during the period.
  • EI is the ending inventory: the value of stock still on hand at the end, usually from a physical count.

Everything the business could have sold (the goods available for sale) either was sold or is still on the shelf. Taking the ending inventory away leaves the cost of what was sold.

Where the Inventory Goes

Available $70k Where it went Purchases $20k Beginning $50k Ending $10k COGS $60k Start + bought Sold + left

Both bars are the same height because they hold the same $70,000 of stock. On the left it is split by where it came from, on the right by where it ended up. A higher ending inventory means a lower COGS, and the other way round.

COGS Examples

BI + P − EICOGS
34,000 + 1,300 − 2,50032,800
15,000 + 5,000 − 3,00017,000
8,000 + 12,500 − 6,50014,000
50,000 + 20,000 − 10,00060,000

In the first row a shop starts with $34,000 of stock, buys $1,300 more and has $2,500 left after the count, so the goods it sold cost $32,800.

COGS and Gross Profit

Gross profit = Revenue - COGS Gross margin = Profit ÷ Revenue

A business with $100,000 of sales and a COGS of $60,000 has a gross profit of $40,000 and a gross margin of 40%. That $40,000 is what is left to pay rent, wages, marketing and other operating costs, and anything after that is operating profit.

FIFO, LIFO and Weighted Average

When prices change, the value given to the ending inventory depends on the costing method. Say a shop buys 100 units at $10, then 100 more at $12, and sells 150.

MethodCOGS
FIFO (oldest sold first)$1,600
Weighted average ($11)$1,650
LIFO (newest sold first)$1,700

The total cost is $2,200 every time, only the split changes: FIFO leaves $600 in ending inventory, weighted average $550 and LIFO $500. Use the same method each period so the figures stay comparable. LIFO is allowed in the United States but not under IFRS.

Common Mistakes

  • Adding operating expenses. Rent, marketing and office wages belong below gross profit, not in COGS.
  • Mixing periods. The beginning inventory must equal last period's ending inventory.
  • Leaving out freight in. Shipping paid to receive stock is part of its cost; shipping to customers is not.
  • Counting returns twice. Take purchase returns and discounts off the purchases figure first.
  • Skipping the stock count. An estimated ending inventory makes COGS just as rough.

Key Terms

COGS
Direct cost of the goods sold in the period.
Beginning inventory
Stock on hand at the start of the period.
Purchases
Stock bought or made during the period.
Ending inventory
Stock left at the end, from a count.
Gross profit
Revenue minus COGS.

How to Use the COGS Calculator

  1. Enter the beginning inventory. Type the value of stock on hand at the start of the period, such as 50,000. This is the ending inventory of the period before. Commas and a currency sign are fine.
  2. Enter the purchases and the ending inventory. Type the cost of stock bought or made during the period, such as 20,000, and the value of stock left at the end, such as 10,000.
  3. Read and copy the result. COGS appears as you type, with the working, the goods available for sale and the share of stock sold and left. Press Copy to copy it, or Clear or Esc to start again.

Example: a store held $50,000 of stock on 1 January, bought $20,000 more during the year and counted $10,000 on 31 December. Enter 50000, 20000 and 10000. COGS is $60,000 and 85.71% of the goods available were sold.

Who Can Use This Calculator?

Business OwnersPricing and profit checks
Online SellersTracking stock costs
AccountantsIncome statements and tax returns
StudentsAccounting homework

Frequently Asked Questions (FAQs)

How do you calculate cost of goods sold?

Add the purchases to the beginning inventory, then subtract the ending inventory: COGS = BI + P − EI. With $50,000 of opening stock, $20,000 of purchases and $10,000 left at the end, COGS is $60,000.

What is included in cost of goods sold?

The direct costs of the products sold: raw materials, direct labour, production overhead, goods bought for resale and the freight paid to bring them in. Rent for offices, marketing, sales commissions and administrative wages are operating expenses, not COGS.

What are goods available for sale?

Beginning inventory plus purchases: all the stock the business could have sold in the period. $50,000 + $20,000 = $70,000. Whatever is not left in ending inventory is counted as sold.

How is COGS used to find gross profit?

Gross profit = revenue − COGS. Sales of $100,000 with a COGS of $60,000 give a gross profit of $40,000 and a gross margin of 40%.

Can cost of goods sold be negative?

Not in practice. A negative result means the ending inventory is larger than the beginning inventory plus purchases, which usually points to a counting error or missing purchases. The calculator still shows the figure and flags it.

Does a service business have COGS?

Businesses that only sell services usually report a cost of services or cost of revenue instead, made up of the direct labour and materials used to deliver the work. The inventory formula here suits businesses that buy, make or resell physical goods.

How does the inventory method change COGS?

When prices rise, FIFO gives a lower COGS and LIFO a higher one, with weighted average in between. Buying 100 units at $10 and 100 at $12 and selling 150 gives COGS of $1,600 under FIFO, $1,650 under weighted average and $1,700 under LIFO.

Is the Cost of Goods Sold Calculator free?

Yes. It is completely free, needs no sign-up, and can be used as many times as you like.

Sources

Try our Cost of Goods Sold Calculator to find your COGS and gross profit in seconds.