Cost of goods sold (COGS): definition and formulas
Learn how to calculate cost of goods sold (COGS) to price right, protect profit, and forecast cash.

Written by Lena Hanna—Trusted CPA Guidance on Accounting and Tax. Read Lena's full bio
Published Wednesday 25 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, manufacturing costs, storage, and freight expenses.
- Include only direct production costs in COGS such as materials, direct labour, and manufacturing overheads, while keeping indirect expenses like rent, marketing, and administrative salaries separate as operating expenses.
- Use COGS as your pricing floor to ensure profitability, and monitor changes in material or labour costs to determine when price adjustments are needed to protect your margins.
- Reduce COGS by negotiating better rates with suppliers through long-term contracts or bulk purchasing, streamlining production processes to eliminate waste, and optimising inventory levels based on accurate demand forecasting.
What is cost of goods sold (COGS)?
Cost of goods sold (COGS) is the direct cost to produce or purchase the goods you sell. It includes the materials you turn into products and the expenses directly tied to making them ready for sale.
COGS includes:
- Direct materials: raw materials and components used to create your products
- Direct labour: wages paid to workers who physically produce goods
- Manufacturing overheads: factory costs like equipment, utilities, and production supplies
Some businesses include additional costs in COGS when they directly relate to getting products sold:
- Freight: shipping costs for incoming materials or outgoing products
- Storage: warehousing expenses for inventory
- Sales commissions: fees paid to salespeople per transaction
- Transaction fees: payment processing costs tied to each sale
Ecommerce businesses commonly include these costs in their COGS calculations.
COGS covers only direct production costs. Keep indirect expenses separate:
- Rent: office or retail space costs (production facility rent is included in COGS)
- Marketing: advertising, promotions, and sales campaigns
- Administrative overhead: office supplies, software subscriptions, and general business expenses
- Non-production salaries: wages for staff in administrative, sales, or management roles
Tracking COGS helps you understand your true product costs and set profitable prices. Accounting software like Xero simplifies this by connecting your expense management and inventory tracking in one place.
Why COGS is important for small businesses
COGS directly affects your profitability. Knowing your true production costs helps you set competitive prices while .
Materials and labour costs are usually straightforward to calculate. But other costs can catch new business owners off guard. For example, you might enjoy good margins while using your home as a warehouse, but your COGS will increase when you move to dedicated premises.
Monitoring COGS helps you spot what's putting pressure on your profit margins and take action.
COGS also helps you make better business decisions in four key areas.
Pricing
COGS sets your pricing floor. You need to exceed this baseline to make a profit on each sale.
When material costs rise or fall, COGS helps you judge the impact and decide .
Profitability
Lower COGS means higher . When you reduce production costs while keeping prices steady, more money stays in your business. Even small COGS improvements can significantly boost profitability.
COGS is just one part of your total expenses. Your operating income also accounts for wages, depreciation, and other costs.
Inventory management
Analysing COGS reveals which products perform well and which need attention. You can spot slow-moving items and assess your overall inventory efficiency.
Use these insights to optimise stock levels, adjust reorder points, and refine your product mix. The goal is to balance demand while keeping less capital tied up in unsold goods.
Taxes
COGS is a tax-deductible business expense, and accurate tracking helps you maximize deductions. In the US, for example, many business types have their COGS calculated separately on Form 1125-A, which keeps your records ready for audits.
Check with your local tax authority for specific COGS reporting requirements in your region.
Understanding your financial health
COGS helps you calculate accurate profit margins. When you know your true costs, you can track gross profit, monitor trends over time, and make confident financial decisions.
Strategic decision-making
COGS data informs major business decisions. Use it to evaluate:
- whether to launch new product lines
- when to invest in automation
- how to optimise distribution methods
How to calculate COGS
COGS is calculated using either an inventory-based formula or a cost-addition formula.
Retailers typically use the inventory formula, while manufacturers add up production costs directly.
Retail COGS formula
This formula calculates COGS based on inventory values:
Cost of goods sold formula used by retailers for inventory accounting.
Where:
- 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 the end of the period
This formula tracks inventory values rather than individual sales. Instead, it tracks inventory values at the start and end of each period. This approach automatically accounts for discarded or damaged inventory.
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. Some manufacturers exclude warehousing or freight from their calculations.
This formula adds up all production and delivery costs:
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: components and supplies used to produce your goods
- Manufacturing costs: labour, equipment, and utilities used in production
- Storage costs: warehousing and inventory holding expenses
- Freight: shipping costs for incoming materials and outgoing products
In Xero, you can find COGS in your profit and loss (P&L) statement under the income section of your financial reports.
Examples of 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 has $8,000 remaining.
$10,000 + $25,000 − $8,000 = $27,000 COGS
This means the business spent $27,000 on goods that were sold during the quarter.
Manufacturing example
A manufacturing business buys $7,000 worth of materials, spends $3,000 on energy and labour to produce goods, and pays $1,200 on shipping.
$7,000 + $3,000 + $1,200 = $11,200 COGS
This means the business spent $11,200 to produce and deliver its goods.
COGS and different business models
Different business types calculate COGS differently based on what drives their costs.
- Manufacturers include production-related indirect costs like material handling and factory utilities
- Retailers calculate COGS using beginning and ending inventory values for each period
- Service businesses include labour costs and materials used to deliver services
Tips for managing and reducing COGS
Here are practical strategies to lower your production costs and improve margins.
Negotiate with suppliers
Talk to your suppliers regularly about pricing. Here are ways to reduce material costs:
- Sign long-term contracts: lock in better rates with volume commitments
- Buy in bulk: access quantity discounts when cash flow allows
- Compare suppliers: get quotes from competitors to find better rates
Streamline production processes
Review your production workflow to find inefficiencies and reduce waste. Consider these approaches:
- Map each step: identify where time or materials are lost
- Reduce waste: track and minimise scrap, rework, and excess inventory
- Evaluate automation: weigh equipment costs against potential labour savings and consistency gains
Optimise inventory levels
Accurate demand forecasting helps you hold the right amount of stock. Use these strategies:
- Analyse sales data: identify patterns and seasonal trends
- Set reorder points: automate restocking based on demand forecasts
- Review slow movers: discontinue products that tie up capital and redirect resources to better performers
Reduce freight costs
Shipping costs can significantly affect COGS. Reduce them by:
- Consolidating shipments: combine orders to access bulk shipping rates
- Negotiating with carriers: ask for volume discounts based on your shipping frequency
- Comparing logistics providers: get quotes from third-party providers who may offer better rates
COGS accounting methods
Your inventory valuation method determines how COGS is calculated. When you sell inventory, its value moves from your balance sheet to your income statement as COGS.
The method you choose affects which costs are assigned to sold items and which remain in inventory. Here are the four main approaches.
FIFO (first in, first out) method
FIFO assumes you sell your oldest inventory first. This often matches how goods actually move through your business.
When prices are rising, FIFO results in lower COGS because older, cheaper inventory is counted as sold first, leading to higher reported profits. For instance, if you sold three items after a price increase, your COGS would be based on the cost of the first three units produced before the price hike.
LIFO (last in, first out) method
LIFO assumes you sell your newest inventory first. During periods of rising prices, this results in higher COGS and lower reported profits.
LIFO is prohibited under International Financial Reporting Standards (IFRS). The International Accounting Standards Board prohibits LIFO as a cost formula due to its 'lack of representational faithfulness of inventory flows,' so it's disallowed in many countries outside the US.
Average cost method
The average cost method calculates COGS using the weighted average cost of all inventory items. This is calculated by dividing the total cost of goods available for sale by the total number of units, creating a weighted average per unit that is then used to value both COGS and ending inventory.
This approach smooths out price fluctuations and provides a middle ground between FIFO and LIFO.
Specific identification method
Specific identification, one of the four main valuation methods, tracks the actual cost of each individual inventory item. This method is highly accurate but requires detailed record-keeping.
It works best for businesses selling high-value, unique items like vehicles, artwork, or custom products. Businesses with large quantities of similar items typically choose other methods for efficiency.
Conclusion
Understanding your COGS is essential for running a profitable business. It affects your pricing, margins, inventory decisions, and taxes.
Accounting software like Xero simplifies COGS tracking with real-time reporting, detailed analytics, and integrated inventory management. You get clearer insight into your costs through automated tracking.
Ready to simplify your COGS tracking? Get one month free and see how Xero makes managing your business finances easier.
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 direct production costs like materials and manufacturing labour. Operating expenses cover indirect costs of running your business, such as rent, marketing, and administrative salaries. COGS appears above gross profit on your income statement, while operating expenses appear below it.
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 focuses strictly on direct costs of creating or purchasing products. Cost of sales (COS) may include those costs plus additional revenue-related expenses like transaction fees, sales commissions, or customer acquisition costs. rather than COGS.
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, consider calculating COGS more frequently to get a clearer view of profitability. Talk to your accountant for advice specific to your business.
Can I estimate my COGS?
Yes, you can estimate COGS when you're starting out or have limited data. Use industry benchmarks or historical averages as a starting point.
As your business grows, switch to accurate tracking. COGS directly affects your profitability calculations and tax deductions. Accounting software like Xero can help you track costs precisely.
My business is service-based. Do I still have COGS?
Yes, service businesses have COGS too. Even though you sell services rather than physical products, you still have direct costs tied to delivering them.
Service COGS may include:
- labour costs for staff who deliver the service
- software subscriptions used in service delivery
- materials or supplies consumed per project
Are salaries included in COGS?
It depends on the type of salary. Direct labour costs, meaning wages paid to workers who physically produce goods or deliver services, are included in COGS.
Salaries for administrative staff, salespeople, and management are classified as operating expenses instead.
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.