General information for small business owners, not accounting or tax advice. The rules for what goes into cost of goods sold on a tax return depend on your business, so check with your accountant or tax preparer.

The cost of goods sold formula is simple: beginning inventory, plus the purchases you made during the period, minus the inventory you have left at the end. What comes out is what the products you actually sold cost you. It’s the number that sits between your sales and your gross profit, and it’s the one most small sellers guess at.

This guide covers what cost of goods sold (COGS) means, how to calculate it step by step, what belongs in it if you resell, make or cook what you sell, a worked dollar example, and the mistakes that throw the number off.

What cost of goods sold means

Cost of goods sold is the direct cost of the products you sold during a period. Not the products you bought. Not the products sitting on your shelf. Only the ones that went out the door to a customer.

That distinction matters. If a gift shop buys $5,000 of holiday stock in October and sells half of it by December, only about $2,500 of that stock belongs in cost of goods sold for the year so far. The rest is still inventory, an asset you own. Our guide to what inventory is covers why unsold stock is treated that way.

COGS is measured over a period, usually a month, quarter or year, the same period as the sales it’s matched against.

The cost of goods sold formula

COGS = beginning inventory + purchases − ending inventory

Each part is valued at cost, what you paid, never at retail price:

  • Beginning inventory is the cost of the stock you had on the first day of the period. It should match the ending inventory from the period before.
  • Purchases are the cost of the stock and materials you bought during the period, including shipping to get them to you.
  • Ending inventory is the cost of the stock you still have on the last day, found by counting it.

The logic is straightforward. Beginning inventory plus purchases is everything you could have sold. Whatever isn’t still on hand at the end either sold, broke, spoiled or went missing. That’s why an accurate count at the end of the period matters so much.

How to calculate COGS, step by step

  1. Pick the period. A month works well for a busy food truck. A craft seller doing a few fairs a year may only need it quarterly or yearly.
  2. Find beginning inventory. Use last period’s ending count at cost. If this is your first period, count what you have now and use that.
  3. Add up purchases. Go through supplier invoices and receipts for stock and materials bought during the period. Include freight and delivery charges on those goods.
  4. Count ending inventory. Count everything on the last day and multiply each item by its unit cost. A count sheet makes this faster and harder to get wrong.
  5. Do the math. Beginning inventory plus purchases, minus ending inventory.

A worked cost of goods sold example

Take a small gift shop that sells candles, cards, local art prints and jewelry. Here’s its year:

LineAmount
Beginning inventory at cost (January 1)$12,000
Purchases from suppliers+$38,000
Freight and shipping on those purchases+$1,500
Goods available for sale$51,500
Ending inventory at cost (December 31 count)−$14,500
Cost of goods sold$37,000

If the shop’s net sales for the year were $92,000, its gross profit is $92,000 − $37,000 = $55,000, a gross margin of about 59.8%. Our guide to the gross profit formula picks up from here.

A monthly example from a food truck works the same way. It starts the month with $1,800 of food and packaging on hand, buys $6,200 more during the month and counts $1,500 left at the end. COGS is $1,800 + $6,200 − $1,500 = $6,500. Against $19,000 in sales, that’s a food cost of about 34.2%.

What’s included in COGS, and what isn’t

The rule of thumb: if the cost goes into the product itself, or into getting it ready to sell, it’s probably COGS. If you’d pay it whether or not you sold anything this month, it’s probably an operating expense. What counts depends on what kind of seller you are.

If you resell products

Boutiques, gift shops and market stalls that buy finished goods have the simplest COGS. It usually includes the wholesale cost of the goods and the freight to get them to you. Some sellers also include packaging that ships with the product, like a gift box that comes on every candle.

If you make what you sell

Potters, candle makers, soap makers and woodworkers include raw materials (clay, wax, fragrance, lumber), parts and supplies that end up in the product (wicks, jars, labels), and often the cost of labor paid to people who make the goods. Your own time as a sole owner isn’t a cost you add in. Larger makers may also allocate some overhead to products; ask your accountant whether that applies to you.

