Cost of Goods Sold Calculator

Cost of Goods Sold (COGS) Calculator

This calculator determines the Cost of Goods Sold (COGS) for a specific period based on the standard accounting formula.

Enter the values for your Starting Inventory, Purchases, and Ending Inventory for the period you wish to calculate. Ensure all values are in the same currency and represent cost, not retail price.

Enter Inventory and Purchase Values

Value of goods available for sale at the beginning of the accounting period.
Cost of any additional inventory purchased during the accounting period.
Value of goods available for sale at the end of the accounting period.

Understanding Cost of Goods Sold (COGS)

What is COGS?

Cost of Goods Sold (COGS) represents the direct costs attributable to the production or purchase of the goods sold by a company during a particular period. This includes the cost of the materials used to create the goods and the direct labor costs incurred to produce the goods. COGS is a crucial line item on a company's income statement as it directly impacts gross profit (Revenue - COGS).

The COGS Formula

The basic formula for calculating COGS is:

COGS = Starting Inventory + Purchases - Ending Inventory

  • Starting Inventory: The value of inventory a business has on hand at the beginning of an accounting period.
  • Purchases: The cost of inventory acquired during the accounting period. This usually includes the cost of goods themselves plus any freight or handling costs to get them to the place of sale.
  • Ending Inventory: The value of inventory remaining on hand at the end of the accounting period.

This formula is used under accounting methods like FIFO (First-In, First-Out) or LIFO (Last-In, First-Out), where the values of inventory are determined based on specific cost assumptions.

COGS Examples

See how COGS is calculated in different scenarios:

Example 1: Simple Case (Inventory Decrease)

Scenario: A small store starts the quarter with $10,000 in inventory, buys another $5,000 worth of goods, and ends the quarter with $7,000 in inventory.

Inputs:

  • Starting Inventory: $10,000
  • Purchases: $5,000
  • Ending Inventory: $7,000

Formula: COGS = Starting Inventory + Purchases - Ending Inventory

Calculation: COGS = $10,000 + $5,000 - $7,000

Result: COGS = $8,000

Conclusion: The cost of the goods sold during the quarter was $8,000.

Example 2: Simple Case (Inventory Increase)

Scenario: A business begins the year with $25,000 in inventory, makes $15,000 in purchases, and finishes the year with $30,000 in inventory.

Inputs:

  • Starting Inventory: $25,000
  • Purchases: $15,000
  • Ending Inventory: $30,000

Formula: COGS = Starting Inventory + Purchases - Ending Inventory

Calculation: COGS = $25,000 + $15,000 - $30,000

Result: COGS = $10,000

Conclusion: The cost of goods sold for the year was $10,000.

Example 3: New Business (Zero Starting Inventory)

Scenario: A new online seller starts with no inventory, buys $2,000 worth of products in their first month, and has $500 remaining at the end of the month.

Inputs:

  • Starting Inventory: $0
  • Purchases: $2,000
  • Ending Inventory: $500

Formula: COGS = Starting Inventory + Purchases - Ending Inventory

Calculation: COGS = $0 + $2,000 - $500

Result: COGS = $1,500

Conclusion: The cost of goods sold in the first month was $1,500.

Example 4: Selling All Inventory (Zero Ending Inventory)

Scenario: A seasonal vendor begins a market day with $800 in goods, buys no more during the day, and sells everything, ending with $0 inventory.

Inputs:

  • Starting Inventory: $800
  • Purchases: $0
  • Ending Inventory: $0

Formula: COGS = Starting Inventory + Purchases - Ending Inventory

Calculation: COGS = $800 + $0 - $0

Result: COGS = $800

Conclusion: The cost of goods sold for the day was $800.

Example 5: No Sales (Zero Purchases)

Scenario: A bookstore has $50,000 in inventory at the start of a slow month. They make no new purchases. At the end of the month, their inventory is still $50,000.

Inputs:

  • Starting Inventory: $50,000
  • Purchases: $0
  • Ending Inventory: $50,000

Formula: COGS = Starting Inventory + Purchases - Ending Inventory

Calculation: COGS = $50,000 + $0 - $50,000

Result: COGS = $0

Conclusion: If inventory levels and purchases are zero, COGS is zero, indicating no goods were sold from inventory.

Example 6: Large Numbers

Scenario: A large retailer reports Starting Inventory of $1,500,000, Purchases of $8,000,000, and Ending Inventory of $2,000,000 for the fiscal year.

Inputs:

  • Starting Inventory: $1,500,000
  • Purchases: $8,000,000
  • Ending Inventory: $2,000,000

Formula: COGS = Starting Inventory + Purchases - Ending Inventory

Calculation: COGS = $1,500,000 + $8,000,000 - $2,000,000

Result: COGS = $7,500,000

Conclusion: The cost of goods sold for the year was $7,500,000.

Example 7: Small Numbers / Fractions

Scenario: A crafter begins the week with $15.50 of material, buys $35.75 more, and has $21.25 left at week's end.

Inputs:

  • Starting Inventory: $15.50
  • Purchases: $35.75
  • Ending Inventory: $21.25

Formula: COGS = Starting Inventory + Purchases - Ending Inventory

