Cost Of Goods Sold (COGS): How To Calculate & Free Template

COGS Cost of Goods Sold refers to the direct expenses a company incurs to produce or purchase the products it sells to customers. Understanding your COGS cost of goods is fundamental to running a profitable business. Whether you’re managing a Shopify store, traditional retail operation, or service-based company, accurately calculating your Cost of Goods Sold directly impacts your bottom line, tax obligations, and strategic decision-making.

In this comprehensive guide, you’ll learn exactly how to calculate COGS, avoid common mistakes, and leverage this crucial metric to optimize your business operations. Plus, we’ve included a free COGS calculator template to streamline your calculations and ensure accuracy every time.

What Is Cost of Goods Sold (COGS)?

Definition & Why COGS Matters

Cost of Goods Sold (COGS) represents the direct costs attributable to producing or acquiring the goods that a company sells during a specific period. This fundamental accounting metric includes raw materials, direct labor, and manufacturing overhead directly tied to product creation.

Why does COGS cost of goods matter so much? It’s the foundation for calculating gross profit, determining pricing strategies, and making informed business decisions. According to the Small Business Administration, businesses that accurately track COGS see 23% better profit margins compared to those using estimates. COGS also plays a crucial role in tax reporting, as it’s deductible from revenue when calculating taxable income.

cogs cost of goods sold by b2bridge.io

COGS vs Gross Profit, Gross Margin, and Revenue

MetricDefinitionFormulaPrimary Use
RevenueTotal income from salesPrice × Quantity SoldTop-line growth tracking
COGSDirect costs of goods soldBeginning Inventory + Purchases – Ending InventoryProfitability foundation
Gross ProfitRevenue minus direct costsRevenue – COGSOperational efficiency
Gross MarginGross profit as percentage(Gross Profit ÷ Revenue) × 100Pricing strategy

Common misunderstandings include:

  • Confusing gross profit with net profit
  • Including operating expenses in COGS calculations
  • Using gross margin and markup interchangeably

COGS vs Cost of Sales, Cost of Revenue, and Operating Expenses

TermScopeIncludesBest For
COGSPhysical goods onlyRaw materials, direct labor, manufacturing overheadProduct-based businesses
Cost of SalesBroader scopeCOGS + some service costsMixed business models
Cost of RevenueAll revenue-generating costsDirect and indirect costsService companies
Operating ExpensesIndirect business costsAdmin, marketing, rentSeparate from COGS

Example scenario: A Shopify store selling handmade jewelry would include silver wire and labor in COGS, but website hosting and Instagram ads would be operating expenses.

What’s Included in COGS? (Direct vs Indirect Costs)

Direct Costs

Direct costs are expenses directly traceable to specific products. For Ecommerce businesses, understanding what qualifies as direct costs is essential for accurate COGS cost of goods calculation.

Raw Materials & Components:

  • Raw materials for manufacturing (fabric, metals, chemicals)
  • Purchased finished goods for resale
  • Packaging materials directly used for products
  • Components and parts in assembly processes

Direct Labor:

  • Production workers’ wages and benefits
  • Assembly line labor costs
  • Quality control inspection labor
  • Piece-rate worker compensation

Manufacturing Overhead:

  • Factory rent and utilities
  • Production equipment depreciation
  • Factory insurance and maintenance
  • Indirect materials used in production
cogs cost of goods sold by b2bridge.io

Ecommerce Example: An online clothing retailer’s COGS would include fabric costs ($15/unit), seamstress wages ($8/unit), and garment bags ($0.50/unit), totaling $23.50 per item.

Exclusions (Indirect Costs)

Many business owners mistakenly include indirect costs in their COGS calculations, leading to inaccurate financial reporting and poor decision-making.

Include in COGSExclude from COGS
Raw materialsAdministrative salaries
Direct production laborOffice rent and utilities
Manufacturing overheadMarketing and advertising
Inbound freightGeneral office supplies
Sales commissions
Professional services fees

Scenario Example: A Shopify dropshipper pays $50 for a product, $8 for shipping to customer, and $5 in Shopify fees. Only the $50 product cost goes in COGS—shipping and platform fees are operating expenses.

How to Calculate COGS – Formula: Step-by-Step Guide

The Standard COGS Formula

The fundamental COGS cost of goods formula follows Generally Accepted Accounting Principles (GAAP):

COGS = Beginning Inventory + Purchases – Ending Inventory

