Cost of goods sold (COGS): definition, formula, tips
Cost of goods sold shapes pricing and profit. Learn how to calculate it for smarter decisions.

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 basic formula: Beginning Inventory + Purchases - Ending Inventory = COGS for retailers, or add up direct materials, manufacturing costs, storage, and freight for manufacturers to understand your true product costs.
- Use COGS as your pricing baseline by ensuring your selling prices exceed these direct costs, and regularly review COGS to spot cost pressures before they damage your profit margins.
- Reduce COGS by negotiating volume discounts with suppliers, streamlining production processes to eliminate waste, and optimising inventory levels through accurate demand forecasting to avoid tying up cash in excess stock.
- Track COGS accurately with accounting software to maximise tax deductions, gain real-time visibility into profitability, and make informed decisions about which products to continue selling or discontinue.
What is COGS?
Cost of goods sold (COGS) is the direct cost to produce or purchase the goods you sell, or the materials you turn into goods.
COGS typically includes:
- Direct materials: raw materials and components used in production
- Direct labour: wages for workers who make the product
- Manufacturing overheads: factory costs directly tied to production
Some businesses, like electronic commerce (ecommerce) businesses, also include freight, storage, sales commissions, or transaction fees when they relate directly to selling products.
COGS excludes indirect expenses such as:
- rent
- marketing
- general administrative overhead
- salaries not directly tied to production
Tracking COGS requires accounting software to manage your expenses and inventory.
Why COGS matters for your business
COGS directly affects your profitability, pricing decisions, and tax obligations. Understanding your true cost of goods helps you set prices that cover expenses and generate profit.
Here's why tracking COGS matters:
- Pricing accuracy: knowing your actual costs helps you set prices that protect your margins
- Profitability insights: COGS reveals whether you're making money on each sale
- Tax deductions: COGS is a deductible business expense that reduces your taxable income
- Cash flow visibility: tracking costs helps you spot problems before they hurt your bottom line
When you understand COGS, you can make smarter decisions about suppliers, production methods, and which products to sell.
How to calculate COGS
The basic COGS formula is: Beginning Inventory + Purchases − Ending Inventory = COGS. However, the specific calculation varies depending on your business type.
Retailers and manufacturers use different approaches to calculate COGS.
The image shows the cost of goods sold formula used by retailers for inventory accounting.
Retail COGS formula
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
Notice that this formula doesn't reference the number of sales. It focuses on inventory values at the beginning and end of the period instead.
This approach accounts for discarded, damaged, or stolen inventory that never gets sold.
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. Some choose not to count warehousing or freight, particularly if the goods are sold FOB (Free on Board), where the customer bears the shipping expense.
Here's how manufacturers calculate COGS:
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.
Where:
- Raw materials: the direct materials used to produce goods
- Manufacturing costs: labour, utilities, and equipment costs tied to production
- Storage costs: expenses from storing inventory before sale
- Freight: shipping costs for incoming materials or outgoing deliveries
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 R10,000 of inventory at the beginning of the quarter and buys R25,000 during the quarter. At the end, it owns R8,000.
The calculation is:
R10,000 + R25,000 − R8,000 = R27,000 COGS
This means the business spent R27,000 on the goods it sold during the quarter.
Manufacturing example
A manufacturing business buys R7,000 worth of materials, spends R3,000 on energy and labour to produce goods, and pays R1,200 on shipping.
The calculation is:
R7,000 + R3,000 + R1,200 = R11,200 COGS
This means producing and delivering those goods cost the business R11,200.
COGS and different business models
COGS calculations vary by business model because different businesses have different cost structures.
Here's how each type typically handles COGS:
- Manufacturers: include production costs plus certain indirect costs like material handling
- Retailers: calculate COGS using starting and ending inventory values for a period
- Service businesses: focus on labour costs and materials used to deliver services
Why COGS is important for small businesses
Understanding your true COGS helps you compete effectively while protecting your profit margins.
Materials and labour costs are typically easy to figure out. But other costs can trip up business owners just starting out.
For example, if you use your home as a production facility or warehouse, you may enjoy good margins initially. But your COGS will jump when you upgrade to dedicated premises.
Monitoring COGS helps you spot cost pressures before they erode your profit margins.
It also supports better decisions in these key areas:
Pricing
COGS establishes the baseline cost you must exceed to make a profit. When you understand your true costs, you can judge how price fluctuations affect your margins and decide when to adjust your prices.
Profitability
When you reduce COGS while maintaining prices, you directly increase your gross profit. Even small cost improvements can significantly boost your overall profitability.
COGS is just part of your total expenses. Your operating income also includes costs like wages and depreciation.
Inventory management
Analysing COGS reveals how efficiently you manage inventory and highlights slow-moving items. Use this insight to optimise stock levels, adjust reorder points, and refine which products you sell.
The goal is to balance customer demand while minimising money tied up in unsold goods.
Taxes
COGS is a deductible business expense that reduces your taxable income. Tracking and documenting all COGS components helps you maximise deductions and provides the records you need for audits.
Check with your local tax authority for specific rules on COGS deductions.
Understanding your financial health
Understanding COGS shows you exactly how much you earn on each sale. When you know exactly what each sale costs, you can identify which products are most profitable and where you might be losing money.
When you can see this clearly, you can build a more financially secure business.
Strategic decision-making
Tracking COGS gives you the data you need to decide strategically. Use what you learn from COGS to evaluate whether to:
- invest in new products
- automate production processes
- change suppliers or distribution methods
- stop selling products that don't make much profit
Tips for managing and reducing COGS
Here are practical ways to manage and reduce your COGS.
Negotiate with suppliers
Regular supplier negotiations can reduce your material costs. Try these approaches:
- Request volume discounts: Commit to larger orders in exchange for better pricing
- Negotiate long-term contracts: Lock in rates to protect against price increases
- Compare suppliers: Get quotes from competitors to find more competitive rates
Streamline production processes
Review your production workflow to find inefficiencies and reduce waste.
Consider automating to decrease labour costs and improve output consistency. Before investing, calculate whether you'll save more than the equipment costs over time.
Optimise inventory levels
Accurately forecasting demand helps you maintain optimal inventory levels without tying up cash in excess stock.
To optimise your inventory:
- use sales data to predict demand patterns
- set when to reorder based on delivery times and how fast items sell
- review which products you sell regularly
- consider discontinuing slow-moving items that tie up money
Reduce freight costs
Shipping costs can significantly impact COGS. Here are ways to reduce them:
- Consolidate shipments: Combine orders to access bulk shipping rates
- Negotiate carrier rates: Request volume discounts based on your shipping frequency
- Compare delivery options: Balance speed against cost for different product types
- Consider third-party logistics: Outsourcing may reduce costs for high-volume businesses
COGS accounting methods
How you value your inventory directly affects how you calculate COGS. When you sell inventory, its value moves from your balance sheet to your income statement as COGS.
The method you choose determines which costs get assigned to sold items and which stay in inventory. International accounting standards require using the same cost formula for all inventories of a similar nature.
Here are the main approaches:
FIFO (first in, first out) method
FIFO (first in, first out) assumes that the oldest inventory items are sold first. This method often matches the actual physical flow of goods through your business.
When prices are rising, FIFO typically results in lower COGS and higher reported profits. It's a common choice for businesses selling 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. During periods of inflation, LIFO typically results in higher COGS and lower reported profits.
LIFO is not permitted under International Financial Reporting Standards (IFRS), as International Accounting Standard (IAS) 2 explicitly prohibits LIFO as a cost formula.
Average cost method
The average cost method calculates COGS using the average cost of all inventory items, weighted by quantity. It values both COGS and ending inventory at the same average price.
This approach smooths out price fluctuations and offers a middle ground between FIFO and LIFO. It's useful when inventory items are similar and prices vary over time.
Specific identification method
The specific identification method tracks the actual cost of each individual inventory item. It's the most accurate approach but requires detailed record-keeping.
This method works best for high-value items like vehicles, jewellery, or custom products. Businesses selling large quantities of similar, low-cost items typically find other methods more practical.
Managing your COGS with Xero
To succeed, your business needs to understand and manage COGS. It directly affects how you price products, how profitable you are, how you decide on inventory, and how you calculate taxes.
Accounting software like Xero helps you manage COGS with real-time reporting, detailed analytics, expense tracking, and inventory tools. You can see your costs more clearly without the manual work.
By tracking and optimising COGS, you can boost your profit margins and make better decisions that improve your long-term financial health. Get one month free and see how Xero helps you stay on top of your costs.
Need a bookkeeper or accountant near you? Check out Xero Advisors.
FAQs on COGS
Here are answers to common questions about cost of goods sold.
What's the difference between COGS and operating expenses?
COGS covers the direct costs of creating or purchasing products you sell. Operating expenses are the indirect costs of running your business, such as rent, marketing, utilities, and administrative staff salaries. COGS appears on your income statement before gross profit, while operating expenses come after.
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 specifically refers to the direct costs of creating or purchasing products you sell.
Cost of sales (COS) may include COGS plus additional expenses tied to generating revenue, such as:
- transaction fees
- sales commissions
- customer acquisition costs (in some digital businesses)
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, calculate COGS more frequently to maintain a clear view of profitability. Talk to your accountant for advice specific to your business.
Can I estimate my COGS?
Yes, you can estimate COGS, especially when starting out or if you have limited resources. However, as your business grows, tracking COGS accurately becomes more important because it directly affects how you calculate profitability and what you can deduct from taxes.
Accounting software can help you track COGS accurately without calculating manually.
My business is service-based. Do I still have COGS?
Yes, service businesses have COGS too. While you're not selling physical products, your COGS can include:
- labour costs for staff who deliver the service
- software subscriptions used in service delivery, as accounting standards allow inventory costs to include intangible assets like software produced for resale
- materials or supplies consumed during the service
For example, a consulting firm might include consultant wages, while a cleaning business might include cleaning supplies and equipment costs.
Are salaries included in COGS?
The answer varies based on the type of salary. Direct labour costs for workers who make products or deliver services are typically included in COGS. Salaries for administrative staff, sales teams, or management are usually classified as operating expenses instead.
For example, a factory worker's wages would be COGS, but the office manager's salary would be an operating expense.
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.