COGS (Cost of Goods Sold): What It Includes and How to Calculate It
Cost of goods sold, usually shortened to COGS, is the direct cost of the products or services you sold during a period. It’s the first thing subtracted from revenue on your income statement, and it decides your gross profit. Get it wrong and your margins, prices, and taxes can all be off.
This guide explains COGS in plain English, shows the inventory formula with an illustrative example for a small online shop, and covers what does and doesn’t belong in it.
What Is COGS?
COGS is what it cost you to make or buy the things you actually sold. If you made 1,000 items but sold 800, only the cost of the 800 goes into COGS. The other 200 stay on your books as inventory until they’re sold.
Typical COGS for a product business:
- Inventory bought for resale
- Raw materials and parts
- Direct labor to make the product
- Freight to bring materials or stock in
- Packaging that ships with the product
Typical COGS for a service business (sometimes called cost of services or cost of revenue):
- Labor of the people doing the client work
- Subcontractors
- Materials used on the job
- Software or tools billed per client
Not COGS: rent for an office, marketing, sales staff, admin wages, accounting fees, and general software. Those are operating expenses. See OPEX (operating expenses).
The COGS Formula

For a business that holds inventory:
COGS = Beginning inventory + Purchases − Ending inventory
The idea is simple. You start with some stock, you buy more, and whatever’s missing at the end (that you didn’t still have on the shelf) was sold.
The IRS asks businesses that hold inventory to report COGS using this kind of calculation. Its Publication 334 for small businesses covers the details. Check with your tax advisor on which inventory rules apply to you.
COGS Calculator
COGS Calculator
COGS = beginning inventory + purchases − ending inventory. Add revenue to see gross profit and gross margin. Results are estimates for planning only.
Worked Example: A Small Online Candle Shop
An online candle shop has these numbers for the quarter:
| Item | Amount |
|---|---|
| Inventory at the start of the quarter | $6,000 |
| Wax, wicks, jars, and fragrance bought | $9,500 |
| Freight on supplies | $500 |
| Inventory at the end of the quarter | $5,000 |
COGS = $6,000 + $9,500 + $500 − $5,000 = $11,000
If quarterly sales were $28,000:
- Gross profit = $28,000 − $11,000 = $17,000
- Gross profit margin = $17,000 ÷ $28,000 = 60.7%
Now say the owner forgot to count a box of finished candles in the back room worth $800. Ending inventory would be understated by $800, COGS would be overstated by $800, and gross profit would look $800 lower than it really is. Accurate stock counts matter.
Per-Unit COGS for Pricing

For pricing, work out the direct cost of one unit. Say one candle uses:
| Input | Cost |
|---|---|
| Wax | $2.10 |
| Jar and lid | $1.80 |
| Wick and fragrance | $1.20 |
| Label and box | $0.90 |
| Unit COGS | $6.00 |
At a $20 price, the gross margin per candle is $14, or 70%. Use the markup vs margin calculator to find the price for any target margin. Remember that shipping, card fees, and marketplace fees are variable costs too, even if they sit outside COGS on your books. Contribution margin captures all of them.
Common COGS Mistakes
- Putting overhead in COGS. Rent and office costs belong in operating expenses, unless they’re part of a production space your accountant tells you to include.
- Leaving freight out. Shipping on incoming stock is part of the cost of that stock.
- Skipping stock counts. Without a real ending inventory number, COGS is a guess.
- Ignoring waste. Broken, spoiled, or unsellable stock is a cost. Track it.
- Using old supplier prices. Update your unit costs whenever prices change.
Frequently Asked Questions
What is included in cost of goods sold?
COGS includes the direct costs of what you sold: inventory bought for resale, raw materials, direct labor, incoming freight, and packaging that ships with the product. It does not include rent, marketing, or admin costs.
How do you calculate COGS?
Add beginning inventory and purchases, then subtract ending inventory. A shop that starts with $6,000 in stock, buys $10,000, and ends with $5,000 has a COGS of $11,000.
Do service businesses have COGS?
Many do. It’s often called cost of services or cost of revenue, and it includes the labor, subcontractors, and materials used to deliver client work.
Is COGS the same as operating expenses?
No. COGS covers costs directly tied to what you sold. Operating expenses cover the costs of running the business, such as rent, marketing, software, and admin wages.
Why does COGS matter for taxes?
COGS reduces your gross income, so it lowers taxable profit. Understating it means paying more tax than you need to, and overstating it can cause problems in an audit. A tax professional can confirm the right method for your business.
