Inventory / COGS Calculator

COGS Calculator

Cost of goods sold from your inventory counts and purchases, plus gross profit and margin if you add revenue.
$

Enter a number of at least 0

$

Enter a number of at least 0

$

Enter a number of at least 0

Shipping to you, direct labor or materials that go into the product.

$

Enter a number of at least 0

$

Enter a number of at least 0

Optional, for gross profit and margin.

Cost of goods sold
$67,000.00
$43,000.00gross profit
39.1%gross margin
$0available $87,000.00
  • Sold (COGS)
  • Still on hand
Beginning inventory$25,000.00
Purchases+$60,000.00
Freight and direct costs+$2,000.00
Ending inventory−$20,000.00
Cost of goods sold$67,000.00

Gross profit is revenue minus COGS: $110,000.00 − $67,000.00 = $43,000.00.

See breakdown

How the COGS calculation works

  1. Start with beginning inventory

    The cost of stock on hand at the start of the period, usually last period's ending count.

  2. Add purchases and direct costs

    Everything bought for resale, plus freight-in and other costs of getting goods ready to sell. $25,000 + $60,000 + $2,000 = $87,000 available.

  3. Subtract ending inventory

    What is still on the shelf was not sold. $87,000 − $20,000 = $67,000 COGS. This is the same order as lines 35 to 42 of Schedule C (Form 1040).

  4. Compare with revenue

    Gross profit = revenue − COGS. $110,000 − $67,000 = $43,000, a 39.1% gross margin.

Worked example. Beginning inventory of $25,000, purchases of $60,000 and $2,000 freight-in give $87,000 of goods available. With $20,000 left at the end, COGS is $67,000. On $110,000 revenue that is $43,000 gross profit, a 39.1% gross margin.

COGS FAQ

How do I calculate cost of goods sold?

The COGS formula is beginning inventory + purchases + direct costs − ending inventory. In the example, $25,000 + $60,000 + $2,000 − $20,000 = $67,000.

What is COGS, and is it an expense?

COGS is the cost of the products you sold in the period. Yes, it is an expense: it is the first cost subtracted from revenue, and what remains is gross profit. The IRS asks you to figure gross profit before you deduct other business expenses.

What costs are included in COGS?

The cost of goods bought for resale, freight-in, and for goods you make, materials, direct and indirect production labor and factory overhead. The IRS notes that retailers and wholesalers usually have no labor to include. Store rent, marketing and office wages are operating expenses, not COGS. Sole proprietors do not include amounts paid to themselves.

Where does COGS go on a tax return?

Sole proprietors figure it in Part III of Schedule C (Form 1040), lines 35 to 42, and carry it to line 4. Corporations and partnerships filing Form 1120, 1120-S or 1065 use Form 1125-A. A small business taxpayer (average annual gross receipts of $31 million or less for the 3 prior tax years, per Pub 334 for 2025 returns) can choose not to keep an inventory.

Does FIFO or LIFO change COGS?

Yes. The method you use to identify cost decides which purchase prices end up in ending inventory, and so in COGS. The IRS allows specific identification, FIFO or LIFO, and values inventory at cost, at the lower of cost or market, or by the retail method. When prices rise, FIFO usually gives lower COGS than LIFO. Use the same method every year.

Do service businesses have COGS?

Often not. The IRS says you do not have to figure cost of goods sold if selling merchandise is not an income-producing factor in your business. Some firms still track cost of services, such as contractor labor tied to each job.

Sources: IRS Publication 334 (2025): How to figure cost of goods sold · IRS Publication 538: Inventories (identifying cost and valuing inventory) · IRS: About Form 1125-A, Cost of Goods Sold

Related calculators