This formula captures the flow of inventory through your business. Beginning inventory represents products available at period start, purchases show new inventory acquired, and ending inventory reflects what remains unsold. The difference represents what was actually sold during the period.

How do you calculate cost of goods sold?

Step 1: Determine Beginning Inventory Value
Start by identifying the value of inventory carried over from the previous accounting period. Make sure the same valuation method used in prior periods is applied consistently.

Step 2: Calculate Total Purchases
Next, add up all inventory acquired during the period. This should include the cost of purchases as well as any freight and handling charges, while subtracting purchase returns or allowances.

Step 3: Count and Value Ending Inventory
At the end of the period, conduct a physical count of inventory and assign a value using the same method as before. If work-in-progress items exist, include them in the total.

Step 4: Apply the COGS Formula
Finally, calculate Cost of Goods Sold using the standard formula: Beginning Inventory + Purchases – Ending Inventory = COGS.

Double-check all figures and confirm that the result aligns with recorded sales.

COGS Calculation Example

Let’s walk through a practical example:

ComponentAmount
Beginning Inventory (Jan 1)$15,000
Purchases (January)$8,500
Ending Inventory (Jan 31)$12,200
COGS for January$11,300

Calculation: $15,000 + $8,500 – $12,200 = $11,300

Inventory Valuation Methods & Impact on COGS

FIFO (First-In, First-Out)

FIFO assumes the oldest inventory items are sold first. During inflationary periods, FIFO results in lower COGS (older, cheaper inventory is expensed first) and higher reported profits. This method provides a more accurate representation of current inventory values on the balance sheet, making it popular among growing businesses seeking to demonstrate strong financial performance.

When to use FIFO:

  • Products with expiration dates
  • Inflationary environments
  • Seeking higher reported profits
  • Most Ecommerce scenarios

LIFO (Last-In, First-Out)

LIFO assumes the newest inventory is sold first. While accepted under US GAAP, LIFO is prohibited under International Financial Reporting Standards (IFRS). During inflation, LIFO produces higher COGS and lower taxable income, providing tax advantages but potentially understating profits.

Important considerations:

  • Not permitted for international businesses using IFRS
  • Creates tax benefits in inflationary periods
  • May not reflect actual inventory flow
  • Complex compliance requirements

Weighted Average Cost

This method calculates a weighted average cost for all inventory items, smoothing out price fluctuations. It’s particularly useful for businesses with large volumes of similar products where tracking individual item costs is impractical.

Advantages:

  • Smooths price volatility
  • Simple to calculate and understand
  • Reduces impact of market fluctuations
  • Suitable for commoditized products

Disadvantages:

  • May not reflect actual inventory flow
  • Less precise than FIFO/LIFO
  • Potential for inventory distortions

How Inventory Method Changes Your COGS and Financials

Example with Rising Prices (100 units sold):

MethodCOGSGross ProfitTax Impact
FIFO$1,200$1,800Higher taxes
LIFO$1,400$1,600Lower taxes
Weighted Avg$1,300$1,700Moderate

The choice significantly impacts financial statements, with FIFO showing higher profits during inflation while LIFO provides tax advantages.

Choosing the Right Method for Your Shopify Store

For most Shopify store owners, FIFO provides the best balance of accuracy, simplicity, and financial reporting benefits. It aligns with natural inventory flow, provides better balance sheet representation, and is accepted globally. However, consider your specific situation: businesses in highly volatile markets might benefit from weighted average, while those seeking tax advantages (in the US) might explore LIFO with professional guidance.

Common COGS Mistakes & Best Practices in Ecommerce

Misclassifying Labor or Overhead

Many businesses incorrectly include administrative salaries, marketing costs, or general overhead in COGS calculations. Only direct labor and overhead specifically tied to production belong in COGS.

Best practices:

  • Clearly define direct vs. indirect costs
  • Train accounting staff on proper classifications
  • Regular review and audit of cost categories
  • Document classification decisions for consistency

Failing to Regularly Update Inventory Counts

Inaccurate inventory counts lead to distorted COGS calculations and poor business decisions. Physical inventory counts should occur regularly, with perpetual inventory systems updated continuously.

Solutions:

  • Implement cycle counting procedures
  • Use barcode scanning systems
  • Regular reconciliation between physical and system counts
  • Investigate and resolve discrepancies promptly

Ignoring Shipping Costs

Inbound shipping costs (freight-in) should be included in COGS as they’re directly attributable to acquiring inventory. However, outbound shipping to customers is typically a separate operating expense.