Calculation: COGS = $15.50 + $35.75 - $21.25

Result: COGS = $30.00

Conclusion: The cost of materials used/goods sold was $30.00.

Example 8: Negative COGS (Indicates Potential Issue)

Scenario: Due to an inventory counting error or significant returns, a business reports Starting Inventory of $5,000, Purchases of $1,000, but somehow records Ending Inventory as $7,000.

Inputs:

  • Starting Inventory: $5,000
  • Purchases: $1,000
  • Ending Inventory: $7,000

Formula: COGS = Starting Inventory + Purchases - Ending Inventory

Calculation: COGS = $5,000 + $1,000 - $7,000

Result: COGS = -$1,000

Conclusion: A negative COGS mathematically results when Ending Inventory exceeds Starting Inventory plus Purchases. This is usually impossible in reality and signals an accounting error, calculation mistake, or potentially unique circumstances like significant, previously unrecorded inventory additions or returns-inwards that reduce the *net* cost of goods.

Example 9: Accounting Period Shift

Scenario: A company's Ending Inventory for Q1 was $40,000. This becomes the Starting Inventory for Q2. Q2 purchases were $30,000, and Ending Inventory for Q2 is $35,000.

Inputs (for Q2):

  • Starting Inventory: $40,000 (Ending Inventory from Q1)
  • Purchases: $30,000
  • Ending Inventory: $35,000

Formula: COGS = Starting Inventory + Purchases - Ending Inventory

Calculation: COGS = $40,000 + $30,000 - $35,000

Result: COGS = $35,000

Conclusion: COGS for the second quarter was $35,000. (This highlights how Ending Inventory of one period becomes Starting Inventory of the next).

Example 10: Including Freight Costs in Purchases

Scenario: A business starts the month with $12,000 inventory. They purchase $8,000 worth of goods and pay $500 in freight costs to receive them. Their ending inventory is $10,500.

Inputs:

  • Starting Inventory: $12,000
  • Purchases (Goods + Freight): $8,000 + $500 = $8,500
  • Ending Inventory: $10,500

Formula: COGS = Starting Inventory + Purchases - Ending Inventory

Calculation: COGS = $12,000 + $8,500 - $10,500

Result: COGS = $10,000

Conclusion: The COGS includes the direct cost of goods and the cost to get them to a saleable location.

Frequently Asked Questions about COGS

1. What does COGS stand for?

COGS stands for Cost of Goods Sold.

2. What is the basic formula for COGS?

The basic formula is: COGS = Starting Inventory + Purchases - Ending Inventory.

3. Why is calculating COGS important?

COGS is important because it is a direct expense related to generating revenue. It is subtracted from revenue to calculate Gross Profit, which is a key indicator of a business's profitability from its core operations. It's also necessary for tax reporting.

4. What should be included in "Purchases"?

Generally, "Purchases" includes the direct cost of goods bought for resale or the raw materials purchased for manufacturing, plus any costs incurred to get those goods to your location and ready for sale (like freight-in, customs duties, etc.).

5. Does COGS include operating expenses?

No, COGS only includes the *direct* costs of the goods sold. Operating expenses (like rent, utilities, salaries of administrative staff, marketing, etc.) are separate and are listed below Gross Profit on the income statement.

6. Can COGS be negative?

Mathematically, yes (if Ending Inventory > Starting Inventory + Purchases). However, in standard accounting practice, a negative COGS is highly unusual and typically indicates an error in inventory counting, recording purchases, or applying accounting principles. It implies you ended up with more inventory value than you started with plus bought, without accounting for things like returns or adjustments correctly within the "Purchases" or inventory figures.

7. How often should I calculate COGS?

COGS is typically calculated at the end of each accounting period (e.g., monthly, quarterly, or annually) to align with the period's revenue for income statement reporting.

8. What is the difference between COGS and Cost of Sales?

Cost of Sales is a broader term that can sometimes include costs beyond just the direct cost of goods, such as distribution costs or sales commissions. COGS is specifically focused on the cost of the inventory that was sold.

9. Does this formula work for manufacturing businesses?

For manufacturing businesses, "Purchases" in this basic formula is replaced or expanded upon with "Cost of Goods Manufactured". Calculating Cost of Goods Manufactured involves raw materials, direct labor, and manufacturing overhead. This simple calculator uses the retail/wholesale model where "Purchases" refers to buying finished goods.

10. Does the inventory valuation method (FIFO, LIFO, etc.) affect this formula?

The formula itself (Start Inv + Purchases - End Inv) remains the same. However, the *values* you use for Starting Inventory and Ending Inventory will depend on the inventory valuation method (FIFO, LIFO, Weighted Average, Specific Identification) used to determine their cost.

Ahmed mamadouh
Ahmed mamadouh

Engineer & Problem-Solver | I create simple, free tools to make everyday tasks easier. My experience in tech and working with global teams taught me one thing: technology should make life simpler, easier. Whether it’s converting units, crunching numbers, or solving daily problems—I design these tools to save you time and stress. No complicated terms, no clutter. Just clear, quick fixes so you can focus on what’s important.

We will be happy to hear your thoughts

Leave a reply

Cunits
Logo