What is cost of goods sold?
Cost of goods sold is the plainest number in the business and the easiest to get wrong. It is what the things you sold cost you to make or buy, and nothing else. Here is what belongs inside it, what belongs in operating expenses instead, the formula, and a worked period with every figure shown.
The short definition
Cost of goods sold, usually shortened to COGS, is the direct cost of the products a business sold during a period. For a reseller it is the wholesale price of the items that went out the door. For a maker it is the raw materials, the manufacturing, and the direct labour that turned them into finished goods.
The word that does the work is sold. Stock you bought but have not sold yet is not a cost of goods sold, it is inventory sitting on the shelf. Its cost only becomes COGS in the period it actually sells. That is why the formula works off the change in inventory rather than off what you spent on stock.
What counts, and what does not
The line between COGS and operating expenses is where most mistakes happen. A simple test: if a cost rises and falls directly with how many units you make or buy, it usually belongs in COGS. If it exists whether or not a given unit sells, it is an operating expense.
Direct product costs go in COGS
Wholesale cost, raw materials, manufacturing, direct labour, and inbound freight to get stock to you. These are the cost of having sellable product.
Costs to sell go in operating expenses
Ad spend, platform and payment fees, outbound shipping to the customer, software, rent, and wages. They run the business, they do not make the product.
- Wholesale or unit cost
- In COGS
- Raw materials
- In COGS
- Direct manufacturing labour
- In COGS
- Inbound freight to you
- In COGS
- Ad spend
- Operating
- Platform and payment fees
- Operating
- Outbound shipping to customer
- Operating
- Software, rent, office wages
- Operating
The one that trips people up: shipping
Inbound freight, the cost of moving stock from your supplier to you, is usually folded into COGS because it is part of acquiring sellable product. Outbound shipping, the cost of getting an order to the customer, is normally an operating expense. The rule that matters more than which bucket you choose is consistency: pick one treatment and keep it, or your margin will wobble for no real reason.
Four steps to the number
Count your opening inventory
Start with the value of the stock you were holding at the beginning of the period, valued at what it cost you, not what you plan to sell it for. If you are new and held nothing, opening inventory is zero.
Add what you bought or made during the period
Add the cost of new stock you purchased or produced: the wholesale price, the raw materials, the manufacturing, and the inbound freight that brought it to you. These are the direct costs of getting sellable product on hand.
Subtract your closing inventory
Take off the cost of the stock still unsold at the end of the period. That inventory has not been sold yet, so its cost is not a cost of goods sold. It carries forward as the next period's opening inventory.
What remains is COGS
Opening inventory plus purchases minus closing inventory leaves the cost of only the units that actually sold. Subtract that from revenue and you have gross profit, the pot that has to cover every other cost.
A worked example
One quarter, from inventory to gross margin
A store starts the quarter holding $12,000 of stock at cost. Over the three months it buys another $18,000 of product, including the freight to bring it in. At the end of the quarter, $10,000 of stock is still unsold on the shelf.
Cost of goods sold is $12,000 plus $18,000 minus $10,000, which is $20,000. That is the cost of only the units that actually sold, not everything the store spent on stock.
The store took in $52,000 of revenue over the same quarter, so gross profit is $32,000 and gross margin is 61.5 percent. Ad spend, fees, shipping, and the rest still have to come out of that $32,000 before anything reaches the owner.
- Opening inventory
- $12,000
- Purchases in the period
- $18,000
- Closing inventory
- $10,000
- Cost of goods sold
- $20,000
- Revenue
- $52,000
- Gross profit
- $32,000
- Gross margin
- 61.5%
Every figure above is made up for the example. The shape is the lesson: the $18,000 the store spent on stock is not its COGS, because $10,000 of product is still unsold. Only the $20,000 tied to sold units counts.
Why getting COGS right matters
COGS sets your gross margin, and gross margin is the first test of whether a product is priced above what it costs to make or buy. Get COGS wrong and every number downstream is wrong with it: gross profit, net profit, and any pricing or reorder decision you make from them.
The usual failure is not arithmetic. It is a cost filed in the wrong bucket, or inbound freight left out, or stock counted as sold when it is still on the shelf. Each one quietly distorts the margin, and because the number still looks plausible, it goes unnoticed for months.
Tracking it without the spreadsheet drift
The hard part is keeping the inputs honest period after period. TrueProfit lets you record your cost of goods alongside revenue and every operating cost, then runs the subtraction for you to show gross profit and net profit by month and by category. Put a product in its own category or tag its rows to read COGS and margin product by product rather than only in the blended total.
One definition, kept still
Decide once what sits in COGS and never move it. A margin that improves because you reclassified freight has improved nothing real.
Per product, not just blended
A blended COGS hides the mix. Read it per product and you can see which items carry the margin and which ones only look like they do.
Frequently asked questions
What is the cost of goods sold formula?
COGS = opening inventory + purchases - closing inventory. Opening inventory is the cost of stock you held at the start of the period, purchases is what you bought or produced during it, and closing inventory is the cost of what is still unsold at the end. The result is the cost of only the units that sold.
What counts as cost of goods sold?
The direct cost of the things you sold: the wholesale price or the raw materials and manufacturing, plus inbound freight to get the stock to you and any direct labour that turns materials into a finished product. If a cost rises and falls with how many units you make or buy, it usually belongs in COGS.
What is not included in COGS?
Costs of running the business rather than making the product: ad spend, platform and payment fees, outbound shipping to the customer, software, rent, office wages, and your own salary. Those are operating expenses. They come out after gross profit, not inside COGS, and mixing them in overstates your product cost.
What is the difference between COGS and operating expenses?
COGS is the cost of the product itself. Operating expenses are the cost of selling it and running the business around it. Revenue minus COGS is gross profit. Gross profit minus operating expenses, interest, and tax is net profit. Keeping the two buckets separate is what lets gross margin and net margin each mean something.
Are shipping costs part of COGS?
Inbound freight, the cost of getting stock from your supplier to you, is usually treated as part of COGS because it is a cost of acquiring sellable product. Outbound shipping, the cost of getting an order to the customer, is normally an operating expense. Pick one treatment for each and keep it consistent so your margin stays comparable month to month.
Why does cost of goods sold matter?
COGS sets your gross margin, which is the first test of whether a product is priced above what it costs. If COGS is wrong, every number built on it is wrong too: gross profit, net profit, and any pricing decision you make from them. It is also the line that moves most when you negotiate with a supplier or change a bill of materials.
See COGS flow straight into profit
TrueProfit records your cost of goods beside every other cost, then shows gross profit, net profit, and margin by month and by category. Free to start, Pro is $19 a month and Business is $49 a month.
Free to start, no credit card.