Use this calculator to find your COGS:
Enter your beginning inventory, purchases or production costs, and ending inventory. Add your revenue and Click calculate.
AI Analysis
Click the AI button after calculating. It checks your margin health and tells you which cost is killing profit

The manufacturing COGS formula is: Beginning Finished Goods Inventory + Cost of Goods Manufactured (COGM) – Ending Finished Goods Inventory. COGM includes all direct materials, direct labor, and factory overhead costs incurred during the period.
What Are Direct Production Costs?
It represents the direct expenses of producing the goods a company sold during a period. Think of it like operating an airline. Your total spending includes the aircraft, crew salaries, and all the fuel. COGS, however, is only the cost of fuel burned on flights with paying passengers. It excludes fuel still in the tanks (your inventory). It also excludes marketing costs (your operating expenses).
In an industrial setting, COGS includes the cost of raw materials. It also covers the labor to assemble them and the factory overhead for items that have been sold to customers.

The Full Calculation for Cost of Sales: A Step-by-Step Guide
At its highest level, the equation is straightforward. It tracks the movement of products that are ready for sale.
Cost of Sales = Beginning Finished Goods Inventory + Cost of Goods Manufactured (COGM) – Ending Finished Goods Inventory
Let’s look at each part:
- Beginning Finished Goods Inventory: This is the value of all products you had ready to sell at the start of the period.
- Cost of Goods Manufactured (COGM): This is the total expense to produce all goods completed during the period. They have moved from the factory floor to the warehouse. This is the most complex component, which we will break down next.
- Ending Finished Goods Inventory: This is the value of complete products that remained unsold at the period’s end.

The Core Component: Finding the Cost of Goods Manufactured (COGM)
Before you can find your cost of sales, you must determine the Cost of Goods Manufactured (COGM).
This figure represents the total expense for products that finished the production process. The structure is:
COGM = Beginning Work-in-Process (WIP) Inventory + Total Production Expenses – Ending Work-in-Process (WIP) Inventory
- Work-in-Process (WIP) Inventory: These are partially completed goods on your factory floor. You account for the value of WIP at the beginning and end of the period.
- Total Production Expenses: This is the sum of all direct costs from the period. It’s the heart of the computation.
Breaking Down Total Production Expenses
Total Production Expenses consist of three primary categories. Calculating these accurately is the foundation of a correct cost of sales figure.

Direct Materials
These are the raw materials that become part of the final product. To find the cost of materials used, you must account for inventory changes with this method:
Cost of Direct Materials Used equals Beginning Raw Materials + Raw Material Purchases – Ending Raw Materials.
Direct Labor
This is the wage cost for employees who physically turn raw materials into finished products. People often confuse direct and indirect labor.
- Direct Labor: A welder on the assembly line or a machine operator. Their work is tied to a specific product.
- Indirect Labor: A factory supervisor or a maintenance technician. Their work supports production but isn’t tied to a single unit. Indirect labor is part of Factory Overhead.

