Cash Flow Frog logo

Cost of Goods Sold

Cost of goods sold (COGS) is the direct cost of the goods or services a business sold during a period, mainly the materials and direct labor behind what customers actually bought. It appears on the income statement, and revenue minus COGS gives gross profit. The standard formula is beginning inventory plus purchases minus ending inventory.

Cost of goods sold (COGS) is the direct cost of the products a company sold in a given period: the materials and the labor tied to those sales. It excludes indirect costs such as marketing, distribution, administration, and research.

What does COGS mean?

COGS measures what it cost to make or buy the specific goods a business sold in a period. It counts direct costs only: raw materials, components, and the labor attached to production.

The word "sold" does the work in that sentence. Stock you produced or purchased but have not sold yet stays on the balance sheet as inventory. It moves into COGS in the period the sale happens, which can be months later.

Costs that keep the business running without attaching to a specific sale stay out of COGS. Marketing, rent, admin salaries, and research all sit in operating expenses, a separate block further down the income statement. Getting that split right is what makes gross profit meaningful. Push overheads into COGS and your gross margin looks worse than it is. Pull production labor out of COGS and it looks better than it is.

What is the formula of COGS?

The standard formula is:

COGS = Beginning inventory + Purchases during the period − Ending inventory

  • Beginning inventory is the value of stock you held on the first day of the period, which is the same figure as last period's ending inventory.
  • Purchases covers everything you added during the period: goods bought for resale, raw materials, freight-in on those purchases, and direct production costs where you manufacture.
  • Ending inventory is what is still on the shelf on the last day, counted or pulled from your inventory system.

What is left after subtracting ending inventory is the cost of the goods that left the business as sales. The formula works because inventory is a holding account: everything that goes in either stays in stock or converts to COGS.

How do you calculate cost of goods sold?

Work through it in three steps using one period's numbers.

  1. Start with beginning inventory: $20,000.
  2. Add purchases made during the period: $50,000. Running total: $70,000.
  3. Subtract ending inventory still on hand: $15,000.

COGS = $20,000 + $50,000 − $15,000 = $55,000.

If revenue for the same period was $120,000, gross profit is $120,000 − $55,000 = $65,000, a gross margin of 54.2%. That margin sets the ceiling on what the business can spend on operating costs and still make money. A business with a 54% gross margin and operating costs above 54% of revenue loses money no matter how well it sells.

A manufacturer runs the same formula with a wider purchases line. Alongside raw materials, it picks up direct production wages and the factory costs tied to output, and the calculation usually runs across three inventory pools rather than one: raw materials, work in progress, and finished goods. A reseller has the simpler version, where purchases are just the invoiced cost of the goods bought in, plus freight to get them there.

How inventory costing changes the answer

The ending-inventory figure is not always obvious. When you have bought the same item at different prices, the method you use to value what is left changes COGS and therefore gross profit:

  • FIFO (first in, first out) assumes the oldest stock sold first. When prices are rising, FIFO leaves the newer, more expensive stock in inventory and reports lower COGS.
  • LIFO (last in, first out) assumes the newest stock sold first, which reports higher COGS when prices are rising. LIFO is permitted under US GAAP and prohibited under IFRS.
  • Weighted average cost blends all purchase prices into one unit cost, which smooths the effect of price swings.

Pick one method and stay with it. Switching between periods makes your gross profit trend unreadable.

What are common COGS examples?

Counts as COGS (direct) Not COGS (operating expense)
Raw materials and components Marketing and advertising
Direct production labor and the payroll taxes on it Sales salaries and commissions
Freight-in on inventory you purchased Rent, utilities, and admin salaries
Factory supplies consumed in production Research and development
Purchase cost of goods bought for resale Software subscriptions and professional fees

One line to agree on internally: outbound shipping to customers. Most businesses treat it as an operating expense, though some report outbound freight inside COGS. Either is defensible. What matters is that your chart of accounts does it the same way every month.

A service business with little or no inventory usually reports cost of services instead, covering the direct labor and materials delivered to clients. An agency would include billable staff time and subcontractor costs, and leave the office lease and the sales team out.

Where do I find COGS?

COGS appears near the top of the income statement, directly below revenue and directly above gross profit. Those three lines are the first block of the P&L.

You will not find COGS on the balance sheet. What you find there is inventory, which feeds the calculation as the beginning and ending figures. In accounting software, COGS is normally a distinct account type rather than a regular expense account, so the income statement can present gross profit correctly without any manual grouping.

Monthly reporting adds one practical catch. Most small businesses only count stock physically at year end, so the monthly ending-inventory figure comes from the accounting system rather than a real count. That makes monthly COGS an estimate until the count confirms it, and it is why a December gross margin often jumps or drops once the stocktake adjustment posts.

If you are checking the number, tie it back to inventory. Beginning inventory plus purchases minus COGS should equal the ending inventory on your balance sheet for the same date. When those two do not agree, the problem is usually a purchase posted to the wrong account or stock written off without an entry.

How does COGS affect cash flow?

COGS drives gross profit, and there is a timing point a forecasting audience should not miss: COGS is recognized when the goods are sold, not when the cash for them leaves your account.

You might pay a supplier in March, hold the stock through April, and only record the COGS when the item sells in May. The cash went out in March. The P&L stayed quiet until May. Stretch that across a growing product business and the pattern is familiar: gross profit looks healthy on paper while the bank balance keeps tightening, because every extra sale requires buying inventory before the revenue arrives.

The size of the gap depends on two things you can measure: how long stock sits before it sells (days inventory outstanding), and how long your supplier terms give you to pay. Thirty-day supplier terms with ninety days of inventory on hand means funding roughly two months of stock out of your own cash, every cycle.

This is where a forward view helps. Cash Flow Frog builds a rolling cash flow forecast of up to three years from your live accounting data, updated daily, so scheduled supplier payments and expected customer receipts land on the dates the cash actually moves. You can drill into any projected week down to the individual transaction to see which inventory purchase is causing a dip, then test a different payment date or order size before committing to it.

FAQ

Looking for more help?

Visit our help center to find answers to your questions about CashFlowFrog.

Help Centre

Trusted by thousands of business owners

Start Free Trial Now