Calcipedia

Cost of Goods Sold Calculator

Calculate cost of goods sold from opening inventory, purchases, and closing inventory, then review goods available for sale, gross profit, and gross margin support from optional revenue.

Last updated

← All Operations calculators

Inventory Accounting

Cost of goods sold calculator guide: opening inventory, purchases, closing inventory, and gross margin support

A cost of goods sold calculator shows how much inventory cost moved out of stock and into the period's cost of sales. It starts with opening inventory, adds purchases, subtracts closing inventory, and can also compare the result with revenue to show gross profit and gross margin support.

What cost of goods sold is measuring

Cost of goods sold, or COGS, represents the inventory cost assigned to the goods sold during the period. It is not the same as total purchases. First, a business combines opening inventory and purchases to find the cost of goods available for sale. Then it removes the ending inventory that remains unsold. The remainder is cost of goods sold.

This matters because gross profit is based on revenue minus cost of goods sold, not revenue minus purchases alone. A business can buy heavily in one period and sell those goods in another, so inventory timing has to be handled correctly before margin analysis is meaningful.

Core COGS formula

The calculator follows the standard inventory flow used in basic business accounting. Opening inventory and purchases are combined to create the inventory pool available for sale. Closing inventory is then deducted because those goods remain on hand rather than having been sold during the period.

If revenue is entered, the calculator also estimates gross profit and gross margin. That makes it useful as both an inventory-accounting check and an early pricing or performance review tool.

Cost of goods available for sale = Opening inventory + Purchases

This is the total inventory cost available to sell during the period before ending inventory is removed.

Cost of goods sold = Cost of goods available for sale - Closing inventory

This isolates the inventory cost assigned to goods actually sold during the period.

Gross profit = Revenue - Cost of goods sold

Revenue support is optional, but if entered it shows the gross profit generated after product cost is covered.

Worked example: inventory pool to gross profit

Suppose opening inventory is 37,845, purchases are 283,250, and closing inventory is 32,955. Cost of goods available for sale is 321,095. Subtracting closing inventory gives cost of goods sold of 288,140.

If period revenue is 385,060, gross profit is 96,920 and gross margin is about 25.17%. The calculator shows that inventory movement and the sales relationship separately so you can confirm the inventory math before interpreting the margin result.

How to use COGS results

Use the COGS result to confirm whether reported product cost lines up with your inventory movement and purchasing assumptions. If gross margin looks weaker than expected, check not just revenue but also whether purchases, closing stock, or inventory write-down assumptions changed during the period.

This calculator is intentionally simple. It is most useful for planning, forecasting, or sense-checking period results before moving into a fuller accounting system that handles labor allocation, materials, freight-in, and inventory-method rules in more detail.

Frequently asked questions

What is the basic formula for cost of goods sold?

The basic formula is opening inventory plus purchases minus closing inventory. That first creates the cost of goods available for sale and then removes the inventory that remains unsold at the end of the period.

Why is COGS different from purchases?

Purchases show what was bought during the period, while COGS shows the inventory cost assigned to goods actually sold during the period. If inventory levels rise or fall, purchases and COGS will differ.

Do I need revenue to calculate COGS?

No. Revenue is optional. It is only needed if you want the calculator to extend the inventory result into gross profit and gross margin support.

Can closing inventory be larger than goods available for sale?

No. If closing inventory exceeds opening inventory plus purchases, the inputs are inconsistent and the period inventory flow needs to be checked.

Related

More from nearby categories

These related calculators come from the same leaf category, nearby sibling categories, or the same top-level topic.