If you sell food

Food trucks, coffee carts and bakery stalls include ingredients and the disposables that go out with each order: cups, lids, clamshells, napkins and sauce cups. Many food businesses track this as food cost and paper cost separately, but both are part of cost of goods sold.

What usually stays out of COGS

  • Booth fees, rent and commissary fees
  • Card processing fees
  • Marketing, signs and your website
  • Software subscriptions, including your point of sale
  • Wages for staff who sell rather than make, such as a counter clerk
  • Equipment such as a fryer, kiln or display shelving, which is usually depreciated over several years

These all belong on the P&L, just lower down, as operating expenses. For the tax side, the IRS covers cost of goods sold for small businesses in Publication 334, and sole proprietors report it in Part III of Schedule C.

Where COGS sits on the P&L

On a profit and loss statement, cost of goods sold comes right after net sales:

  • Net sales
  • Minus cost of goods sold
  • Equals gross profit
  • Minus operating expenses
  • Equals operating profit, and after interest and taxes, net income

Because COGS is usually the biggest single cost for a product business, small errors in it swing your profit more than almost anything else. Overstate ending inventory by $1,000 and you understate COGS by $1,000, which makes the year look $1,000 more profitable than it was.

COGS also feeds other numbers. Your inventory turnover ratio is COGS divided by average inventory, and your ending inventory shows up as an asset on your balance sheet.

Common COGS mistakes

  • Using purchases as COGS. Buying a lot of stock in a month doesn’t mean you sold it. Skipping the ending count makes stock-up months look terrible and sell-down months look great.
  • Valuing inventory at retail. Beginning and ending inventory must be at cost. Using shelf prices inflates ending inventory and shrinks COGS.
  • Forgetting freight. Shipping you pay to receive stock is part of what the goods cost you.
  • Mixing in operating expenses. Booth fees and card fees are real costs, but putting them in COGS muddies your gross margin and makes it hard to compare months.
  • Skipping the count. Estimating ending inventory is the fastest way to a wrong number. Breakage, spoilage and theft only show up when you count.
  • Inconsistent periods. If beginning inventory doesn’t match last period’s ending inventory, something was counted twice or missed.
  • Ignoring stale cost prices. When a supplier raises prices and you don’t update your unit costs, your inventory value and margins drift from reality.

Using COGS to make decisions

Once you know your COGS, divide it by net sales. A gift shop at 40% knows that 40 cents of every dollar goes to the product. A food truck at 34% can watch that number month to month and spot a supplier price hike, a portion-size creep or waste before it eats the month.

Product by product, cost and price tell you which items carry the business. The profit margin calculator is a quick way to check one item, and our guide to contribution margin goes a step further by adding the other costs that rise with each sale, like card fees.

Where SleepingFire fits

SleepingFire is point-of-sale and inventory software, not accounting software, so it doesn’t calculate COGS for you. It does supply the numbers the formula needs. You store a cost price on each product, stock counts drop with every sale, stock adjustments record breakage or spoilage with a reason, and stock count sheets help with the end-of-period count. The inventory valuation report shows your stock at cost and at retail by category for any date, with a CSV export to hand to your bookkeeper, and sales reports give you net sales for the same period. See inventory management.

Frequently asked questions

What is the formula for cost of goods sold?

Beginning inventory plus purchases during the period, minus ending inventory, all valued at cost. The result is the cost of the products you actually sold.

Is shipping included in cost of goods sold?

Freight you pay to get stock delivered to you is generally part of COGS. Shipping you pay to send orders to customers is usually treated separately, so check with your accountant.

Are card processing fees part of COGS?

Usually not. Card fees, booth fees, rent and software are operating expenses that go below gross profit on the P&L.

Do I include my own labor in COGS?

As a sole owner, your own time isn’t added to COGS. Wages paid to employees who make the products often are.

Why is inventory valued at cost and not retail for COGS?

The formula measures what the goods cost you, so using retail prices would inflate ending inventory and understate COGS.