accounting calculators

Cost of Goods Sold Calculator

Calculates Cost of Goods Sold (COGS) using beginning inventory, purchases, direct labor, overhead, and ending inventory. Essential for income statements, gross profit analysis, and tax filings.

About this calculator

Cost of Goods Sold represents the direct costs attributable to goods a business sold during a period. The formula used here is: COGS = Beginning Inventory + Purchases + Direct Labor + Manufacturing Overhead − Ending Inventory. Beginning inventory is the stock on hand at the start of the period; purchases and production costs (direct labor and overhead) are added; ending inventory — what remains unsold — is subtracted, isolating the cost of what was actually sold. COGS appears directly on the income statement, and Gross Profit = Revenue − COGS. Accurate COGS is critical because it directly affects gross margin, taxable income, and pricing decisions. Manufacturers include direct labor and overhead, while retailers typically only enter purchases without those production cost lines.

How to use

A manufacturer starts the quarter with $30,000 in inventory, buys $50,000 in raw materials, incurs $20,000 in direct labor and $10,000 in manufacturing overhead, and ends with $15,000 in inventory. COGS = $30,000 + $50,000 + $20,000 + $10,000 − $15,000 = $95,000. If revenue for the quarter was $150,000, Gross Profit = $150,000 − $95,000 = $55,000, a gross margin of about 36.7%. Enter your own figures to instantly see COGS and calculate your gross profit margin.

Frequently asked questions

What costs should be included in Cost of Goods Sold versus operating expenses?

COGS should only include costs directly tied to producing the goods sold — raw materials, direct labor, and manufacturing overhead such as factory utilities and equipment depreciation. Operating expenses (OPEX), by contrast, cover selling, general, and administrative costs like marketing, office rent, and executive salaries that support the business overall but aren't tied to individual units produced. Misclassifying OPEX as COGS inflates gross profit and distorts the income statement. The IRS and GAAP accounting standards both provide detailed guidance on proper cost classification, and errors can trigger audits or restatements.

How does ending inventory affect Cost of Goods Sold and net income?

Ending inventory and COGS are inversely related: a higher ending inventory means fewer goods are counted as sold, which lowers COGS and raises gross profit and net income. Conversely, undervaluing or underreporting ending inventory artificially increases COGS and reduces taxable income. This is why inventory valuation methods — FIFO (First In, First Out), LIFO (Last In, First Out), and weighted average cost — matter significantly. During periods of rising prices, FIFO results in lower COGS and higher profit, while LIFO does the opposite. Companies must apply their chosen method consistently across periods.

Why is calculating COGS accurately important for small business owners?

COGS directly determines gross profit, which is one of the most important metrics lenders, investors, and buyers use to evaluate business health and pricing power. Overstating COGS understates profit and may cause a business owner to miss growth opportunities or underprice products. Understating COGS overstates profit, leads to unexpected tax liabilities, and can mislead stakeholders. For tax purposes, the IRS requires accurate COGS reporting on Schedule C (sole proprietors) or corporate returns, and errors can result in penalties. Tracking COGS correctly also helps identify whether production costs are rising faster than revenue — an early warning sign of margin compression.