What Cost of Goods Sold Means and Why You Need It
Cost of Goods Sold (COGS) is the total amount your business spent on materials and labor to make or buy the products you sold during a specific period. It does not include overhead costs like rent, utilities, or salaries for office staff — only the direct costs tied to creating or purchasing inventory that left your business.
You need COGS because it shows how much profit you actually made. If you sold $50,000 worth of products but spent $35,000 making them, your gross profit is $15,000. Without calculating COGS, you cannot see whether your pricing covers your production costs or whether you are losing money on each sale.
COGS also affects your taxes. The IRS uses it to determine your taxable income, so calculating it correctly can lower what you owe. Most accounting software and tax forms ask for COGS as a separate line item.
Key Takeaways
- COGS includes only the direct costs of materials and labor needed to make or buy products you sold — not rent, utilities, or office salaries.
- The standard formula is: Beginning Inventory + Purchases − Ending Inventory = COGS.
- You must physically count or track your inventory at the start and end of each accounting period to use this formula.
- The inventory valuation method you choose (FIFO, LIFO, or weighted average) changes your COGS number and your tax bill.
- Tracking COGS by product or category helps you spot which items are profitable and which are dragging down your margins.
The Standard COGS Formula and How to Use It
The basic formula for COGS is straightforward: Beginning Inventory + Purchases − Ending Inventory = COGS. This works for any business that buys or makes products.
Here is what each part means. Beginning Inventory is the value of all products you had on hand at the start of your accounting period (usually a month, quarter, or year). Purchases is the total cost of all raw materials, components, or finished goods you bought during that period. Ending Inventory is the value of products still on hand at the end of the period. You subtract ending inventory because those items were not sold — they are assets you still own.
Example: A bakery starts January with $2,000 worth of flour, sugar, and eggs in stock. During January, it buys $5,000 more ingredients. At the end of January, it counts $1,500 of ingredients left. The COGS for January is $2,000 + $5,000 − $1,500 = $5,500. That $5,500 is the cost of the ingredients that went into products the bakery sold that month.
Counting and Valuing Your Inventory
Before you can calculate COGS, you need accurate numbers for beginning and ending inventory. Most businesses do a physical count — actually going through shelves, storage, and bins to count every item. This happens at least once a year, though many do it monthly or quarterly.
When you count, record the quantity of each product and its cost. If you bought the same item at different prices over time, you need to decide which cost to use. That decision is called your inventory valuation method, and it matters because it changes your COGS and your taxes.
If you use accounting software (QuickBooks, Xero, FreshBooks), you can track inventory continuously as you buy and sell. The software updates your counts in real time, so you do not have to count everything by hand. However, you should still do a physical count at least once a year to catch theft, damage, or data entry errors.
Choosing an Inventory Valuation Method
When you buy the same product multiple times at different prices, you must choose which cost to assign to the items you sold. The three main methods are FIFO (First In, First Out), LIFO (Last In, First Out), and weighted average.
FIFO assumes you sold the oldest inventory first. If you bought widgets for $10 each in January and $12 each in March, FIFO says the January units sold first. In a rising-price environment, FIFO gives you a lower COGS and higher profit — but also a higher tax bill. FIFO is the most common method and is allowed everywhere.
LIFO assumes you sold the newest inventory first. Using the same example, LIFO says the March units sold first, so your COGS is higher and your profit is lower. LIFO reduces your tax bill when prices are rising, but it is not allowed for tax purposes in many countries outside the United States, and some states restrict it.
Weighted average splits the difference. You calculate the average cost of all units in inventory and use that for everything you sold. It is simpler than FIFO or LIFO and produces results between the two. The downside is that it does not match how most businesses actually move inventory.
| Method | How It Works | When Prices Rise | Best For |
|---|---|---|---|
| FIFO | Oldest inventory sold first | Lower COGS, higher profit, higher taxes | Most businesses; required in many countries |
| LIFO | Newest inventory sold first | Higher COGS, lower profit, lower taxes | U.S. businesses in rising-price environments |
| Weighted Average | Average cost of all units | Results between FIFO and LIFO | Simpler tracking; less common |
Once you choose a method, stick with it year to year. Switching methods changes your COGS and profit numbers, which confuses your financial picture and may trigger IRS questions.
What to Include and Exclude from COGS
COGS includes only costs directly tied to making or buying the products you sold. Include: raw materials, components, packaging, direct labor (wages for workers who make the product), freight to bring inventory in, and manufacturing overhead directly tied to production (like factory electricity or equipment depreciation).
Exclude: rent for office space, salaries for managers or office staff, marketing and advertising, insurance, utilities for the office, office supplies, and delivery to customers. These are operating expenses, not COGS. They come out of your gross profit as separate line items on your income statement.
The line can blur with labor. If a worker spends half their time making products and half their time managing inventory or cleaning the facility, count only the production half in COGS. If you are unsure, ask your accountant — misclassifying expenses can distort your profit and trigger tax problems.
Calculating COGS for a Service Business
If you run a service business (consulting, plumbing, accounting, personal training), COGS is usually zero or very small. You do not have inventory to count. However, if you use materials that are consumed during the service — like a plumber's solder, a hairdresser's dye, or a contractor's lumber — those materials count as COGS.
The rule is straightforward: if the material is consumed and becomes part of what the customer receives, it is COGS. If it is a tool or equipment you use repeatedly, it is not COGS — it is a capital asset that you depreciate over time.
For most service businesses, labor is not COGS either. Your own salary and your employees' salaries are operating expenses, not COGS. The exception is if you bill customers for labor at a markup and track those hours separately — in that case, the labor cost might be COGS, but this is rare and depends on your accounting method.
Common Mistakes When Computing COGS
Forgetting to count ending inventory. The biggest mistake is calculating purchases but forgetting to subtract what you have left. This inflates your COGS and makes your profit look smaller than it is. Always do a physical count or use software that tracks inventory in real time.
Including overhead that is not tied to production. Rent, insurance, and office salaries are not COGS. They are operating expenses. If you lump them into COGS, your gross profit looks artificially low, and you cannot compare your margins to other businesses or to your own past performance.
Switching valuation methods without documenting it. If you use FIFO one year and weighted average the next, your COGS and profit numbers will jump for reasons that have nothing to do with your actual business performance. The IRS may also question the change. Pick a method and document why you chose it.
Not tracking inventory by location or category. If you have multiple warehouses or product lines, track COGS separately for each. This shows you which products are profitable and which are not. A bakery might find that bread has a 40% margin but custom cakes have a 60% margin — information that changes pricing and production decisions.
Frequently Asked Questions
Do I have to count inventory in person, or can I use software?
Software is faster and more accurate if you use it consistently. However, you should do a physical count at least once a year to catch errors, theft, or damage that the software might miss. Many businesses count monthly or quarterly to stay on top of inventory and spot problems early.
What if I do not know the cost of inventory I bought years ago?
Use your purchase receipts or invoices. If you cannot find them, estimate based on the average price you paid during that period or ask your supplier for historical pricing. Document your estimate so you can explain it to your accountant or the IRS if needed.
Does COGS include shipping costs to my customers?
No. Shipping to customers is a delivery or fulfillment cost, not COGS. However, shipping to bring inventory into your warehouse or store is part of COGS because it is a cost of acquiring the product.
How often should I calculate COGS?
Most businesses calculate COGS monthly or quarterly to track profit and make pricing decisions. You must calculate it at least once a year for your tax return. If you use accounting software, it calculates COGS automatically as you record purchases and sales.
Can COGS be higher than my total sales?
Yes, and it means you are losing money on every sale. This can happen if your costs rise faster than your prices, if you have theft or waste, or if you are underpricing. If this happens, review your pricing, reduce waste, or find cheaper suppliers.