What is Cost of Goods Sold (COGS)?
Cost of Goods Sold (COGS), also known as cost of sales, measures the direct costs incurred in producing or acquiring the merchandise sold by a business during a specific accounting period. It includes the purchase price of raw materials, inbound shipping and freight fees, and direct factory labor, while excluding indirect operating costs such as marketing, office rent, and executive salaries.
COGS sits directly below gross revenue on the income statement. Subtracting COGS from total sales yields gross profit, the primary metric of product-level profitability. When evaluating how unit sales cover both direct product costs and indirect operational overhead, you can evaluate your company sales target with the break-even calculator, analyze unit economics with the contribution margin calculator, calculate e-commerce marketplace deductions using our Etsy fee calculator, or verify bottom-line operating earnings using the accounting profit calculator.
The COGS Formula and Calculation Methods
Under the periodic inventory accounting system, COGS is calculated by measuring the net flow of physical inventory across the accounting cycle:
The accounting steps break down as follows:
- Beginning Inventory: The monetary value of unsold merchandise or raw materials held in stock at the very start of the accounting period (equal to the previous period ending inventory).
- Purchases & Inbound Freight: The invoice cost of all newly acquired products plus direct transportation and customs costs required to place inventory in a sellable location.
- Total Goods Available for Sale: The total inventory accessible for customer fulfillment throughout the period, defined as .
- Ending Inventory: The physical count and valuation of unsold items on hand at the close of the period, recorded on the balance sheet as a current asset and calculated using the ending inventory calculator.
Retail vs. Manufacturing COGS Breakdown
The composition of COGS varies depending on whether a company resells finished goods or manufactures custom products from raw materials:
1. Retail and Merchandising Businesses
Retailers, wholesalers, and e-commerce stores buy finished goods ready for resale. For retailers, COGS consists of wholesale purchase prices plus direct inbound shipping (freight-in). Outbound delivery to customers is classified as a selling expense, not COGS.
2. Manufacturing Businesses (Cost of Goods Manufactured)
Manufacturers convert raw materials into finished merchandise through physical labor and factory tooling. Direct manufacturing costs include:
- Direct Materials: Raw commodities and sub-components physically incorporated into the finished product. When operating under standard costing, track raw material procurement differences with the direct material price variance calculator.
- Direct Labor: Wages and payroll taxes paid to assembly line operators, machinists, and fabricators.
- Manufacturing Overhead: Factory-level expenses directly tied to production, such as assembly plant utilities, machinery depreciation, and production facility supplies.
Step-by-Step Worked COGS Example
Consider an e-commerce home goods merchant reviewing quarterly performance. The merchant records the following financial data:
- Beginning Inventory: $45,000
- Merchandise Purchases: $175,000
- Direct Inbound Freight: $12,000
- Ending Physical Inventory: $38,000
- Gross Quarterly Revenue: $340,000
Step 1: Calculate Goods Available for Sale
Step 2: Calculate Cost of Goods Sold (COGS)
Step 3: Calculate Gross Profit and Gross Margin
Step 4: Analyze Inventory Turnover and Holding Efficiency
The business converts its complete inventory roughly 4.67 times per year, requiring an average of 78 days to sell incoming stock. You can evaluate the broader cash conversion pipeline across receivables, payables, and inventory using our cash conversion cycle calculator.
Key Differences: COGS vs. Operating Expenses (OPEX)
| Cost Category | Included in COGS | Operating Expense (OPEX) |
|---|---|---|
| Direct Raw Materials | Yes (Direct cost of production) | No |
| Direct Assembly Labor | Yes (Factory floor workforce) | No |
| Inbound Freight & Customs | Yes (Cost to receive inventory) | No |
| Marketing & Advertising | No | Yes (Selling expense) |
| Administrative Salaries & Rent | No | Yes (General and administrative) |
Frequently asked questions
What is the difference between COGS and operating expenses (OPEX)?
Why is ending inventory subtracted in the COGS formula?
How do inventory valuation methods (FIFO vs. LIFO) impact COGS?
Do service-based businesses report Cost of Goods Sold?
How does COGS affect business income taxes?
What is a healthy Gross Profit Margin and COGS ratio?
Resources and references
The formulas and methods in this calculator were checked against these independent sources.