Money and bookkeeping

Cost of goods sold (COGS): what it is and how to calculate it

By The Microtra team · · 5 min read

What COGS tells you

Cost of goods sold is the direct cost of the products your customers bought during a period. If you bake cakes, it is the flour, eggs, sugar and boxes in the cakes you sold. If you resell tools, it is what you paid for the tools you actually sold. It is not a measure of everything you spent. Rent, software and advertising are costs of running the business, and they sit elsewhere in your reports.

COGS matters because it separates two questions. First, do your sales cover the goods themselves? Second, does what is left cover everything else? That first answer is called gross profit.

The formula

The standard way to calculate it for a period is:

Beginning inventory + purchases - ending inventory = COGS

Each piece has a plain meaning:

  • Beginning inventory is the value of stock you had at the start of the period.
  • Purchases are goods or materials you bought during the period.
  • Ending inventory is the value of unsold stock at the end.

You then subtract COGS from your sales to get gross profit.

Example: A shop starts the period with inventory worth $4,000. It buys $9,000 of stock during the period and finishes with $3,500 unsold. COGS = $4,000 + $9,000 - $3,500 = $9,500. Sales were $20,000, so gross profit = $20,000 - $9,500 = $10,500.

The figures are invented, but the method is the one you would follow with real numbers.

What usually belongs in COGS

Costs that are directly tied to getting the goods ready to sell are the usual candidates:

  • The purchase price of goods held for sale
  • Raw materials for items you make
  • Direct labor that makes the product, where it applies
  • Freight in, meaning the cost to bring materials to you
  • Packaging that goes out with the product

What usually does not belong:

  • Rent and utilities for the office
  • Advertising
  • Software and subscriptions
  • Insurance
  • Salaries unrelated to making the product

Those belong with operating expenses. The exact line between them can depend on your business and your tax situation, so ask your adviser to confirm how yours should be set up.

COGS for a service business

If you sell a service, you may think you have no COGS at all. In practice many service businesses buy materials and parts for jobs: a landscaper buys plants, an electrician buys fittings, a cleaner buys supplies for a particular client. Some call this "cost of services" or "job costs". Tracking it by job shows what each job really earned.

Pure time-based work, such as consulting, may have little or none. That is normal.

Counting inventory

The ending figure comes from a count, so accuracy depends on how you count.

  1. Count at the same point each period. The last day of the month is typical.
  2. Value what you counted. Use the cost you paid, not the price you charge.
  3. Reconcile. Compare the count to your records and investigate gaps.
  4. Write off damaged or lost stock. It should not sit in inventory.
  5. Keep the count sheet. It supports your numbers if anyone asks.

The IRS Publication 538 covers accounting methods and how inventory can affect them, and the IRS recordkeeping page lists what good records look like.

Using COGS to price

Once you know COGS per item, you can check that your prices leave room. If you sell a product for much more than it costs you, the difference is the gross profit for that item, and it has to pay for everything else. Two terms often confused here are markup and margin, which are not the same; read markup vs margin before you set prices from cost.

Where COGS sits in your reports

On a profit report, the order is usually: sales, minus COGS equals gross profit, minus operating expenses equals operating profit. Our guide on gross vs net income walks through that ladder, and profit vs revenue explains why sales alone can mislead you.

Mistakes to avoid

  • Counting every purchase as COGS even though some stock is unsold
  • Forgetting to count inventory
  • Mixing overhead into COGS without a reason
  • Valuing stock at the selling price
  • Ignoring freight and packaging

Confirm the treatment

COGS can have tax consequences, and the rules for what to include differ by business type and by state. This page is general information, not tax advice; confirm with a qualified accountant.

A monthly routine

COGS is much less painful when it is a short monthly habit rather than a year-end scramble.

  1. Gather the supplier bills and receipts for stock and materials.
  2. Enter them with the date and the supplier.
  3. Count stock on the last day, or as close as you can.
  4. Work out the figure with the formula above.
  5. Compare it with sales for the same period.
  6. Note anything odd, such as a sudden jump, and find the reason.

A jump in COGS with no matching jump in sales usually means waste, theft, a price rise from a supplier or a counting error. Catching it in the month it happens is far easier than untangling it later.

Keep the details with the work

COGS is only as good as your purchase and stock records. In Microtra you can track stock by location, record counts and transfers, set reorder levels, raise purchase orders and supplier bills, and see material costs on jobs. That gives you the purchases and counts you need to work out cost of goods sold, and the job-level costs for service work.

A few good questions

Before you get started.

What is the difference between COGS and operating expenses?

COGS is the direct cost of what you sold, such as materials and the goods themselves. Operating expenses are the general costs of running the business, like software or insurance. Both reduce profit, but they appear on different lines.

Do service businesses have COGS?

Some do, when they use materials or buy items for resale. Others call these costs of services or job costs. Ask your adviser how to label them in your books.

Is COGS the same as the price I paid a supplier?

Not exactly. It covers the goods that were sold in the period, not everything you purchased. Unsold stock stays in inventory until it sells.

Does shipping count?

Costs to bring goods to your door are often part of the cost of the goods. Costs to deliver to customers may be treated differently. Check with your adviser.

Why does COGS matter?

It shows how much of each sale goes to the goods themselves, which tells you whether your prices leave enough to cover everything else.

Catering tax deductions and business expenses to track

Catering tax deductions and catering business expenses: food, rentals, staff, delivery and kitchen costs, with a way to track each event.

Read the guide

Invoice factoring: what it is and how it works for small businesses

Invoice factoring explained: how selling unpaid invoices works, a worked example, the trade-offs and alternatives to weigh before you sign.

Read the guide

Estimated quarterly taxes for the self-employed

A plain guide to quarterly estimated taxes for the self-employed: who pays, how to work out what to set aside, and how to keep a routine.

Read the guide

Software for small business

Unleash your potential.

You do the work. Keep your quotes, invoices and business records together with Microtra. Start your 14-day free trial. No card needed.

Compare plans in USD
Start free trial