Free Financial Tool

    COGS Calculator: Cost of Goods Sold

    Calculate your Cost of Goods Sold using the periodic inventory method. Essential for determining gross profit margin and product profitability.

    By Valuefy TeamCFA, Finance AnalystsLast Updated: January 20267 min read

    Try an example:

    Enter Inventory Data
    Input your inventory and purchase figures for the accounting period

    Formula:

    COGS = Beginning Inventory + Net Purchases - Ending Inventory

    Cost of Goods Sold

    Enter your inventory data to calculate Cost of Goods Sold.

    What Is Cost of Goods Sold (COGS)?

    Cost of Goods Sold (COGS) represents the direct costs attributable to producing the goods a company sells during a specific accounting period. According to the Investopedia financial glossary, COGS is a critical component of the income statement that directly impacts gross margin and overall profitability. Reducing COGS improves the gross margin impact on every dollar of revenue, ultimately flowing through to stronger bottom-line results.

    For manufacturers, COGS includes three primary components: direct materials (raw materials physically incorporated into finished products), direct labor (wages paid to workers directly involved in production), and manufacturing overhead (factory costs like equipment depreciation, utilities, and supplies). Service companies typically use "Cost of Services" or "Cost of Revenue" instead, which includes direct labor and materials consumed in providing services.

    The relationship between COGS and inventory is fundamental to financial reporting. Under the periodic inventory system, COGS is calculated at the end of each accounting period using the formula: Beginning Inventory + Net Purchases - Ending Inventory. This approach, while simpler than perpetual inventory tracking, requires accurate physical inventory counts to ensure financial statement reliability.

    Understanding COGS is essential for pricing decisions, as it establishes the minimum price floor before considering operating expenses and desired profit margins. Companies must cover COGS before generating any gross profit. Use the Break-Even Calculator to determine the sales volume needed to cover both COGS and fixed operating costs.

    How Do You Calculate COGS?

    COGS = Beginning Inventory + Net Purchases - Ending Inventory

    Where Net Purchases is calculated as:

    Net Purchases = Purchases + Freight-In - Returns - Discounts

    Step-by-Step Process

    Step 1: Determine Beginning Inventory

    Begin with the ending inventory value from the previous accounting period. This becomes your starting point and should match exactly with the previous period's balance sheet.

    Step 2: Calculate Net Purchases

    Sum all inventory purchases during the period. Add freight-in costs (shipping to receive inventory), then subtract purchase returns and allowances, plus any purchase discounts taken for early payment.

    Step 3: Calculate Goods Available for Sale

    Add Beginning Inventory + Net Purchases. This represents the total value of all inventory that could potentially have been sold during the accounting period.

    Step 4: Determine Ending Inventory

    Conduct a physical inventory count or use perpetual inventory records. Value inventory using your chosen costing method (FIFO, LIFO, or Weighted Average).

    Step 5: Calculate COGS

    Subtract Ending Inventory from Goods Available for Sale. The result is your Cost of Goods Sold for the period. Use this figure alongside your margin targets to assess profitability.

    FIFO vs LIFO: Which Inventory Costing Method Should You Use?

    The choice of inventory costing method significantly impacts COGS, gross profit, and income taxes. Understanding these methods is crucial for accurate inventory management and financial reporting.

    FIFO (First-In, First-Out)

    • Oldest inventory costs flow to COGS first
    • Lower COGS when prices rise = higher profits
    • Ending inventory reflects current costs
    • Required under IFRS, allowed under US GAAP
    • Best for perishable goods and fashion

    LIFO (Last-In, First-Out)

    • Newest inventory costs flow to COGS first
    • Higher COGS when prices rise = lower taxes
    • Ending inventory at older, lower costs
    • Only allowed under US GAAP, not IFRS
    • Common for non-perishable commodities

    Weighted Average Cost Method

    The weighted average method calculates a single average cost for all units available for sale. This approach smooths out price fluctuations and is particularly useful for homogeneous products where individual units are indistinguishable. The average cost is recalculated after each purchase under the perpetual system or once per period under the periodic system.

    In periods of rising prices (inflation), LIFO produces higher COGS and lower taxable income, while FIFO shows higher profits but results in higher tax liability. The choice impacts not only taxes but also financial ratios used by lenders and investors in profitability analysis.

    How Does COGS Work in Real-World Examples?

    Manufacturing Company

    An electronics manufacturer has: Beginning Inventory of $2,000,000, Purchases of $8,000,000, Freight-In of $200,000, and Ending Inventory of $2,500,000.

    Net Purchases = $8,000,000 + $200,000 = $8,200,000

    Goods Available = $2,000,000 + $8,200,000 = $10,200,000

    COGS = $10,200,000 - $2,500,000 = $7,700,000

    With revenue of $12,000,000, this yields a COGS ratio of 64.2%, within the typical 55-75% range for manufacturing. The gross margin would be 35.8%.

    Retail Business

    A clothing retailer shows: Beginning Inventory of $300,000, Purchases of $1,500,000, Purchase Returns of $50,000, Purchase Discounts of $30,000, and Ending Inventory of $350,000.

    Net Purchases = $1,500,000 - $50,000 - $30,000 = $1,420,000

    Goods Available = $300,000 + $1,420,000 = $1,720,000

    COGS = $1,720,000 - $350,000 = $1,370,000

    Taking purchase discounts reduced COGS by $30,000. This is why early payment terms like "2/10 net 30" can significantly improve profitability.

    Wholesale Distributor

    A food wholesaler has: Beginning Inventory of $1,500,000, Purchases of $12,000,000, Freight-In of $400,000, and Ending Inventory of $1,800,000.

    Net Purchases = $12,000,000 + $400,000 = $12,400,000

    Goods Available = $1,500,000 + $12,400,000 = $13,900,000

    COGS = $13,900,000 - $1,800,000 = $12,100,000

    Wholesalers typically have higher COGS ratios (75-85% of revenue) but make profit through volume. Track inventory turnover to ensure capital efficiency.

    What Are the Limitations of COGS Calculation?

    While COGS is fundamental to financial analysis, several limitations affect its accuracy and comparability across companies and time periods.

    Costing Method Variability

    Different inventory costing methods (FIFO, LIFO, Weighted Average) can produce significantly different COGS figures for identical business operations. This makes cross-company comparisons difficult without standardization.

    Overhead Allocation Challenges

    Allocating manufacturing overhead to products requires judgment. Different allocation methods (machine hours, labor hours, activity-based costing) produce different COGS per unit, affecting pricing decisions and profitability analysis.

    Inventory Valuation Errors

    COGS accuracy depends on correct inventory counts and valuations. Counting errors, obsolete inventory not written down, or theft (shrinkage) can distort COGS and gross profit figures.

    Period-End Timing Issues

    The periodic inventory method calculates COGS only at period end. This can delay recognition of cost overruns or inventory problems until financial statements are prepared, reducing management's ability to respond quickly.

    Excludes Other Direct Costs

    Traditional COGS may not capture all costs of getting products to customers. Outbound freight, sales commissions, and fulfillment costs are typically treated as operating expenses but directly relate to sales.

    COGS by Industry: Gross Margin Benchmarks for Retail, SaaS, and Manufacturing

    Pair this tool with the Vendor Management Tool and the Capacity Calculator to cross-check inputs. For strategic context, read our e-commerce valuation case study and explore the Operations & Inventory tools hub.

    COGS represents direct production costs and is essential for calculating gross margin impact. Lower COGS relative to revenue indicates better cost efficiency and pricing power, and every dollar saved in COGS flows directly to bottom-line profitability.

    The inventory costing method (FIFO, LIFO, or Weighted Average) significantly impacts reported COGS and profits. FIFO shows higher profits in inflationary periods; LIFO reduces taxable income.

    Net Purchases includes freight-in costs but subtracts returns and discounts. Taking early payment discounts directly reduces COGS and improves profitability.

    Accurate ending inventory is critical for COGS calculation. Regular physical counts and proper valuation procedures ensure reliable financial statements and prevent inventory shrinkage issues.

    Use COGS alongside inventory turnover to assess overall inventory efficiency. High COGS combined with low turnover may indicate slow-moving or obsolete inventory.

    Frequently Asked Questions

    Need a complete business valuation?

    Get a professional valuation of your company with AI-powered DCF analysis, market comparables, and actionable insights to understand your true business value.