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.

Production Cost Inputs
Inventory Valuations
$
$
Manufacturing Costs (Purchases and Production)
$
$
$

Include factory rent, utilities, and production equipment depreciation.

Sales Data (Optional - for gross profit and margin)
$
Total Cost of Goods Sold (COGS)
$0.00
Enter your values above to calculate
Cost of Goods Available for Sale
$0.00
Beginning Inventory + Total Mfg. Costs
Pre-Sale Cost Basis
Total Manufacturing Costs
$0.00
Materials + Labor + Overhead
Production Spend
Gross Profit
N/A
Enter Sales Revenue to calculate
Awaiting Revenue
Key Terms Explained
Cost of Goods Sold (COGS)
The direct costs incurred to produce the goods sold during a period. Calculated as: Beginning Inventory + Purchases and Production Costs - Ending Inventory.
Beginning Inventory
The dollar value of all unsold inventory on hand at the start of an accounting period. Equal to the prior period's ending inventory balance.
Ending Inventory
The dollar value of unsold inventory remaining at the close of an accounting period. Determined by a physical count or perpetual inventory system.
Direct Materials
Raw materials or components that are physically incorporated into the finished product and can be traced directly to each unit produced (e.g., steel for a manufacturer, flour for a bakery).
Direct Labor
Wages paid to workers who are directly involved in production and whose time can be traced to specific units or batches (e.g., assembly line workers, machinists).
Manufacturing Overhead
All indirect costs of production not traceable to individual units - including factory rent, utilities, equipment depreciation, maintenance, and indirect labor such as supervisors and quality control.
Gross Profit
Revenue minus COGS. Measures how efficiently a company produces goods before accounting for operating expenses, taxes, or interest.
Gross Profit Margin
Gross Profit divided by Revenue, expressed as a percentage. Shows what fraction of each dollar of sales remains after covering the direct cost of production.

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:

Total Manufacturing Costs = Direct Materials + Direct Labor + Manufacturing Overhead
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.

Frequently Asked Questions

COGS only captures costs directly tied to producing the goods you sold - raw materials, factory labor, and manufacturing overhead like factory rent and equipment depreciation. Administrative salaries, office rent, marketing campaigns, and sales commissions are period costs, not product costs. They appear below gross profit on the income statement as operating expenses (OpEx). Mixing them into COGS would distort your gross margin and make it impossible to evaluate production efficiency separately from how you run the business.
Ending inventory directly drives COGS: COGS equals beginning inventory plus purchases minus ending inventory. If your ending inventory is overstated - counted higher than it really is - COGS will be understated, which inflates gross profit and taxable income, meaning you pay more tax than you owe. If ending inventory is understated, COGS is overstated, which deflates profit and reduces taxes - but this is misreporting. An accurate physical count at the end of every period is essential for correct financial statements and tax filings.
COGS is the direct cost of producing the goods or services you sold in a period. It sits at the top of the income statement and is subtracted from revenue to produce gross profit. Operating expenses (OpEx) are the costs of running the business that are not tied to production - things like salaries for non-production staff, rent for office space, marketing budgets, software subscriptions, and professional fees. OpEx is subtracted from gross profit to arrive at operating income (EBIT). Understanding this distinction helps you spot whether profitability problems stem from the production floor or from overhead spending.
Manufacturing overhead includes all indirect production costs that cannot be traced directly to a single unit of product. Common items include factory rent and utilities, production equipment depreciation, indirect materials (lubricants, cleaning supplies), wages for maintenance and quality control staff, and factory insurance. To calculate a period's total overhead, add every factory-related expense that is not direct materials or direct labor. For costing individual products, divide total overhead by an allocation base such as total machine hours or direct labor hours to get an overhead rate per unit.
Gross margin benchmarks vary significantly by industry. Discrete manufacturers of industrial goods often run 20 to 35 percent gross margins. Consumer goods manufacturers typically land in the 30 to 50 percent range, while software and high-margin tech products can exceed 70 percent. The most useful benchmark is your own historical trend and your direct competitors. A declining gross margin over several periods signals rising input costs, pricing pressure, or production inefficiency that demands attention, regardless of the absolute percentage.
This calculator provides estimates for educational and planning purposes only. It is not financial, accounting, or tax advice. COGS accounting rules vary by inventory costing method (FIFO, LIFO, weighted average) and applicable accounting standards. Consult a licensed CPA or financial professional for guidance specific to your business.