Cost of goods sold: What it is and how to calculate COGS
Learn how to calculate cost of goods sold (COGS) to price smarter, forecast margins, and boost profit.

Written by Lena Hanna—Trusted CPA Guidance on Accounting and Tax. Read Lena's full bio
Published Monday 22 December 2025
Table of contents
Key takeaways
- Calculate COGS using the standard formula (Beginning Inventory + Purchases − Ending Inventory) to determine the true direct costs of producing your goods and establish a baseline for profitable pricing decisions.
- Track COGS consistently to make informed decisions about pricing, profitability analysis, inventory management, and tax deductions, as it directly impacts your gross profit margin and business financial health.
- Reduce COGS through strategic supplier negotiations, production process improvements, and inventory optimization to increase profitability without compromising product quality.
- Use COGS alongside other financial metrics like gross profit margin and operating income rather than in isolation, since COGS excludes indirect costs and doesn't provide a complete picture of your business's financial performance.
What is COGS?
Cost of goods sold (COGS) is the total direct cost to produce or purchase the goods your business sells during a specific period. COGS includes all expenses directly tied to creating your products, from raw materials to manufacturing labor.
COGS includes:
- Direct materials
- Direct labor
- Manufacturing overheads
Some businesses, like ecommerce businesses, also include things like freight, storage, sales commissions, or transaction fees if they relate to the costs of selling products.
COGS doesn't include indirect expenses, such as rent, marketing, general administrative overhead, and (often) salaries.
Tracking COGS requires accounting software for running your business and managing your expenses and inventory.
Why COGS is important for small businesses
COGS tracking helps you set profitable prices by revealing the true cost of serving customers. Materials and labor costs are usually straightforward to calculate. Other costs can catch new business owners off guard.
For example, home-based businesses often enjoy strong margins initially. However, COGS increases significantly when you move to dedicated facilities.
Monitoring COGS helps business owners identify and address the things that put pressure on their profit margins.
Accurate COGS tracking drives four critical business decisions:
Pricing
COGS is fundamental in setting product prices and establishing the baseline costs that you must exceed to make a profit. Understanding COGS helps you more easily judge how cost fluctuations affect expenses and when to adjust prices.
Profitability
COGS is directly related to gross profit margin. Reducing COGS while maintaining prices increases gross profit. Even small improvements can significantly affect business profitability.
Keep in mind that COGS is just part of your operating expenses. Your operating income also includes expenses like wages and depreciation.
Inventory management
Analysis of COGS helps you assess your inventory efficiency and identify slow-moving items. This insight helps you optimize your stock levels, reorder points, and product mix to balance demand while minimizing the capital tied up in goods.
Taxes
COGS is a deductible business expense. Tracking and documenting all the components of COGS makes it easier to maximize deductions and provide the necessary audit documents.
Check with your local tax authority for how they handle COGS.
How to calculate COGS
COGS calculation uses two primary methods: the retail formula for businesses that buy and resell products, and the manufacturing formula for businesses that create products from raw materials.
Retail COGS formula
The cost of goods sold formula used by retailers for inventory accounting:
Cost of goods sold formula used by retailers for inventory accounting.
Beginning Inventory + Purchases − Ending Inventory = COGS
The retail COGS formula includes:
- Beginning inventory: the value of inventory at the start of the period
- Purchases: the cost of inventory acquired during the period
- Ending inventory: the value of inventory remaining at the end of the period
The retail COGS formula focuses on inventory values rather than sales quantities. This approach accounts for discarded or damaged inventory that doesn't generate revenue.
Manufacturing COGS formula
The cost of goods sold formula used by manufacturers:
Manufacturers have more complex supply chains. It makes sense for them to add up all the costs on their product’s journey to the customer. Be aware that some choose not to count warehousing or freight.
Raw Materials + Manufacturing Costs + Storage Costs + Freight = COGS
The manufacturing COGS formula includes:
- Raw materials: the direct materials used to produce goods
- Manufacturing costs: costs of production
- Storage costs: expenses from inventory storage
- Freight: any shipping costs for incoming materials or final delivery
Manufacturing COGS includes all production costs because manufacturers have complex supply chains with multiple cost components. Some manufacturers exclude warehousing or freight costs depending on their accounting practices.
Examples of COGS
Retail COGS example:A retail business starts the quarter with $10,000 in inventory and purchases $25,000 worth of goods. At quarter-end, $8,000 in inventory remains.
COGS calculation: $10,000 + $25,000 − $8,000 = $27,000
Manufacturing COGS example:A manufacturer purchases $7,000 in raw materials, spends $3,000 on energy and labor for production, and pays $1,200 for shipping.
COGS calculation: $7,000 + $3,000 + $1,200 = $11,200
COGS accounting methods
Inventory valuation methods directly impact your COGS calculation, and the rules governing them can be complex enough to be contentious. One recent update to inventory accounting was passed by an affirmative vote of five members of the Financial Accounting Standards Board, with two members dissenting. When you sell inventory, its value moves from your balance sheet to your income statement as COGS.
The FIFO (first in, first out) method
FIFO assumes that you sell your oldest inventory items first. This method often results in a COGS that closely matches the physical flow of goods.
When prices rise, FIFO typically leads to a lower COGS and higher reported profits.
The LIFO (last in, first out) method
LIFO assumes the inventory you most recently acquired is sold first. This can lead to higher COGS and lower profits during periods of inflation. LIFO isn't permitted under International Financial Reporting Standards (IFRS) cost-accounting principles, which require inventory to be measured at the lower of cost and net realizable value, and for this reason many countries outside the United States don't allow it.
The average cost method
This method of cost accounting uses the weighted average inventory costs of individual items to value both COGS and your ending inventory. It smooths out price fluctuations and is a middle ground between FIFO and LIFO.
Specific identification method
This method of expense tracking looks at the actual cost of each inventory item. It's typically used for high-value items. While accurate, it can be impractical for businesses that sell lots of similar items.
COGS vs cost of revenue
Cost of revenue (CoR) includes both direct production costs and indirect costs needed to generate revenue, while COGS focuses only on direct production costs.
- COGS includes only the direct costs of producing goods, like materials, labor, and manufacturing expenses. Businesses involved in manufacturing or retail typically use COGS because production expenses are easy to track.
- CoR includes both direct costs and some indirect costs needed for generating business revenue, like variable costs for things like distribution, marketing, and the delivery of products or services to customers.
CoR gives you insights into your cost structure and a more complete view of what it costs to bring your products or services to market. It's therefore more commonly used by services businesses and companies with many indirect or variable costs as well as fixed costs.
COGS vs operating expenses
Operating expenses and COGS serve different purposes in financial analysis. Both represent business costs, but they cover distinct expense categories and provide different insights into your cost structure.
- COGS is tied to the direct costs of producing or purchasing goods that customers buy, like inventory, raw materials for manufacture, and people working on manufacturing goods or delivering services.
- Operating expenses (OpEx) cover a range of expenses beyond manufacturing costs that are essential for the business to run, like rent, the power bill, marketing expenses, and office supplies.
COGS directly affects your business’s gross profit since you’re subtracting it from your business income to calculate the gross margin. It therefore helps you monitor production costs and gauge your profitability.
However, you subtract operating costs from your gross profit to work out your operating income, also known as earnings before interest and tax (EBIT). This shows the cost of managing and running your business overall.
Tips for managing and reducing COGS
Here are some tips to help your small business reduce and manage COGS.
Negotiate with suppliers
Have regular discussions with your suppliers to secure better prices. Consider long-term contracts or bulk purchasing agreements to leverage volume discounts, and don’t hesitate to look for other suppliers who offer more-competitive rates.
Streamline production processes
Analyze your production workflow to identify inefficiencies and reduce waste. Consider investing in automation to decrease labor costs and increase output consistency (but you’ll need to assess the effects on COGS and return on investment (ROI)).
Optimize inventory levels
Use data analytics to accurately forecast demand so you can keep inventory levels optimal. Regularly review your product mix and consider discontinuing slow-moving items.
Reduce freight costs
Explore alternative shipping methods that balance cost and delivery time. For example, by consolidating shipments you can access bulk shipping rates. Try negotiating with carriers for volume discounts or think about a third-party logistics provider to optimize your shipping strategy.
Limitations of COGS
COGS has significant limitations because it only tracks direct production costs. This narrow focus excludes many expenses that impact your business’s overall financial performance.
COGS excludes factors that affect your business’s financial health
COGS can make your business appear more profitable than it actually is because it excludes crucial expenses:
- Indirect costs: marketing, rent, and administrative expenses
- Operating expenses: overhead and sales costs
- Process inefficiencies: operational waste and bottlenecks
These exclusions mean COGS on its own does not give you a complete picture of your financial health.
Use COGS with other metrics for a complete financial health picture
Metrics like your gross profit margin, operating income, and even the cost of sales factor in both direct and indirect costs, and clarify your profitability and operational efficiency. Use them alongside COGS to help you make more informed decisions about pricing, inventory and cost management, and strategies for business growth.
Master COGS for better business decisions with Xero
Calculating and managing COGS can be complex, so it helps if you know something about bookkeeping. Ask your bookkeeper or accountant for advice; you can find one in Xero’s advisor directory.
Accounting software like Xero can help, too. It gives you real-time reporting and detailed analytics to help you track and optimize COGS and make data-informed decisions that improve your business’s financial health. It also has automations to help you speed through your financial admin and manage your expenses and inventory efficiently. Get one month of Xero free.
FAQs on cost of goods sold
Get answers to common questions about cost of goods sold and how to apply COGS calculations in your business:
Can I reduce my COGS without affecting the quality of my products?
Yes, you can. Improve your processes and production efficiency, minimize waste, and use more cost-effective materials to reduce COGS while maintaining your product standards. You can also negotiate cheaper arrangements with your suppliers to bring down your direct costs.
What is the difference between cost of goods sold and cost of sales?
These are often used interchangeably. However, COGS focuses on the direct costs of creating or purchasing products that are sold. Cost of Sales (COS) sometimes includes those costs plus additional business expenses linked to revenue generation, like transaction fees, sale commissions, or acquisition costs in some digital businesses.
How often should I calculate COGS?
Generally, businesses calculate COGS at the end of each accounting period (monthly, quarterly, or annually). Businesses with high inventory turnover may calculate it more often for a better view of profitability. Talk to your accountant for specific advice for your business.
Can I estimate my COGS?
Yes, you can use estimates, especially if you’re a new business or have limited resources. As your business grows, you’ll want to track COGS accurately as it directly affects your profitability and taxes. Accounting software can help.
My business is service-based. Do I still have COGS?
Yes, even service businesses have COGS. While you’re not selling physical goods, COGS can include the labor costs, software subscriptions, or materials you use to deliver the service.
Are salaries included in COGS?
Yes, salaries can be included in COGS if they’re directly tied to producing your goods or services. For example, wages for factory workers or service delivery staff would count as COGS, while administrative salaries typically wouldn’t.
Disclaimer
Xero does not provide accounting, tax, business or legal advice. This guide has been provided for information purposes only. You should consult your own professional advisors for advice directly relating to your business or before taking action in relation to any of the content provided.
Get one month free
Sign up to any Xero plan, and we will give you the first month free.