Factory Overhead
This category includes all indirect costs needed to run the factory. It’s every production expense that isn’t a direct material or direct labor. Examples include:
- Indirect materials (lubricants, cleaning supplies)
- Indirect labor (supervisor and maintenance salaries)
- Factory utilities (electricity, water)
- Factory rent or building depreciation
- Equipment depreciation
It is vital to understand that Selling, General, and Administrative (SG&A) expenses are not part of factory overhead. Costs like marketing salaries or corporate office rent are operating expenses, not production costs.
A Practical Example: Calculating Production Expenses Step-by-Step
Concepts are helpful, but numbers make it real. Let’s walk through a complete example for a furniture maker.
First, Calculate Material Costs
We determine the value of the wood, screws, and fabric used.
- Beginning Raw Materials Inventory: $10,000
- (+) Raw Material Purchases: $25,000
- (-) Ending Raw Materials Inventory: $8,000
- Cost of Direct Materials Used: $27,000
Next, Find Total Production Expenses
We add labor and overhead to the material cost.
- Cost of Direct Materials Used: $27,000
- (+) Direct Labor: $40,000
- (+) Factory Overhead: $20,000
- Total Production Expenses: $87,000
Then, Determine the Cost of Goods Manufactured (COGM)
Now, we account for the partially finished furniture on the factory floor (WIP).
- Beginning WIP Inventory: $15,000
- (+) Total Production Expenses: $87,000
- (-) Ending WIP Inventory: $12,000
- Cost of Goods Manufactured: $90,000
This $90,000 represents the total cost of all furniture completed during the period.
Finally, Calculate the Cost of Sales
We use the COGM figure to find the cost of the furniture that was actually sold.
- Beginning Finished Goods Inventory: $30,000
- (+) Cost of Goods Manufactured: $90,000
- (-) Ending Finished Goods Inventory: $25,000
- COGS: $95,000
The final cost of sales for the period is $95,000. This number can now be used on the income statement to determine gross profit.
Using Production Cost Insights to Boost Profitability

Knowing your cost of sales is one thing. Using it to make your business more profitable is another. This analysis provides a roadmap for cost reduction.
Strategy for Reducing Direct Material Costs
Scrutinize your material expenses. If they are climbing, consider these actions:
- Negotiate Better Pricing: Approach suppliers to discuss bulk discounts or better payment terms.
- Explore Alternatives: Research other materials that could reduce costs without harming product quality.
- Improve Inventory Management: Implement a system like Just-in-Time (JIT) to minimize waste and reduce storage costs.
Strategy for Optimizing Direct Labor Costs
Analyze your direct labor as a percentage of total expenses. If it’s too high, you can:
- Invest in Training: Well-trained employees work more efficiently and make fewer costly errors.
- Optimize Workflow: Analyze your factory layout to reduce unnecessary movement and streamline the process.
- Consider Automation: Identify repetitive tasks that could be automated to improve speed and consistency.
Strategy for Controlling Factory Overhead
Overhead can be a source of hidden expenses. Break it down to find opportunities:
- Conduct an Energy Audit: Simple changes like LED lighting or more efficient machinery can create significant savings.
- Implement Preventative Maintenance: A structured maintenance schedule reduces expensive emergency repairs and downtime.
- Review Indirect Roles: Ensure support roles are structured efficiently without excess staffing.
Common Pitfalls: Avoiding Expensive Errors in Your Calculation

A small error in your computation can have a large effect on your financial statements. Be aware of these common issues:
- Confusing Production Costs with SG&A: Always exclude non-production costs from your calculation. Marketing, sales, and administrative salaries belong in a separate category.
- Ignoring Inventory Valuation Methods: The value of your inventory depends on your accounting method. The main methods are First-In, First-Out (FIFO), Last-In, First-Out (LIFO), and Weighted Average. The method you choose can alter your cost of sales and reported profit. Consistency is key.
- Misclassifying Costs: Incorrectly labeling an indirect cost as direct (or vice versa) will distort your understanding of what drives product expenses. A clear system for classifying expenses is foundational.
Variations by Industry
The formula works the same across manufacturing types. Beginning inventory plus production costs minus ending inventory equals COGS.
Discrete manufacturing (furniture, electronics, cars) tracks individual units or batches. You count chairs, laptops, engines.
Process manufacturing (chemicals, food, oil) tracks continuous production. You measure gallons, tons, liters. The formula stays identical. The tracking method changes.

