InfyCalculator
📈

Cost of Goods Sold (COGS) Calculator

Calculate cost of goods sold with the periodic inventory formula — beginning inventory plus net purchases minus ending inventory — and see gross profit, gross margin and inventory turnover.

Beginning inventory
Purchases during the period
Freight-in and import costs
Purchase returns, allowances and discounts
Ending inventory
Net sales (optional)
Loading calculator…

How it works

Net purchases = purchases + freight-in − returns, allowances and discounts · Goods available for sale = beginning inventory + net purchases · COGS = goods available − ending inventory · Gross profit = net sales − COGS · Gross margin = gross profit ÷ net sales · Inventory turnover = COGS ÷ average inventory

Cost of goods sold is the cost of the inventory a business actually sold in a period. Under the periodic method you take what you had at the start, add everything you bought (including freight-in, less returns and discounts), and subtract what is still on the shelf at the end. Only costs of the goods themselves belong in COGS — rent, marketing and admin salaries are operating expenses. COGS is the line that drives gross profit and is reported on the income statement (IRS Form 1125-A uses the same layout).

Worked example

Beginning inventory $50,000 + purchases $120,000 + freight-in $5,000 − returns $3,000 = $172,000.00 available for sale. Subtract ending inventory of $45,000 and COGS is $127,000.00. With $250,000 of net sales the gross profit is $123,000.00 — a 49.20% gross margin — and inventory turned 127,000 ÷ 47,500 = 2.67× in the period.

Sources: IRS — Form 1125-A, Cost of Goods Sold · IRS Publication 334 — Cost of goods sold

Frequently asked questions

What is the formula for cost of goods sold?

COGS = beginning inventory + purchases − ending inventory. Add freight-in and subtract purchase returns and discounts to get net purchases first. Example: 50,000 + 122,000 − 45,000 = 127,000.

What costs are included in COGS?

The purchase price of goods, inbound freight, import duties and, for manufacturers, direct materials, direct labor and factory overhead. Selling, marketing, office rent and administrative costs are not part of COGS.

Is COGS the same as cost of sales?

They are usually used as synonyms. Service businesses often say cost of revenue or cost of sales for the direct cost of delivering services; retailers and manufacturers say cost of goods sold.

Why does a higher ending inventory lower COGS?

Because goods still on hand were not sold. Every dollar counted in ending inventory is moved off the income statement onto the balance sheet, which is why inventory counts must be accurate.

Related calculators

Planning estimate only. Real results depend on your actual costs, prices, taxes and market — check the figures with your accountant or adviser before making business decisions.