How do you calculate cost of goods sold (COGS)? You calculate COGS by adding the value of inventory available for sale to the value of purchases made during the period and then subtracting the value of inventory remaining at the end. This figure reveals the direct cost of producing or purchasing the products a business sold, helping owners measure gross profit, price products accurately, and control expenses.
Not the most exciting part, but easily the most useful.
Introduction to Cost of Goods Sold
Cost of goods sold, often shortened to COGS, represents the direct costs tied to inventory that has been sold to customers. It is reported on the income statement and is subtracted from revenue to calculate gross profit Simple, but easy to overlook..
As an example, a retailer that sells handmade candles must include the cost of wax, fragrance, containers, labels, and other materials used in each candle. If the retailer buys finished products from a manufacturer instead, COGS may simply be the purchase price of those products.
COGS is different from total operating expenses. Rent for a corporate office, employee salaries in administration, advertising, insurance, and shipping charges related to delivering customer orders may be operating expenses rather than COGS. The key question is whether a cost is directly connected to acquiring or producing the goods currently being sold And that's really what it comes down to..
People argue about this. Here's where I land on it.
The Basic COGS Formula
The standard formula for a business using a periodic inventory system is:
Beginning inventory + purchases during the period − ending inventory = COGS
Each part has a specific meaning:
- Beginning inventory: The value of unsold goods at the start of the accounting period.
- Purchases: Goods acquired for resale during the period. For a manufacturer, this may include raw materials and other production costs.
- Ending inventory: The value of unsold goods still on hand at the period’s end.
- COGS: The cost assigned to the goods that were sold.
The logic is simple. And beginning inventory and purchases show what was available to sell. Subtracting what remains leaves the cost of what was sold Simple, but easy to overlook..
Step-by-Step: How to Calculate Cost of Goods Sold
1. Choose an Accounting Period
Select the period being measured, such as a month, quarter, or year. The same time period must be used consistently for beginning inventory, purchases, and ending inventory.
2. Determine Beginning Inventory
Find the value of inventory carried over from the previous period. If the prior period’s ending inventory was recorded correctly, it normally becomes the current period’s beginning inventory.
3. Add Purchases and Direct Production Costs
Record all purchases made during the period. Businesses may also need to include freight-in, import duties, or other costs required to bring purchased goods to their selling location.
Manufacturers generally include additional production expenses, such as:
- Raw materials
- Direct labor
- Factory utilities
- Machine depreciation
- Factory supplies
- Production-related overhead
These costs may not appear in a simple purchases account, but they contribute to the cost of goods available for sale.
4. Count and Value Ending Inventory
Perform a physical inventory count and determine the value of unsold products. The ending inventory must be recorded before COGS can be calculated accurately Which is the point..
Inventory can be valued using methods such as:
- Specific identification
- First-in, first-out (FIFO)
- Last-in, first-out (LIFO)
- Weighted-average cost
The chosen method must be applied consistently and should match the business’s actual flow of goods where possible.
5. Subtract Ending Inventory From Goods Available for Sale
First calculate the cost of goods available for sale:
Beginning inventory + purchases or production costs = goods available for sale
Then apply the main formula:
Goods available for sale − ending inventory = COGS
Simple COGS Example
Assume a shop sells handmade candles. During the month, it purchases $5,000 of wax, containers, labels, and fragrance. Still, at the start of January, its inventory is worth $2,000. At the end of January, an inventory count shows that unsold candles cost $3,000 Took long enough..
Real talk — this step gets skipped all the time.
Using the formula:
$2,000 + $5,000 − $3,000 = $4,000
The shop’s COGS for January is $4,000.
If the shop earned $9,000 in candle revenue, its gross profit would be:
$9,000 revenue − $4,000 COGS = $5,000 gross profit
The gross profit margin is:
$5,000 ÷ $9,000 = approximately 55.6%
This calculation does not show the business’s final net profit. Rent, payroll, software subscriptions, and other operating expenses must still be considered Small thing, real impact..
COGS for a Manufacturer
Manufacturers need a more detailed calculation because products move through several production stages. The basic manufacturer formula is:
Beginning finished-goods inventory + cost of goods manufactured − ending finished-goods inventory = COGS
To calculate cost of goods manufactured (COGM), manufacturers usually follow this sequence:
- Begin with raw-material inventory.
- Add raw-material purchases.
- Subtract ending raw-material inventory to find raw materials used.
- Add direct labor and manufacturing overhead.
- Adjust for beginning and ending work-in-process inventory.
- Calculate the total cost of goods manufactured.
A simplified manufacturer formula is:
Beginning work in process + raw materials used + direct labor + manufacturing overhead − ending work in process = cost of goods manufactured
As an example, if beginning finished-goods inventory is $18,000, cost of goods manufactured is $62,000, and ending finished-goods inventory is $24,000, COGS is:
**$18,000 + $62,000 − $24,000 = $
$56,000**
This $56,000 represents the total cost of finished products that were sold during the period, which will be matched against the manufacturer's sales revenue to determine gross profit.
Why COGS Matters for Business Performance
Understanding and accurately calculating COGS is crucial for several business reasons:
Pricing Strategy: Knowing your actual product costs helps set prices that ensure profitability while remaining competitive in the market.
Inventory Management: Tracking COGS reveals which products are moving quickly and which are sitting on shelves, helping optimize stock levels and reduce waste.
Financial Analysis: Investors and stakeholders use COGS trends to assess operational efficiency and cost control effectiveness over time Simple, but easy to overlook..
Tax Implications: COGS directly reduces taxable income, making accurate calculation essential for tax compliance and planning Not complicated — just consistent..
Performance Measurement: Comparing COGS to industry benchmarks helps identify opportunities for improvement in procurement, production, or supply chain management.
Best Practices for Accurate COGS Calculation
To maintain reliable COGS figures, businesses should implement systematic approaches:
- Conduct regular inventory counts, ideally using cycle counting methods
- Use consistent costing methodologies across all accounting periods
- Implement inventory management software to track purchases and sales in real-time
- Train staff on proper inventory handling and documentation procedures
- Reconcile physical counts with accounting records periodically
- Maintain detailed records of all inventory-related transactions
By following these practices, businesses can ensure their COGS calculations remain accurate and meaningful for decision-making purposes. Whether operating as a simple retailer or complex manufacturer, understanding the true cost of goods sold provides the foundation for sound financial management and sustainable business growth Most people skip this — try not to..
Common Pitfalls in COGS Calculation
Even with a clear formula, many manufacturers encounter subtle errors that skew their cost figures. Recognizing these traps early can prevent costly misstatements Surprisingly effective..
- Mixing Period Costs with Product Costs – Expenses such as sales commissions, administrative salaries, or advertising should never be included in COGS. They belong to operating expenses and can inflate the cost of goods sold if mistakenly added.
- Inconsistent Inventory Valuation Methods – Switching between FIFO, LIFO, and weighted‑average without proper disclosure creates volatility in COGS from one period to the next, undermining trend analysis.
- Out‑of‑Date Inventory Counts – Relying on a single annual physical count leaves room for shrinkage, theft, or damage to go unnoticed. Stale data leads to over‑ or under‑stated ending inventories, which directly impacts COGS.
- Ignoring Work‑In‑Process (WIP) Fluctuations – Failing to adjust for changes in WIP can double‑count materials or labor, especially in batch‑or‑custom‑production environments.
- Overlooking Overhead Allocation Errors – Using a single plant‑wide rate for all departments may misallocate indirect costs, causing certain products to appear artificially cheap or expensive.
Leveraging COGS for Strategic Decision‑Making
When COGS is accurate, it becomes a powerful lever for shaping business strategy:
- Dynamic Pricing Models – By understanding the true unit cost, a manufacturer can implement tiered pricing that reflects cost variations across product lines or customer segments.
- Product Mix Optimization – Analyzing COGS by SKU reveals which items contribute the most gross margin. Resources can be shifted toward high‑margin products and low‑margin lines can be re‑engineered or phased out.
- Supplier Negotiation Power – Detailed cost breakdowns enable data‑driven discussions with vendors. If raw‑material costs represent a large share of COGS, a manufacturer can pursue bulk discounts or alternative sourcing.
- Process Improvement Initiatives – Identifying cost drivers—such as excessive scrap or inefficient labor hours—guides targeted lean‑manufacturing projects that directly reduce COGS.
- Capital Investment Justification – Proposed equipment upgrades can be evaluated by projecting their impact on COGS, helping finance teams assess ROI with confidence.
Technology and Automation
Modern ERP and inventory‑management platforms integrate COGS calculation into daily operations, reducing manual errors and providing real‑time visibility.
- Real‑Time Tracking – Barcode or RFID scanning captures material issuances, labor hours, and overhead applications as they happen, feeding directly into the COGS calculation engine.
- Automated Overhead Allocation – Activity‑based costing (ABC) modules assign indirect expenses based on actual resource consumption, delivering a more precise overhead figure.
- Predictive Analytics – Machine‑learning models can forecast raw‑material price fluctuations and suggest optimal inventory levels, helping keep COGS stable amid market volatility.
- Integration with Financial Systems – Seamless data flow between production, inventory, and general‑ledger modules ensures that every adjustment to work‑in‑process or finished goods is reflected instantly in COGS.
Mini‑Case Study: A Mid‑Size Furniture Manufacturer
Background – “Heritage Woods” produces custom oak tables and chairs. In 2022, its COGS was $4.2 million, representing 38 % of revenue, higher than the industry average of 32 %.
Action Plan –
- Implemented a cycle‑counting program using handheld scanners, reducing physical‑count discrepancies from 5 % to 0.8 %.
- Upgraded to an ERP system with ABC overhead allocation, identifying that machining labor was over‑allocated by 12 %.
- Introduced a just‑in‑time (JIT) raw‑material ordering system for high‑turn components, cutting average inventory holding time from 45 days to 22 days.
Results (2023) – COGS fell to $3.6 million (30 % of revenue), a 14 % reduction. Gross profit margin improved from 62 % to 70 %, enabling a 5 % price reduction that increased market share by 8 % without sacrificing profitability.
Key Takeaways
- Accurate CO