Cost of goods sold (COGS) is the direct cost of producing what you sold during a period. Get it wrong, and your gross margin, pricing, and even your taxes are off.
COGS accuracy depends on careful business bookkeeping of purchases, inventory, and direct costs.
The basic formula
For a business that holds inventory:
COGS = Beginning inventory + Purchases during the period − Ending inventory
For example, if you started with $20,000 of inventory, bought $50,000 more, and ended with $15,000, your COGS is $20,000 + $50,000 − $15,000 = $55,000.
What belongs in COGS
- Direct materials — the raw materials or products you resell.
- Direct labor — wages for people who make the product.
- Manufacturing overhead — factory costs such as utilities and equipment depreciation tied to production.
- Freight-in and other costs to get inventory ready for sale.
Selling, marketing, and general administrative costs generally belong in operating expenses, not COGS.
Service and contracting businesses
Service businesses often track direct costs of delivering the service, such as the labor and materials on a job, in a similar way. For contractors, job-level costs are typically the cost of sales. See bookkeeping for contractors.
Why it matters
- Gross margin — COGS drives it, and it shows whether pricing covers direct costs.
- Pricing decisions — you can't set prices well without knowing true unit costs.
- Taxes — COGS reduces taxable income, so accuracy matters.
- Inventory valuation — your method affects reported profit. See FIFO vs. LIFO.
Common mistakes
- Counting items in COGS when they haven't sold yet.
- Leaving freight and direct labor out.
- Not doing regular inventory counts.
- Mixing operating expenses into COGS or the reverse.
You can see COGS's role in P&L analysis and how fast inventory moves in inventory turnover.
A manufacturer's example
A small manufacturer begins the month with $30,000 of inventory (including materials and finished goods), buys $45,000 of materials, spends $25,000 on direct labor, and incurs $10,000 of production overhead. At month-end, inventory is $35,000. Cost of goods sold is $30,000 + $45,000 + $25,000 + $10,000 − $35,000 = $75,000. If sales were $120,000, gross profit is $45,000, a 37.5 percent gross margin.
COGS for service businesses
Many service businesses don't hold inventory, but they still have direct costs of delivering the service, such as the wages of the people doing the work and subcontractor costs. Tracking these separately from general overhead lets you see your true gross margin by service line or project.
Keeping COGS accurate
- Count inventory regularly and reconcile it to your records.
- Record freight, duties, and other costs of getting inventory ready for sale.
- Keep operating expenses out of COGS, and vice versa.
- Be consistent in how you assign overhead.
- Review COGS as a percentage of sales each month for unexplained changes.
Frequently asked questions
Is COGS the same as cost of sales?
The terms are often used interchangeably. Some businesses use cost of sales or cost of revenue for service businesses.
Where does shipping fit?
Shipping to bring inventory in is generally part of COGS. Shipping to customers is often treated as a selling expense, but practice varies, so ask your accountant.
Why does COGS matter for taxes?
It reduces taxable income, so errors can raise or lower your tax bill.
How does COGS relate to pricing?
Your price has to cover COGS and enough extra to pay overhead and leave a profit.
Related reading
- A Guide to P&L Analysis for Small Business Owners
- What Is a Good Inventory Turnover Ratio and How Can You Improve It?
- FIFO vs. LIFO: Which Inventory Method Should Your Business Use?
Want a straight answer on what your books would cost to set up and maintain? Get a free quote based on your actual situation.
Get a Free Quote