Small Business Bookkeeping
Back to the Blog

Cost of Goods Sold (COGS): What It Is and How to Calculate It

Your income statement has a line called cost of goods sold, and your tax form wants a number for it. Here’s what it means, the formula, and one worked example.

By Antoine Joseph · Small Business Bookkeeping · 6 min read

A calculator and pen resting on a printed income statement on a desk

Photo via Pexels

You’re looking at your income statement and there’s a line called “cost of goods sold.” Or your tax software just asked for it and you have no idea what number goes there. That’s a normal place to be. Most small business owners meet this term the first time a form demands it.

Here’s the short version.

Cost of goods sold (COGS) is what it cost you to make or buy the products you actually sold during a period. Not everything you bought. Only what left the shelf.

Why COGS matters

COGS sits near the top of your income statement. Revenue minus COGS gives you gross profit — what’s left from sales after paying for the products themselves. Rent, software, and advertising come out of gross profit after that. If COGS is wrong, gross profit is wrong. Then your profit is wrong, and so is your tax bill. (For a refresher on where this line sits, see our guide to reading an income statement.)

The COGS formula

COGS is figured with an inventory formula. Inventory just means the products you hold to sell.

Beginning inventory + purchases − ending inventory = COGS

  • Beginning inventory: the value of the products you had on hand at the start of the period.
  • Purchases: what you bought during the period to sell, net of discounts and returns to suppliers.
  • Ending inventory: the value of the products still unsold at the end of the period.

Add beginning inventory and purchases together and you get the cost of goods available for sale. Subtract what’s still on the shelf, and what remains is what you sold.

A worked example

Say you sell candles online. You started the year with $4,000 of candles and supplies in stock. You bought $18,000 more during the year. On the last day of the year, you counted what was left and valued it at $5,000. You sold $40,000 worth of candles (your revenue).

COGS = $4,000 + $18,000 − $5,000 = $17,000
Gross profit = $40,000 − $17,000 = $23,000

Notice you didn’t deduct the full $18,000 you spent. You had $22,000 of stock available to sell in total ($4,000 + $18,000), and $5,000 of it was still unsold. Only the $17,000 that sold counts as COGS. The unsold $5,000 sits on your balance sheet as an asset until it sells.

What goes into COGS

The IRS lists the pieces on Schedule C, Part III (for US sole proprietors). Beyond purchases, it allows for the cost of labor, materials and supplies, and other costs such as freight-in (what you pay to get products delivered to you) and overhead tied to making the product.

Two things are not COGS:

  • Selling and administrative expenses. Your website subscription, ads, office rent, and bookkeeping software are ordinary operating expenses, not COGS.
  • Products you take for yourself. Merchandise you pull for personal use comes out of purchases. It isn’t a cost of the goods you sold.

Do service businesses have COGS?

Usually little or none. The IRS says its COGS chapter doesn’t apply to a personal service business, such as a doctor, lawyer, carpenter, or painter. But if you sell materials along with your service, those material costs may fall under the COGS rules. If you’re a freelancer or consultant who sells only time, you can likely skip this line. When in doubt, ask a CPA or tax preparer about your situation.

How to value ending inventory

The formula is only as good as your ending inventory number. You get it two ways: count what’s actually on hand, then put a dollar value on it.

  • US (Schedule C): you report the method used to value closing inventory. The form lists cost, lower of cost or market, or other.
  • Canada: the CRA allows either the fair market value of your entire inventory, or the value of individual items at cost or fair market value, whichever is lower. Whatever you pick, the CRA says to keep using the same method in later years.

The practical takeaway for both countries: pick a method, write it down, and stay consistent. Switching methods every year makes your numbers impossible to compare.

Where COGS goes on your tax forms

US: Schedule C, Part III, lines 35 to 42. Line 35 is beginning inventory, line 36 is purchases, line 41 is ending inventory, and line 42 is cost of goods sold (line 40 minus line 41).

Canada: Form T2125, Part 3D. Line 8300 is opening inventory, line 8320 is purchases, line 8500 is closing inventory, and line 8519 is gross profit.

Line numbers change with form updates, so check the current year’s form before you file.

How to track it in your books

  1. Count-based (periodic). Buy stock all year and record purchases to a “Purchases” or “Inventory purchases” account. At year-end (or month-end), count inventory, then work out COGS with the formula above. This is the simplest approach for a small shop.
  2. Track-as-you-sell (perpetual). Software adjusts inventory and COGS every time you make a sale. More accurate, more setup.

Either way, do a physical count at least once a year, and reconcile it against your books. It fits naturally into your month-end close and your year-end tax prep. Whether you use cash or accrual accounting can also affect how inventory is treated, so check with your accountant.

A quick sanity check with AI

Once you have your numbers, paste them into an AI assistant and ask it to check your math: “Beginning inventory $4,000, purchases $18,000, ending inventory $5,000. What’s COGS?” Use it as a second opinion, not a replacement for understanding your own numbers. If its answer doesn’t match yours, find out why before you file.

Common mistakes

  • Deducting all purchases as an expense and forgetting ending inventory. This understates profit.
  • Putting operating costs into COGS, like advertising or admin salaries.
  • Skipping the year-end count and guessing at ending inventory.
  • Changing valuation method between years without a reason.

The bottom line

COGS is beginning inventory plus purchases minus ending inventory. It tells you what your products actually cost you, so gross profit reflects reality. Count your stock, keep your method consistent, and keep selling costs out of it.

This is practical education, not tax or legal advice. For questions about your specific return, talk to a licensed CPA, tax advisor, or your accountant.

Want a tool for it?

The Inventory Ledger template tracks stock in and out, and the Gross Margin Calculator shows what your COGS does to your margins.

Sources

Frequently Asked Questions

What does cost of goods sold include?
Purchases of the products you sell, plus related costs such as freight-in, materials and supplies, and labor and overhead tied to making the product. Selling and administrative costs like advertising and office rent are not part of COGS.
Do service businesses have cost of goods sold?
Usually little or none. The IRS says its COGS rules don’t apply to a personal service business, though costs of materials you sell along with a service may fall under them. Ask a tax preparer about your situation.
How do I calculate cost of goods sold?
Add your beginning inventory and your purchases for the period, then subtract your ending inventory. The result is COGS.
Where does COGS go on my tax return?
In the US, Schedule C, Part III (lines 35 to 42), with the result on line 42. In Canada, Form T2125, Part 3D. Check the current year’s form for line numbers.

Related Free Tools

Want a Firm Foundation in Accounting? Get the Book.

A complete print and digital textbook from Antoine Joseph — the same plain-English approach as this blog, from your first journal entry through a finished set of financial reports.

See the Book