Proper treatment:

  • Include inbound freight in inventory costs
  • Exclude outbound shipping from COGS
  • Consider freight-in when calculating inventory values
  • Track shipping costs separately for analysis

Manual Calculation Errors – When to Automate

Manual COGS calculations become error-prone as businesses scale. Consider automation when processing more than 100 transactions monthly or managing multiple product lines.

Automation benefits:

  • Reduced human error
  • Real-time calculations
  • Integrated reporting
  • Time savings for strategic work

Using Accounting/Inventory Software for Accurate COGS

Modern inventory management systems integrate with accounting software to automate COGS calculations. For Shopify stores, apps like TradeGecko (now QuickBooks Commerce) or Cin7 provide real-time COGS tracking with automatic journal entries.

How COGS Data Powers Better Business Decisions

cogs cost of goods sold by b2bridge.io

Profitability Analysis & Pricing

Accurate COGS cost of goods data enables precise profitability analysis at the product, category, and overall business level. By understanding true product costs, businesses can identify high-margin opportunities and eliminate unprofitable items.

Key applications:

  • Product-level profitability analysis
  • Pricing optimization strategies
  • Cost reduction initiatives
  • Product mix optimization

Gross Margin Trends – When to Raise or Lower Prices

Tracking gross margin trends helps identify when price adjustments are necessary. Declining margins might indicate rising costs requiring price increases, while improving margins could support competitive pricing or promotional strategies.

Decision triggers:

  • Margin compression exceeding 2% requires immediate attention
  • Sustained margin improvement above target suggests pricing opportunities
  • Seasonal margin variations inform promotional timing

Inventory Planning and Turnover

COGS data directly impacts inventory turnover calculations (COGS ÷ Average Inventory), helping optimize stock levels and cash flow. Higher turnover indicates efficient inventory management, while low turnover suggests overstocking or slow-moving products.

Tax Reporting & Deductions

Proper COGS calculation ensures accurate tax reporting and maximizes legitimate deductions. COGS reduces taxable income dollar-for-dollar, making accuracy crucial for tax optimization.

Case Study: How a Shopify Store Increased Margins By Optimizing COGS

A women’s fashion retailer analyzed their COGS data and discovered:

Initial situation:

  • Average COGS: 65% of revenue
  • Gross margin: 35%
  • Monthly revenue: $50,000

Optimization actions:

  • Eliminated low-margin products (>70% COGS)
  • Negotiated better supplier terms
  • Optimized inventory levels
  • Implemented FIFO consistently

Results after 6 months:

  • Average COGS: 58% of revenue
  • Gross margin: 42%
  • Monthly revenue: $48,000
  • Net profit increase: 47%

Despite slightly lower revenue, the improved margins resulted in significantly higher profits.

COGS for Service Businesses & Omnichannel Stores

When and How to Track COGS for Service Add-ons

Service businesses typically use “Cost of Revenue” rather than COGS, but companies offering both products and services need careful categorization. Service-related direct costs include contractor payments, materials consumed during service delivery, and direct labor.

COGS in Mixed (Product + Service) Business Models

Businesses combining products and services should separate costs appropriately. Product COGS follows traditional calculation methods, while service costs are typically expensed as incurred unless significant materials are involved.

COGS in Multi-Channel Operations

Omnichannel retailers must track COGS across all sales channels while maintaining consistent inventory valuation. This requires robust systems to track inventory movement and allocate costs appropriately across channels.

Shopify App Users: COGS for Physical & Digital Goods

Digital products typically have minimal COGS (hosting, payment processing), while physical goods follow traditional COGS calculations. Hybrid offerings require careful cost allocation between physical and digital components.

COGS Cost Of Goods Sold FAQs

What does cost of goods sold mean?

Cost of Goods Sold (COGS) refers to the direct costs of producing or purchasing the products a company sells. This includes raw materials, direct labor, and manufacturing overhead. It’s calculated with the formula: Beginning Inventory + Purchases – Ending Inventory = COGS. On the income statement, COGS is deducted from revenue to determine gross profit.

Is COGS an expense?

Yes. COGS is classified as an expense because it reflects the direct costs of creating or purchasing the goods a company sells. Unlike operating expenses such as rent or marketing, COGS is directly linked to revenue generation. It is subtracted from sales revenue to calculate gross profit.

Where is COGS on an income statement?

COGS typically appears near the top of the income statement, just below revenue or sales. It is deducted from total revenue to arrive at gross profit, a key measure of profitability before operating expenses are considered.

Is COGS the same as cost of sales?

