Cost of goods sold (COGS): definition and how to calculate
Learn how to calculate cost of goods sold, set smarter prices, and track profit with confidence.

Written by Lena Hanna—Trusted CPA Guidance on Accounting and Tax. Read Lena's full bio
Published Friday 20 February 2026
Table of contents
Key takeaways
- Calculate your COGS using the appropriate formula for your business type: retailers should use beginning inventory plus purchases minus ending inventory, while manufacturers should add up raw materials, labour costs, and production expenses to determine true product costs.
- Track COGS separately from operating expenses by including only direct costs that vary with production volume, such as materials and direct labour, while excluding fixed costs like rent, marketing, and administrative salaries that remain steady regardless of sales.
- Use COGS data to make informed pricing decisions by establishing your baseline costs and adjusting prices confidently as expenses fluctuate, ensuring you maintain healthy profit margins while staying competitive.
- Reduce COGS through strategic cost management by negotiating better supplier rates, streamlining production processes to eliminate waste, optimising inventory levels to avoid overstocking, and consolidating shipments to lower freight expenses.
What is COGS?
Cost of goods sold (COGS) is the total direct cost of producing or purchasing the products you sell. It includes only the expenses directly tied to creating your goods, not the costs of running your business.
COGS typically includes:
- direct materials used in production
- direct labour costs for making products
- manufacturing overheads tied to production
Some businesses, like ecommerce businesses, also include freight, storage, or transaction fees when these costs relate directly to getting products ready for sale.
COGS does not include indirect business expenses such as:
- rent and utilities
- marketing and advertising
- general administrative costs
- most salaries (unless directly tied to production)
Tracking COGS accurately requires accounting software that manages your expenses and inventory in one place.
Why COGS is important for small businesses
COGS directly affects your pricing, profitability, and business decisions. Knowing your true cost of goods helps you set competitive prices and protect your profit margins.
While materials and labour costs are straightforward, other expenses can catch new business owners off guard. For example, margins may look healthy when you work from home, but COGS increases when you move to dedicated premises.
Monitoring COGS helps you spot cost pressures early and respond before they erode your profits. Here's how COGS supports better decisions in four key areas.
Pricing
COGS establishes the baseline cost you must cover to make a profit. When you understand your COGS, you can adjust prices confidently as costs fluctuate.
Profitability
COGS directly determines your gross profit margin. Reducing COGS while maintaining prices increases gross profit, and even small improvements can significantly boost your bottom line.
Inventory management
Analysing COGS helps you spot slow-moving items and assess inventory efficiency. Use this insight to optimise stock levels, set better reorder points, and reduce the capital you tie up in unsold goods.
Taxes
COGS is a deductible business expense that helps you maximise deductions. In some cases, the IRS allows small businesses (those with $25 million or less in annual gross receipts) flexibility by not requiring them to keep an inventory if their accounting method clearly reflects income. Always check with your local tax authority for specific requirements.
Strategic decision-making
Tracking COGS gives you the financial context to make confident business decisions. Use COGS data to evaluate whether to invest in new product lines, assess automation opportunities, or compare distribution methods. When you understand your true costs, you can build a financially secure business.
COGS vs operating expenses
One of the most common questions about COGS is how to understand what belongs in this category versus your operating expenses. Here's how to tell the difference.
COGS (cost of goods sold) includes only the direct costs of producing or purchasing products you sell:
- raw materials and components
- direct labour for production
- manufacturing overheads
- freight for incoming materials (in some cases)
Operating expenses are the indirect costs of running your business:
- rent and utilities
- marketing and advertising
- administrative salaries
- office supplies and equipment
The key distinction: COGS varies with production volume, while operating expenses typically remain steady regardless of how much you sell.
How to calculate COGS
To calculate COGS, follow these steps based on your business type:
Retail COGS formula
Cost of goods sold formula used by retailers for inventory accounting.
Retailers use an inventory-based approach to calculate COGS. In this formula:
- Beginning inventory: the value of stock at the start of the period
- Purchases: the cost of inventory acquired during the period
- Ending inventory: the value of stock remaining at period end
This formula focuses on inventory values rather than sales volume, which helps account for discarded or damaged stock.
Manufacturing COGS formula
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.
Manufacturers have more complex supply chains, so they often add up all costs on a product's journey to the customer. Modern inventory systems can help allocate additional costs like freight and duties using various methods, such as by value, quantity, or weight. Be aware that some businesses choose not to count warehousing or freight in their COGS.
In this formula:
- Raw materials: direct materials used to produce goods
- Manufacturing costs: labour and production expenses
- Storage costs: warehousing and inventory holding expenses
- Freight: shipping costs for materials or finished goods
If you use accounting software like Xero, you can find COGS in the profit and loss section of your financial statements.
Examples of COGS
Retail example:A retail business holds $10,000 of inventory at the start of the quarter and buys $25,000 during the period. At quarter end, $8,000 of inventory remains.
COGS = $10,000 + $25,000 − $8,000 = $27,000
Manufacturing example:A manufacturer spends $7,000 on raw materials, $3,000 on labour and energy, and $1,200 on shipping.
COGS = $7,000 + $3,000 + $1,200 = $11,200
COGS and different business models
COGS applies to most businesses, but the calculation varies by business model. Here's how different types of businesses typically approach COGS:
- Manufacturers include production costs like materials, labour, and material handling.
- Retailers calculate COGS using beginning and ending inventory values.
- Service businesses focus on direct labour and materials used to deliver services.
COGS accounting methods
Your inventory valuation method directly affects your COGS calculation. Different methods assign different costs to sold items versus remaining inventory.
As you sell stock, its value moves from the balance sheet to the income statement as COGS. The method you choose determines which costs get assigned to each category.
First in, first out (FIFO) method
First in, first out (FIFO) assumes you sell your oldest inventory first. Because it is mandatory under International Financial Reporting Standards (IFRS) for most countries, it is a widely used method that matches the typical physical flow of goods and results in lower COGS and higher profits when prices are rising.
Last in, first out (LIFO) method
Last in, first out (LIFO) assumes you sell your most recent inventory first. This method results in higher COGS and lower reported profits during inflationary periods. For example, in one scenario with rising prices, the LIFO method results in a COGS of $605, compared to just $505 under FIFO for the same number of units sold.
Note: LIFO is not permitted under IFRS, which prohibit LIFO entirely, and is disallowed in many countries outside the United States.
Average cost method
Average cost method uses the weighted average cost of all inventory to calculate COGS. This approach smooths out price fluctuations and sits between FIFO and LIFO in terms of profit impact.
Specific identification method
Specific identification method tracks the actual cost of each individual item you sell. This approach works best for high-value or unique items but becomes impractical for businesses with large quantities of similar products.
Tips for managing and reducing COGS
Negotiate with suppliers
Have regular discussions with suppliers to secure better prices. Consider long-term contracts or bulk purchasing for volume discounts, and compare rates from alternative suppliers.
Streamline production processes
Analyse your workflow to identify inefficiencies and reduce waste. Automation can decrease labour costs and improve consistency, but assess the return on investment (ROI) before investing.
Optimise inventory levels
Use data analytics to forecast demand and maintain optimal stock levels. Review your product mix regularly and consider discontinuing slow-moving items.
Reduce freight costs
Explore shipping methods that balance cost and delivery time. Consolidate shipments for bulk rates, negotiate volume discounts with carriers, or consider a third-party logistics provider.
Manage your COGS with confidence
Understanding and managing your COGS helps you run a profitable business. When you track COGS accurately, you can set competitive prices, protect your margins, and decide confidently about your finances.
Accounting software like Xero simplifies how you manage COGS with real-time reporting, detailed analytics, and integrated inventory tracking. You see your costs more clearly without the manual work.
Ready to simplify your COGS tracking? Get one month free and see how Xero can help you understand your true costs and grow your profits.
Need help getting started? Find a bookkeeper or accountant through Xero Advisors.
FAQs on cost of goods sold
Still have questions about COGS? Here are answers to common concerns.
What is the difference between cost of goods sold and cost of sales?
People often use these terms interchangeably. However, cost of sales sometimes includes additional revenue-related expenses like transaction fees or sales commissions, while COGS focuses strictly on direct production or purchase costs.
How often should I calculate COGS?
Most businesses calculate COGS at the end of each accounting period (monthly, quarterly, or annually). If you have high inventory turnover, more frequent calculations give you a clearer view of profitability.
Can I estimate my COGS?
Yes, estimates work when you're starting out or have limited data. As your business grows, accurate COGS tracking becomes essential for profitability analysis and tax compliance.
Does COGS apply to service-based businesses?
Yes, service businesses have COGS too. While you're not selling physical products, your COGS can include direct labour costs, software subscriptions, and materials you use to deliver your services. Salaries count as COGS only when they directly relate to service delivery.
What happens if I calculate COGS incorrectly?
Incorrect COGS calculations can lead to pricing products incorrectly, reporting profits inaccurately, and potential tax issues. Overstating COGS reduces your taxable income, which may cause auditors to scrutinise your records. Understating it means you could overpay taxes and misjudge your true profitability.
Does COGS include shipping and freight costs?
It depends on the type of shipping. You typically include inbound freight (shipping materials to your business) in COGS. You usually classify outbound shipping (delivering products to customers) as an operating expense, though some businesses include it in COGS if it's a core part of their sales model.
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.