Cost of goods sold: what it is and how to calculate it
Learn what cost of goods sold is, how to calculate it, and what it tells you about your profit.

Written by Lena Hanna—Trusted CPA Guidance on Accounting and Tax. Read Lena's full bio
Published Wednesday 22 April 2026
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 decide on pricing, analyze profitability, manage inventory, and claim tax deductions, as it directly impacts your gross profit margin and business financial health.
- Reduce COGS by negotiating with suppliers, improving production processes, and optimizing inventory to increase profitability without compromising product quality.
- Use COGS alongside other financial metrics like gross profit margin and operating income rather than using it alone, 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. It includes all expenses directly tied to creating your products, from raw materials to manufacturing labor. Tracking COGS helps you set profitable prices and understand your true production costs.
COGS typically includes:
- Direct materials: raw materials and components used in production
- Direct labor: wages for workers who make or assemble products
- Manufacturing overhead: factory costs directly tied to production
Some businesses, like ecommerce businesses, also include freight, storage, sales commissions, or transaction fees when these costs relate directly to selling products.
COGS does not include:
- Rent: office or retail space costs
- Marketing: advertising and promotional expenses
- Administrative overhead: general office expenses
- Most salaries: pay for staff not directly involved in production
Tracking COGS requires accounting software for running your business and managing your expenses and inventory.
Why COGS matters for your small business
Tracking COGS reveals your true production costs so you can set prices that actually generate profit. Materials and labor are usually straightforward to calculate, but other costs can catch new business owners off guard.
For example, home-based businesses often enjoy strong margins initially. When you move to dedicated facilities, COGS increases significantly, putting pressure on your profit margins.
Accurate COGS tracking drives four critical business decisions:
Pricing
COGS establishes the baseline cost you must exceed to make a profit. When you understand your true production costs, you can judge how cost fluctuations affect your margins and when to adjust prices.
Profitability
COGS directly affects your gross profit margin. Reducing COGS while maintaining prices increases gross profit. Even small improvements can significantly boost your bottom line.
Keep in mind that COGS is just part of your total expenses. Your operating income also factors in wages, depreciation, and other costs.
Inventory management
Analyzing COGS helps you assess how efficiently you use inventory and spot slow-moving items. Use this information to optimize stock levels, reorder points, and product mix. You'll balance demand while minimizing capital tied up in unsold goods.
Taxes
COGS is a deductible business expense that reduces your taxable income, and simplified inventory accounting rules may apply if you meet the 2025 gross receipts test of averaging $30 million or less over the prior three years. Tracking and documenting all COGS components helps you deduct more and prepare for audits.
Check with your local tax authority for specific COGS guidelines.
How to calculate COGS
To calculate COGS, use one of two primary formulas depending on your business type. The retail formula works for businesses that buy and resell products. The manufacturing formula works for businesses that create products from raw materials.
Retail COGS formula
The cost of goods sold formula used by retailers for inventory accounting:
Beginning Inventory + Purchases − Ending Inventory = COGS
The retail COGS formula includes:
- Beginning inventory: value of inventory at the start of the period
- Purchases: cost of inventory acquired during the period
- Ending inventory: value of inventory remaining at the end of the period
This formula focuses on inventory values rather than sales quantities, accounting for discarded or damaged inventory that doesn't generate revenue.
Cost of goods sold formula used by retailers for inventory accounting.
Manufacturing COGS formula
The cost of goods sold formula used by manufacturers:
Raw Materials + Manufacturing Costs + Storage Costs + Freight = COGS
The manufacturing COGS formula includes:
- Raw materials: direct materials used to produce goods
- Manufacturing costs: labor, energy, and production expenses
- Storage costs: warehousing and inventory holding expenses
- Freight: shipping costs for incoming materials or final delivery
Manufacturing COGS covers all production costs because manufacturers have complex supply chains. Some manufacturers exclude warehousing or freight depending on their accounting practices.
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.
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.
Calculation: $10,000 + $25,000 − $8,000 = $27,000 COGS
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.
Calculation: $7,000 + $3,000 + $1,200 = $11,200 COGS
COGS vs operating expenses
COGS and operating expenses serve different purposes in financial analysis. Both represent business costs, but they cover distinct categories and provide different insights.
- COGS covers direct costs of producing or purchasing goods, including inventory, raw materials, and production labor
- Operating expenses (OpEx) covers costs essential for running the business, including rent, utilities, marketing, and office supplies
COGS directly affects gross profit. Subtract COGS from revenue to calculate your gross margin, which shows production cost efficiency.
Operating expenses affect operating income. Subtract OpEx from gross profit to calculate EBIT (earnings before interest and tax), which shows overall business management costs.
COGS vs cost of revenue
COGS focuses only on direct production costs, while cost of revenue (CoR) includes both direct and indirect costs needed to generate revenue.
- COGS includes materials, labor, and manufacturing expenses. Retail and manufacturing businesses typically use COGS because production costs are easy to track.
- CoR includes direct costs plus variable costs like distribution, marketing, and delivery. Service businesses often use CoR because they have more indirect costs.
CoR shows total costs to bring products or services to market more completely, making it more common for service businesses and companies with significant indirect costs.
COGS accounting methods
How you value inventory directly impacts 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 affects both your reported profits and what you owe in taxes.
The FIFO (first in, first out) method
FIFO assumes you sell your oldest inventory first. This method often matches the physical flow of goods and results in COGS that reflects older, typically lower costs.
When prices rise, FIFO leads to lower COGS and higher reported profits.
The LIFO (last in, first out) method
LIFO assumes you sell your most recently acquired inventory first. During inflation, this leads to higher COGS and lower reported profits.
International Financial Reporting Standards (IFRS) don't permit LIFO, so many countries outside the United States don't allow it.
The average cost method
The average cost method uses weighted average inventory costs to value both COGS and ending inventory. It smooths out how prices fluctuate and serves as a middle ground between FIFO and LIFO.
Specific identification method
The specific identification method tracks the actual cost of each individual inventory item. This method works best for high-value items but becomes impractical for businesses selling many similar products.
Tips for managing and reducing COGS
Reducing COGS increases your profit margin without raising prices. These strategies can lower your production costs.
Negotiate with suppliers
Negotiate regularly with suppliers to secure better prices. Consider long-term contracts or bulk purchasing agreements for volume discounts. Compare rates from multiple suppliers to find the most competitive options.
Streamline production processes
Analyze your production workflow to identify what's inefficient and reduce waste. Consider automating to decrease labor costs and produce more consistent output. Assess the ROI before investing significantly.
Optimize inventory levels
Use data analytics to forecast demand and maintain optimal stock levels. Review your product mix regularly and consider discontinuing slow-moving items that tie up capital.
Reduce freight costs
Explore shipping methods that balance cost and how quickly items are delivered. Consider these approaches:
- Consolidate shipments to access bulk shipping rates
- Negotiate volume discounts with carriers
- Evaluate third-party logistics providers for better rates
Limitations of COGS
COGS only tracks direct production costs, which means it excludes many expenses that affect your overall financial performance. Understanding these limitations helps you avoid over-relying on a single metric.
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
- Inefficient processes: operational waste and bottlenecks
Because COGS excludes these costs, it alone doesn't give you a complete picture of financial health.
Use COGS with other metrics for a complete financial health picture
Combine COGS with other metrics to make better decisions.Gross profit margin, operating income, and cost of sales factor in both direct and indirect costs.
Use these metrics together to inform decisions about:
- How to adjust pricing
- How to manage inventory and costs
- How to grow your business
Master COGS for better business decisions with Xero
Accounting software simplifies COGS tracking and management. With Xero, you can:
- Track costs in real time: Monitor COGS with automated reporting and analytics
- Manage inventory efficiently: Keep stock levels optimized with built-in tools
- Speed through admin: Automate expense tracking and financial tasks
Ask your bookkeeper or accountant for advice on COGS. You can find one in Xero's advisor directory.
FAQs on cost of goods sold
Common questions about COGS, answered.
Can I reduce my COGS without affecting the quality of my products?
Yes. You can reduce COGS while maintaining quality by producing more efficiently, minimizing waste, sourcing cost-effective materials, and negotiating better supplier rates.
What is the difference between cost of goods sold and cost of sales?
People often use these terms interchangeably, but they can differ. COGS focuses on direct production costs. Cost of sales (COS) sometimes includes additional expenses like transaction fees, sales commissions, or customer acquisition costs.
How often should I calculate COGS?
Most businesses calculate COGS monthly, quarterly, or annually. Businesses with high inventory turnover may calculate it more frequently. Talk to your accountant for advice specific to your business.
Can I estimate my COGS?
Yes, especially when starting out or with limited resources. As your business grows, switch to accurate tracking since COGS directly affects how profitable you are and your taxes. Accounting software makes precise tracking easier.
My business is service-based. Do I still have COGS?
Yes, service businesses have COGS too. Your COGS may include labor costs for delivering services, software subscriptions, and materials used to complete client work.
Are salaries included in COGS?
COGS includes salaries only if they're directly tied to production. Factory worker wages and service delivery staff pay count as COGS. Administrative and office salaries typically don'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.