While often used interchangeably, COGS specifically refers to physical goods, while cost of sales can include service-related costs. Manufacturing and retail businesses typically use COGS, while service companies use cost of sales.

Should Shopify store owners include software costs in COGS?

Generally, no. Shopify fees, payment processing, and software subscriptions are operating expenses, not COGS. Only include costs directly attributable to acquiring or producing the specific products sold.

How often should COGS be calculated?

Most businesses calculate COGS monthly for management reporting and quarterly for financial statements. High-volume businesses may calculate weekly or even daily for operational insights.

Actionable COGS Optimization Tips for Store Growth

Supplier Negotiation Strategies:

  • Bundle orders for volume discounts
  • Establish long-term contracts for price stability
  • Explore alternative suppliers regularly
  • Negotiate payment terms to improve cash flow

Forecasting & Inventory Management:

  • Use historical COGS data for accurate forecasting
  • Implement just-in-time inventory strategies
  • Monitor inventory turnover rates monthly
  • Set reorder points based on COGS trends

Technology & Automation:

  • Implement perpetual inventory systems
  • Use automated reordering based on COGS data
  • Set up alerts for margin compression
  • Integrate inventory and accounting systems

Cost Analysis & Product Mix:

  • Regularly review product-level COGS
  • Eliminate consistently unprofitable items
  • Focus marketing on high-margin products
  • Bundle low-margin with high-margin items

Ready to Optimize Your COGS Tracking?

Download Your Free COGS Calculator Template and start making data-driven decisions today. Our comprehensive Excel and Google Sheets templates include:

  • Pre-built formulas for instant calculations
  • Multiple inventory valuation methods
  • Visual trend analysis charts
  • Error-checking and validation tools
  • Step-by-step setup instructions

Take Your Business Further with B2Bridge Solutions

For growing businesses ready to scale, B2Bridge offers comprehensive business automation and optimization tools designed specifically for Ecommerce success:

  • Advanced Inventory Management: Real-time tracking with automated COGS calculations
  • Business Intelligence Dashboards: Visual insights into profitability and trends
  • Financial Reporting Automation: Streamlined accounting and tax preparation
  • Multi-Channel Integration: Unified COGS tracking across all sales platforms
  • Expert Support: Guidance from Ecommerce and accounting professionals

Get Your Free COGS Template Now

→ Get a free live demo with B2Bridge’s expert

Start optimizing your COGS today and unlock the profit potential hiding in your numbers!

Conclusion

Mastering your COGS cost of goods calculation is essential for building a profitable, sustainable business. From understanding basic definitions to implementing advanced optimization strategies, accurate COGS tracking provides the foundation for informed pricing, inventory management, and strategic decisions.

Whether you’re running a growing Shopify store or managing complex omnichannel operations, the principles and strategies outlined in this guide will help you maximize profits while maintaining competitive pricing. Start with our free template, implement best practices gradually, and watch your business margins improve over time.

Learn how to accurately calculate your Cost of Goods Sold (COGS) with our easy-to-follow guide and free template. Optimize your business profits by using B2Bridge – All-in-one B2B app today – explore our pricing plans, discover customer success stories, and contact us to get personalized support. Start managing your costs smarter now!

5/5 - (1 vote)
ha my phan b2bridge.io

Hi, I’m Ha My Phan – an ever-curious digital marketer crafting growth strategies for Shopify apps since 2018. I blend language, logic, and user insight to make things convert. Strategy is my second nature. Learning is my habit. And building things that actually work for people? That’s my favorite kind of win.

Supercharge Your Shopify Store for B2B Sales Today

Get B2B Insights

Your subscription could not be saved. Please try again.
Your subscription has been successful.
B2Bridge.io-logo-built-for-shopify
  • Headquarter: Viwaseen Tower, Nam Tu Liem Dist., Hanoi, Vietnam
  • Ho Chi Minh City: Lim Tower 3, Dist. 1, HCMC, Vietnam
  • Singapore: 16 Collyer Quay, #12-OO Income@Raffles, Singapore 049318
  • United Kingdom: The Old Cinema, Fishmarket Road, Rye, TN31 7LP, United Kingdom
  • Estonia: Pärnu mnt 141-43, Tallinn 11314, Estonia
  • Phone: +84 983 513 599

© 2025 B2Bridge – B2B All In One Solution for Shopify

[FREE TEMPLATE] 12 B2B Price List Templates on Google Sheet

Close deals faster with our ready-to-use pricing sheet template