CalculatorMasters

Accounting Cost of Goods Sold Formula

Learn how to calculate cost of goods sold from inventory balances, purchases, purchase adjustments, and freight-in.

Cost of goods sold (COGS) estimates the inventory cost assigned to products sold during an accounting period. The calculation helps connect inventory activity to gross profit reporting, provided all inventory amounts use a consistent valuation basis.

  • 100% Free
  • No Sign-Up Required
  • Private & Secure
  • Mobile Friendly

Cost of Goods Sold

COGS = Beginning Inventory + Purchases − Purchase Returns and Discounts + Freight-In − Ending Inventory

Where:

Start with inventory on hand at the beginning of the period, add adjusted purchase costs, then subtract inventory still on hand at the end of the period.

Variables Explained

VariableWhat It MeansUnit
beginningInventory - Beginning inventoryRecorded cost of inventory on hand at the start of the accounting period.currency
purchases - Inventory purchasesCost of inventory purchased during the period before returns, allowances, and discounts.currency
purchaseAdjustments - Purchase returns and discountsReturns, allowances, and discounts that reduce the cost of inventory purchases.currency
freightIn - Freight-in and import costsDirect costs of bringing purchased inventory to its intended location, such as inbound shipping or duties.currency
endingInventory - Ending inventoryRecorded cost of inventory remaining on hand at the end of the period.currency

Step-by-Step Calculation

1

Calculate net purchases

Reduce gross inventory purchases by purchase returns and discounts, then add freight-in and similar acquisition costs.

netPurchases = purchases - purchaseAdjustments + freightIn

2

Find goods available for sale

Combine beginning inventory with net purchases to find the total inventory cost available to sell during the period.

goodsAvailableForSale = beginningInventory + netPurchases

3

Subtract ending inventory

Inventory still on hand has not been assigned to current-period sales, so it is removed from goods available for sale.

costOfGoodsSold = goodsAvailableForSale - endingInventory

4

Use the combined formula

This equivalent formula calculates COGS directly while preserving the same inventory-cost flow.

costOfGoodsSold = beginningInventory + purchases - purchaseAdjustments + freightIn - endingInventory

Monthly retail COGS calculation

Beginning inventory$25,000
Inventory purchases$80,000
Purchase returns and discounts$3,000
Freight-in and import costs$2,500
Ending inventory$30,000
1

Subtract purchase adjustments

$80,000 - $3,000

$77,000

2

Add freight-in

$77,000 + $2,500

$79,500

3

Calculate goods available for sale

$25,000 + $79,500

$104,500

4

Calculate cost of goods sold

$104,500 - $30,000

$74,500

Final Result

Estimated cost of goods sold: $74,500.00

Try the Calculator →

Assumptions

  • All input amounts apply to the same accounting period and are expressed in the same currency.
  • Beginning and ending inventory are measured using a consistent inventory valuation method.
  • Purchase returns, allowances, and discounts reduce the inventory purchase cost.
  • Freight-in and entered import costs are treated as inventory acquisition costs.
  • The calculation uses a periodic inventory approach.

Limitations

  • !The calculator does not determine inventory unit costs or select an inventory valuation method.
  • !Physical count errors, shrinkage, damaged goods, write-downs, and unrecorded transactions can change the reported result.
  • !Treatment of freight, duties, rebates, and other costs can vary with accounting policies and circumstances.
  • !COGS does not by itself show profitability because revenue and other business expenses are not included.

Common Mistakes to Avoid

1

Entering sales revenue instead of the cost of inventory purchases.

2

Adding purchase returns or discounts instead of subtracting them.

3

Omitting inbound freight or including outbound customer shipping as freight-in.

4

Using ending inventory from a different date or valuation basis than beginning inventory.

5

Treating rent, marketing, administrative payroll, or income taxes as inventory costs without confirming the appropriate classification.

Related Formulas

Frequently Asked Questions

What is the basic COGS formula?

The periodic formula is beginning inventory plus net purchases minus ending inventory. Net purchases equal purchases minus purchase returns and discounts plus freight-in.

Why is ending inventory subtracted from COGS?

Ending inventory represents inventory that remains unsold. Its cost stays in inventory rather than being assigned to the period's sales.

Is freight-in included in cost of goods sold?

Freight-in commonly increases inventory cost first. It becomes part of COGS when the related inventory is sold.

What are net purchases?

Net purchases are gross inventory purchases after subtracting purchase returns, allowances, and discounts and adding direct acquisition costs such as freight-in.

Can COGS be negative?

A negative result may indicate inconsistent inputs, such as ending inventory exceeding goods available for sale, or a transaction or inventory-count issue that needs review.

Does COGS include operating expenses?

This calculation excludes general operating expenses such as marketing, office rent, and administrative costs. Expense classification may depend on the business and accounting policy.

Ready to calculate your result?

Use the calculator to get instant results with your own inputs.

Try Accounting Cost of Goods Sold