Cost of goods sold (COGS): meaning, formula, examples
Learn how to calculate cost of goods sold to price smarter, reduce costs, and grow profit.

Written by Lena Hanna—Trusted CPA Guidance on Accounting and Tax. Read Lena's full bio
Published Tuesday 24 February 2026
Table of contents
Key takeaways
- Calculate your cost of goods sold using the basic formula: beginning inventory plus purchases minus ending inventory equals COGS, which helps you understand the true cost of producing or purchasing the goods you sell.
- Use COGS to set profitable pricing by ensuring your selling price exceeds your production costs, and monitor changes in COGS to know when price adjustments are needed to maintain healthy profit margins.
- Choose the right inventory valuation method for your business, such as FIFO for perishable goods or average cost for large quantities of similar items, as this choice directly impacts your reported profits and tax obligations.
- Reduce COGS by negotiating better supplier rates, streamlining production processes to eliminate waste, optimising inventory levels to avoid overstocking, and consolidating shipments to access bulk freight rates.
What is COGS?
Cost of goods sold (COGS) is the direct cost to produce or purchase the goods you sell. It includes raw materials, direct labour, and manufacturing costs tied to creating your products. Under some accounting standards, inventory can even include intangible assets like software produced for resale.
COGS appears on your income statement and directly affects your gross profit.
COGS typically includes:
- Direct materials: raw materials and components used to create products
- Direct labour: wages for workers directly involved in production
- Manufacturing overheads: factory costs tied to production, such as equipment and utilities
Some businesses, like ecommerce businesses, also include freight, storage, sales commissions, or transaction fees when these relate directly to selling products.
COGS doesn't include:
- Rent: office or retail space costs
- Marketing: advertising and promotional expenses
- Administrative overhead: general business expenses
- Non-production salaries: wages for staff not directly making products
Accounting software like Xero can simplify COGS tracking by automating how you calculate it and connecting your expense management and inventory data.
Why COGS is important for small businesses
COGS directly affects your profitability. Knowing your true production costs helps you set competitive prices and maintain healthy margins.
While materials and labour costs are typically easy to figure out, other costs can trip up those just starting out. For example, small business owners who start by using their home as a production facility may enjoy good margins initially.
However, COGS will jump when you upgrade to dedicated manufacturing or warehousing premises. Monitoring COGS helps you identify and address the things that put pressure on your profit margins.
COGS also helps you make better business decisions in four key areas.
Pricing
COGS establishes the baseline you must exceed to make a profit. When you understand your COGS, you can judge how cost fluctuations affect your expenses and know when to adjust prices.
Profitability
Reducing COGS while maintaining prices increases your gross profit. Even small improvements can significantly affect your bottom line.
Keep in mind that COGS is just part of your total expenses. Your operating income also includes costs like wages and depreciation that sit outside COGS.
Inventory management
Analysing COGS helps you assess your inventory efficiency and identify slow-moving items. This insight helps you optimise your stock levels, reorder points, and product mix to balance demand while minimising 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 maximise deductions. In the US, for many business types, including partnerships and corporations, COGS is calculated separately on Form 1125-A, which requires detailed audit documents.
Check with your local tax authority for how they handle COGS.
Making strategic decisions
With a close eye on COGS accounting, you can decide more effectively. COGS gives you the context to analyse your finances strategically and inform decisions like investing in new product lines, automation, or new distribution methods.
How to calculate COGS
The basic COGS formula is: Beginning inventory + Purchases − Ending inventory = COGS. However, how you calculate it varies by business type.
Retailers typically use inventory-based calculations, while manufacturers add up production costs directly. Here's how each approach works.
Retail COGS formula
The retail COGS formula helps you calculate the cost of goods sold based on inventory values.
Cost of goods sold formula used by retailers for inventory accounting.
Where:
- 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
This formula focuses on inventory values rather than sales numbers. Using beginning and ending inventory helps account for discarded, damaged, or obsolete stock.
Manufacturing COGS formula
Manufacturers have more complex supply chains, so 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.
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.
Where:
- Raw materials: the direct materials used to produce goods
- Manufacturing costs: labour, equipment, and utilities tied to production
- Storage costs: expenses from inventory storage
- Freight: shipping costs for incoming materials or final delivery
In Xero, you can find COGS in your Profit and Loss report under direct costs. This shows you exactly how much you're spending to produce or purchase the goods you sell, helping you track margins over time.
Examples of COGS
Here are two examples showing how different business types calculate COGS.
Retail example
A retail business holds $10,000 of inventory at the beginning of the quarter and buys $25,000 during the quarter. At the end, it owns $8,000.
Calculation: $10,000 + $25,000 − $8,000 = $27,000 COGS
This means the business spent $27,000 on the goods it sold that quarter.
Manufacturing example
A manufacturing business buys $7,000 worth of materials and spends $3,000 on energy and labour to produce goods, plus $1,200 on shipping.
Calculation: $7,000 + $3,000 + $1,200 = $11,200 COGS
This represents the total direct cost to produce and deliver those goods.
COGS and different business models
COGS applies to most business types, but how you calculate it varies depending on your business model.
- Manufacturers: include production costs like materials, labour, and material handling
- Retailers: include beginning and ending inventory values for a period
- Service businesses: include direct labour and materials used to deliver services
COGS accounting methods
How you value your inventory directly affects how you calculate COGS. As you sell inventory, its value transfers from the balance sheet to the income statement as part of COGS.
The method you choose determines which costs you assign to sold items and which remain in inventory. This choice impacts both your reported profits and what you owe in taxes.
FIFO (first in, first out) method
FIFO (first in, first out) assumes that the oldest inventory items are sold first. This method often results in COGS that closely matches the physical flow of goods.
When prices are increasing: FIFO typically leads to lower COGS and higher reported profits. This method works well for perishable goods or products with expiry dates.
LIFO (last in, first out) method
LIFO (last in, first out) assumes the most recently acquired inventory is sold first.
When prices are increasing: LIFO typically leads to higher COGS and lower reported profits, which can reduce your tax burden.
Important: International Financial Reporting Standards (IFRS) don't permit LIFO, and many countries outside the United States disallow it. The International Accounting Standards Board prohibits LIFO as a cost formula because it doesn't accurately represent inventory flows. Check with your accountant before using this method.
Average cost method
Average cost method uses the weighted average of all inventory costs to value both COGS and ending inventory. It smooths out price fluctuations over time.
This method works well for businesses with large quantities of similar items where tracking individual costs isn't practical.
Specific identification method
Specific identification method tracks the actual cost of each individual inventory item. This method is typically used for high-value or unique items like vehicles, jewellery, or custom furniture.
While highly accurate, it can be impractical for businesses with large quantities of similar, lower-value items.
Tips for managing and reducing COGS
Here are four strategies to help you manage and reduce your COGS.
Negotiate with suppliers
Regular discussions with your suppliers can help you secure better prices.
- Request volume discounts for bulk purchasing
- Explore long-term contracts for price stability
- Compare rates from alternative suppliers
- Ask about early payment discounts
Streamline production processes
Analyse your production workflow to find inefficiencies and reduce waste.
- Identify bottlenecks that slow production
- Reduce material waste through better processes
- Consider automation to decrease labour costs
- Assess ROI before major investments
Optimise inventory levels
Use data to forecast demand accurately and keep inventory at optimal levels.
- Track inventory turnover rates regularly
- Identify and discontinue slow-moving items
- Set reorder points to avoid overstocking
- Review your product mix quarterly
Reduce freight costs
Explore shipping methods that balance cost and delivery time.
- Consolidate shipments to access bulk rates
- Negotiate volume discounts with carriers
- Compare third-party logistics providers
- Review shipping routes for efficiency
Simplify your COGS management with Xero
Tracking COGS manually takes time and increases the risk of errors. Automating has significant benefits; one survey found that 79% of surveyed finance leaders reduced month-end close time by switching to an automated system. Xero accounting software simplifies the process with:
- Real-time reporting: see your COGS and profit margins as they change
- Automated calculating: reduce manual data entry and errors
- Inventory tracking: monitor stock levels and costs in one place
- Financial insights: make data-informed pricing and purchasing choices
Simplify your COGS tracking. Get one month free and see how Xero makes managing your business finances easier.
Want help setting up your accounts? Find a bookkeeper or accountant through Xero Advisors.
FAQs on cost of goods sold
Find answers to common questions about calculating and managing COGS for your business.
What's the difference between COGS and operating expenses?
COGS covers direct costs of creating or purchasing products you sell, such as materials and labour to produce them. Operating expenses are indirect costs of running your business, such as rent, marketing, and administrative salaries. COGS affects gross profit, while operating expenses affect net profit.
What is the difference between cost of goods sold and cost of sales?
These terms are often used interchangeably, but there's a subtle difference. COGS refers specifically to direct production or purchasing costs for physical products. Cost of sales may include COGS plus additional revenue-related expenses like transaction fees, sales commissions, or costs to acquire customers.
How often should I calculate COGS?
Most businesses calculate COGS monthly, quarterly, or annually at the end of each accounting period. If you have high inventory turnover, calculate more frequently for a clearer view of profitability. Your accountant can recommend the right frequency for your business.
Can I estimate my COGS?
Yes, estimates work well when you're starting out or have limited resources. Use industry benchmarks or historical data as a starting point. As your business grows, track COGS accurately since it directly affects your profitability and what you owe in taxes. Accounting software can help automate this process.
Do service-based businesses have COGS?
Yes, service businesses have COGS, though it looks different from product-based businesses. For instance, an HVAC company might spend $850 on direct costs for a $1,300 repair job. Your COGS may include direct labour costs for delivering services, software subscriptions essential to service delivery, and materials or supplies used for client work.
How does COGS appear on financial statements?
COGS appears on your income statement (profit and loss statement) directly below revenue. Subtract COGS from revenue to calculate gross profit. You'll also see COGS reflected in your balance sheet through inventory values, which decrease as you sell goods and transfer costs to the income statement.
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.
Start using Xero for free
Access Xero features for 30 days, then decide which plan best suits your business.