How Often Should You Calculate it?
Most manufacturers calculate COGS monthly. This gives you margin trends fast enough to fix problems before they compound.
Quarterly works for stable operations with predictable costs. Annual is too slow. By the time you see a margin problem, you’ve lost a year of profit.
Monthly calculation catches material price spikes, labor inefficiency, and overhead creep while you can still act.
Absorption Costing vs Variable Costing
The formula in this article uses absorption costing. All factory overhead gets included: Rent, utilities, depreciation, indirect labor—everything production-related goes into product cost.
Variable costing treats fixed overhead differently. Only variable production costs (materials, direct labor, variable overhead) go into COGS. Fixed overhead becomes a period expense like SG&A.
Absorption costing is required for external financial statements. Variable costing is used internally for pricing and profitability decisions. Most manufacturers track both.
ERP Systems
ERP systems (SAP, Oracle, NetSuite, Dynamics) calculate COGS automatically once you configure cost centers and overhead allocation rules.
You still need to understand the formula. The system follows the logic you program. Wrong allocation rules produce wrong COGS. Garbage in, garbage out.
Manual calculation works for small operations. ERP becomes necessary when you have multiple products, complex overhead, or high transaction volume.
How Factory Overhead Gets Allocated
Factory overhead is a pool of indirect costs. You need a method to split it across products.
Common allocation bases:
- Machine hours: Good for automated production
- Direct labor hours: Good for labor-intensive assembly
- Units produced: Simple but ignores complexity differences
Example: You have $20,000 overhead and ran machines for 1,000 hours. Overhead rate is $20 per machine hour. A product using 5 machine hours gets $100 overhead allocated to it.
Your allocation method changes per-unit cost. A complex product using more machine hours carries more overhead. A simple product using less time carries less.
Wrong allocation hides which products actually make money.
FAQ

What is the difference between Manufactured and Sold?
COGM measures production cost for everything you finished making during a period, whether you sold it or not. COGS measures cost only for units that actually sold.
COGM feeds into COGS. You need to know what you manufactured before you can calculate what sold.
Example: You manufactured $50,000 worth of product this month. You sold $40,000 worth. COGM is $50,000. COGS is $40,000. The $10,000 difference sits in ending inventory.
Are shipping costs included?
Inbound shipping (freight-in) goes into COGS. This is the cost to get raw materials to your factory. It increases the cost basis of inventory.
Outbound shipping (freight-out) does not go into COGS. This is the cost to ship finished goods to customers. It belongs in selling expenses under operating costs.
Why it matters: Misclassifying freight-out as COGS inflates your gross margin. Your margin looks healthier than it is. You make bad pricing decisions.
How does it affect gross profit and net income?
COGS directly reduces gross profit. The formula is Revenue minus COGS equals Gross Profit.
Higher COGS means lower gross profit. Lower gross profit means less money to cover operating expenses like marketing, salaries, and rent.
Gross profit minus operating expenses equals net income. COGS hits your bottom line twice: first through gross profit, then through what’s left to cover everything else.
A 10% increase in COGS with flat revenue cuts gross profit by 10%. If your operating costs stay the same, net income drops even faster. Small COGS problems become big profit problems.
How do I handle scrap and waste?
Normal scrap gets absorbed into material cost. Abnormal waste gets expensed separately.
Normal scrap: You cut fabric for shirts. 5% waste is expected. That waste cost spreads across all shirts produced. It increases per-unit material cost.
Abnormal waste: A machine malfunction ruins $5,000 worth of materials. That’s not normal production cost. Expense it separately as a loss, not COGS.
The difference matters. Normal waste is built into product cost and pricing. Abnormal waste is a one-time hit that doesn’t reflect true production economics.
Does it include depreciation?
Yes, but only for production equipment. Factory machinery depreciation goes into factory overhead, which becomes part of COGS.
Office equipment depreciation does not go into COGS. A computer used by accounting staff is SG&A expense, not production cost.
The test: Does the asset help produce the product? If yes, its depreciation is COGS. If no, it’s operating expense.
How do warranty costs affect COGS?
Warranty costs don’t go into COGS at the time of sale. They’re estimated and recorded as a separate liability.
When you sell a product, you estimate future warranty expense and record it immediately. This shows on the income statement below gross profit, not inside COGS.
Actual warranty work (parts and labor) gets charged against the warranty liability account when it happens. COGS stays unchanged.
Why: COGS measures production cost, not post-sale support cost. Mixing them distorts manufacturing efficiency.



