COGS Calculator: True Manufacturing Cost
Enter your inventory values, direct production costs, and optional sales revenue to compute your Cost of Goods Sold and gross profit margin instantly.
Include factory rent, utilities, and production equipment depreciation.
The Complete Guide to Calculating Cost of Goods Sold
COGS is one of the most consequential numbers on your income statement. It separates production spend from overhead, determines gross margin, drives inventory valuation, and directly affects taxable income. Getting it right requires understanding exactly which costs belong inside the COGS formula - and which do not.
How to Use This Calculator
Start with the Inventory Valuations panel. Enter the dollar value of inventory you held at the beginning of the period (from last period's balance sheet) and the value you physically counted or recorded at period end. Next, fill in Manufacturing Costs: what you paid for raw materials, how much you spent on direct production labor, and the total of your indirect factory costs (overhead). Finally, add Total Sales Revenue if you want gross profit and gross margin calculated alongside COGS. All results update in real time - no Submit button required.
The COGS Formula Explained
The calculation flows in three stages:
Cost of Goods Available for Sale = Beginning Inventory + Total Manufacturing Costs
COGS = Cost of Goods Available for Sale - Ending Inventory
Think of it this way: you started the period with some inventory already on hand, added everything you produced or purchased, and then subtract what you still have left unsold. The difference is precisely what you consumed to generate your sales.
What Belongs in Each Input Field
Beginning Inventory: The total cost of finished goods, work-in-progress, and raw materials on hand at period start. Pull this directly from last period's balance sheet. For a new business this is zero.
Direct Materials: All raw material purchases made during the period - including inbound freight and import duties if they are part of the landed cost. Do not include materials that were purchased but remain in raw materials inventory at period end; those will be captured in the ending inventory figure.
Direct Labor: Gross wages (before employer payroll taxes) paid to workers whose time you can trace directly to producing goods. Machine operators, assembly workers, welders, and line workers qualify. Maintenance staff and supervisors typically go in overhead.
Manufacturing Overhead: Every other factory cost. Common items include: factory lease payments, building utilities (electricity, gas, water), production equipment depreciation, insurance on factory assets, indirect materials (lubricants, cleaning supplies, safety gear), and wages for indirect workers like maintenance and quality assurance.
Ending Inventory: A physical count (or perpetual system balance) of the cost tied up in unsold goods at period close - including finished goods, goods in process, and raw materials not yet consumed.
COGS vs. Operating Expenses: A Critical Distinction
COGS captures only the cost of production. Everything else goes below the gross profit line as operating expenses: executive salaries, accounting fees, advertising spend, office rent, software subscriptions, and shipping costs on outbound orders to customers (unless you include them in product cost by policy). Misclassifying operating expenses as COGS inflates COGS, deflates gross margin, and understates operating expenses - distorting every ratio analysts use to evaluate your business.
Why Ending Inventory Accuracy Is So Important
Because ending inventory reduces COGS, a counting error flows directly to the bottom line. An overcount makes COGS too low, boosting reported profit - and your tax bill. An undercount does the opposite. For businesses with significant inventory, a disciplined physical count at period close (or a robust perpetual system with regular cycle counts) is not optional. The IRS has specific inventory valuation rules, and auditors will scrutinize your methodology.