Cost of Goods Sold (COGS): Comprehensive Guide

Cost of Goods Sold (COGS) represents the direct costs attributable to the production of the goods sold in a company. This includes the cost of the materials used in creating the good along with the direct labor costs used to produce the good. It excludes indirect expenses, such as distribution costs and sales force costs.
COGS is a critical metric for investors and analysts because it is subtracted from revenue to determine gross profit. Gross profit is the measure of a company's efficiency in using its labor and supplies in the production process. A lower COGS relative to revenue translates to a higher gross margin, leaving more capital to cover operating expenses like marketing, R&D, and administrative salaries.
Key Formulas
Basic COGS Equation:Beginning Inventory + Purchases − Ending Inventory = COGS
Gross Margin %:(Revenue − COGS) / Revenue × 100 (See Gross Margin Calculator)
How to Use This COGS Calculator
- Beginning Inventory: Enter the dollar value of inventory at the start of the period. This should match the Ending Inventory from the previous period.
- Purchases: Input the total cost of raw materials or merchandise purchased during the period.
- Freight-in: Add any shipping costs required to bring the inventory to your warehouse. (Outbound shipping to customers is an operating expense, not COGS).
- Purchase Returns & Discounts: Enter the value of returned goods or discounts received from vendors. These reduce your net purchases.
- Ending Inventory: Enter the value of unsold inventory remaining at the end of the period.
- Revenue (Optional): Input your total sales to calculate Gross Profit and Gross Margin Percentage.
What Is Included in COGS?
Determining what qualifies as a "direct cost" can be tricky. Here is a definitive breakdown of what should and shouldn't be included in your COGS calculation:
| Category | Include in COGS? | Reasoning |
|---|---|---|
| Raw Materials | YES | Essential components of the product. |
| Freight-In | YES | Cost to get materials to production site. |
| Direct Labor | YES | Wages of assembly line or manufacturing staff. |
| Factory Overhead | YES | Rent and utilities for the manufacturing plant only. |
| Shipping to Customers | NO | Selling/distribution expense (Operating Expense). |
| Sales Commissions | NO | Direct selling expense, not production cost. |
| Marketing Ads | NO | Operating expense. |
Inventory Valuation Methods (FIFO vs LIFO)
The value you assign to Ending Inventory dramatically affects your COGS and taxable income. Since inventory prices fluctuate, the accounting method you choose matters.
FIFO (First-In, First-Out)
Assumes the oldest inventory items are sold first. In an inflationary environment (rising prices), the cost of older (cheaper) inventory flows to COGS.
- ✅ Lower COGS (usually)
- ✅ Higher Net Profit
- ⚠️ Higher Taxes
LIFO (Last-In, First-Out)
Assumes the newest inventory items are sold first. If prices are rising, the higher recent costs flow to COGS.
- ✅ Higher COGS
- ✅ Lower Taxable Income
- ⚠️ Lower Net Profit/EPS
*Note: The IRS allows LIFO, but International Financial Reporting Standards (IFRS) strictly forbid it. If you expand globally, this reconciliation can be complex.
COGS Across Different Industries
While the concept remains the same, the line items that feed into COGS differ significantly by sector.
1. Retail & E-Commerce
For retailers (like a clothing store), COGS is straightforward. It is primarily the purchase price of the merchandise plus shipping to the warehouse.
Example: A shirt costs $10 to buy from a wholesaler and $1 to ship. COGS per unit = $11.
2. Service Businesses
Service companies (law firms, consultants, software dev shops) often do not have "goods." Instead, they have "Cost of Revenue" or "Cost of Services." This usually includes the salaries of the employees delivering the service (billable hours) and software costs directly tied to delivery (like server hosting for a SaaS app).
3. Manufacturing
Manufacturers face the most complexity. Their COGS includes Raw Materials, Direct Labor, and Manufacturing Overhead (electricity for machines, factory rent, equipment depreciation). They must calculate Cost of Goods Manufactured (COGM) before determining COGS.
Strategies to Lower COGS
Reducing COGS directly boosts your bottom line. Here are proven strategies:
- Bulk Purchasing: Negotiate volume discounts with suppliers to lower unit costs. Check your Markup.
- Supply Chain Audit: Review freight-in costs. Are you paying for expedited shipping unnecessarily?
- Waste Reduction: In manufacturing, "scrap" is wasted money. Lean manufacturing principles can minimize raw material waste.
- Automation: Investing in machinery can reduce direct labor hours per unit, lowering variable costs over time.
- Dropshipping: For retailers, dropshipping eliminates inventory holding costs (though often at the expense of lower margins per unit).
The 10-Point COGS Audit Checklist
If you are preparing for tax season or selling your business, your COGS numbers will be scrutinized. Use this checklist to ensure your books are bulletproof:
- 1
Cutoff Validation: Did the inventory arrive at the loading dock at 11:59 PM on Dec 31st? Ensure it is counted in the correct year.
- 2
Consignment Check: Exclude goods you hold on consignment (you don't own them) but INCLUDE goods you sent out on consignment (you still own them properly).
- 3
Obsolete Inventory Write-Down: If you have dead stock, write it down to its "Net Realizable Value." This lowers ending inventory, increases COGS, and lowers taxes legitimately. Monitor with Inventory Turnover.
- 4
Vendor Reconciliation: detailed review of Accounts Payable to ensure every recorded purchase has a matching receipt.
- 5
Freight Allocation: Are you splitting shipping costs for mixed loads correctly across different product lines?
Integration with Accounting Software
Modern businesses shouldn't calculate COGS on a napkin. Most ERPs (Enterprise Resource Planning) and accounting tools handle this, but they require proper setup:
QuickBooks / Xero
Great for small businesses. They usually use "Average Cost" method by default. Ensure your "Item List" is mapped to "Cost of Goods Sold" accounts, not general expenses.
NetSuite / SAP
Enterprise grade. Allows specific choosing of LIFO/FIFO layers and "Standard Costing" (where you estimate cost and book variances later).
Shopify / Amazon
E-commerce platforms track inventory counts but often do NOT track unit costs accurately over time. You usually need a "connector" app (like A2X) to push accurate COGS data to your accounting ledger.
Tax Implications
COGS is a Tax Deduction
The IRS allows you to deduct COGS from your gross receipts to calculate your taxable business income. Accurately tracking COGS is not just about analytics; it's about not overpaying the government. For more details, see IRS Publication 538.
Warning: You cannot deduct the cost of inventory until you sell it. Purchasing $100,000 of inventory in December does not lower your taxes for that year unless you sell it before December 31st (under Accrual basis).
Frequently Asked Questions
Is COGS an asset or expense?
COGS is an expense on the Income Statement. However, before the goods are sold, they sit on the Balance Sheet as an asset (Inventory). When a sale occurs, the value moves from the Balance Sheet (Asset) to the Income Statement (Expense).
Does COGS include salaries?
Only the salaries of employees directly involved in production (e.g., assembly line workers). Administrative staff, HR, and sales team salaries are Operating Expenses (SG&A), not COGS.
What if my Ending Inventory is higher than my Beginning Inventory?
This means you purchased or produced more goods than you sold during the period. Your inventory asset account grows, and cash flow likely decreased (since cash is tied up in stock). This doesn't affect COGS directly, but it affects your liquidity.
Why is my COGS negative?
COGS should conceptually never be negative. If your calculator shows a negative number, check your inputs. Did you accidentally swap Beginning and Ending Inventory? Is the value of Purchase Returns higher than Purchases? This usually indicates an accounting error.