
Cost of Goods Sold (COGS): Definition, Formula, and Examples
If you have ever looked at an income statement and wondered why the number at the top does not match what lands in your bank account, cost of goods sold (COGS) is usually the missing link. COGS captures the direct cost of producing or purchasing what you sell, and it determines how much profit you actually keep from each transaction — getting familiar with it can change how you see your entire business model.
Formula: Beginning Inventory + Purchases – Ending Inventory · Role: Subtracted from revenue to compute gross profit · Components: Raw materials, direct labor, manufacturing overhead
Quick snapshot
- COGS includes direct costs of production (BDC (Canada’s business development bank))
- Formula: Beginning inventory + purchases – ending inventory (BILL (business financial management platform))
- COGS is subtracted from revenue to calculate gross profit (Wall Street Prep (financial analysis education platform))
- How digital goods and SaaS models affect traditional COGS definitions
- Whether depreciation of production equipment is always included in COGS
- Whether COGS and cost of sales are identical in all contexts
- Whether service businesses should include direct labor in COGS
- COGS appears on the income statement after revenue and before gross profit (Wall Street Prep)
- Beginning inventory is inventory from the prior period carried forward (BILL)
- After COGS, compute gross profit: Revenue – COGS (BILL)
- Use gross profit margin to evaluate pricing and cost control (BILL)
| Attribute | Value |
|---|---|
| Formula | Beginning Inventory + Purchases – Ending Inventory (Square (payment processing and business platform)) |
| Income Statement Role | Subtracted from revenue to calculate gross profit (Wall Street Prep) |
| Gross Profit | Total revenue minus COGS (Square) |
| What COGS Includes | Raw materials, direct labor, manufacturing overhead (HubiFi (accounting automation platform)) |
| What COGS Excludes | Marketing, sales, distribution, administrative costs (Reckon (Australian accounting software provider)) |
| Inventory Methods | FIFO, LIFO, Weighted Average |
| Position on Income Statement | After revenue, before gross profit (Wall Street Prep) |
| Example Calculation (Preferred CFO) | BI $1,000,000 + Purchases $400,000 – EI $900,000 = COGS $500,000 (Preferred CFO (strategic CFO advisory firm)) |
| Example Calculation (HubiFi) | BI $10,000 + Purchases $5,000 – EI $7,000 = COGS $8,000 (HubiFi) |
What is meant by the cost of goods sold?
Understanding the COGS concept
- COGS represents the direct costs tied to producing or purchasing goods a company sells (Reckon)
- It is recorded as an expense on the income statement and subtracted from revenue to determine gross profit (Wall Street Prep)
- Only costs that vary with production volume — raw materials and direct labor — are included (HubiFi)
Cost of goods sold is not a single line item that stays the same every period. It changes based on how much you produce, what you pay for materials, and how efficiently you use labor. For a manufacturer, COGS includes the wood, steel, or fabric that becomes the finished product.
For a retailer, it is the wholesale price paid to suppliers. For a software company, it covers server hosting and customer support directly tied to delivering the service.
Bottom line: COGS varies by business type but always directly ties to production. Track it per unit to see if your pricing covers input costs.
COGS is the single most direct lens into whether your product-level economics work. A rising COGS without a matching price increase means your margin is shrinking, and that is a signal you cannot afford to ignore.
Why COGS matters for businesses
- COGS directly determines gross profit and gross margin — key health metrics for any business (Wall Street Prep)
- Lenders and investors examine COGS to evaluate operational efficiency
- Accurate COGS reporting ensures proper inventory valuation on the balance sheet
Gross profit — revenue minus COGS — is the first place investors look to see whether a business can sell its product at a sustainable markup. A company with high revenue but low gross profit may be bleeding cash on production. Tracking COGS over time reveals trends: if COGS per unit rises while sale prices hold flat, margins compress and the business model needs attention.
The pattern: COGS is not just an accounting number. It is a diagnostic tool that exposes whether your core operation is profitable before overhead costs even enter the picture.
How do you calculate cost of goods sold?
The COGS formula
- COGS = Beginning Inventory + Purchases – Ending Inventory (Square)
- Beginning inventory is the book value of inventory at the start of the accounting period (Square)
- Ending inventory is the book value of unsold inventory at the end of the period (Square)
The formula itself is straightforward, but the inputs require careful tracking. Beginning inventory comes from the previous period’s balance sheet. Purchases include all raw materials or finished goods bought during the current period. Ending inventory is counted physically or estimated using an inventory method. The difference between what you started with plus what you bought, minus what you ended with, tells you what you sold.
The formula works only if your inventory records are accurate. A miscount in ending inventory directly distorts COGS and ripples through gross profit, tax liability, and balance sheet equity.
Step-by-step calculation with example
- Start with beginning inventory — leftover stock from the prior period
- Add all purchases made during the current period
- Subtract the value of inventory still on hand at period end
- The result is COGS for that period
Consider a retailer that starts the quarter with $1,000,000 in inventory, buys $400,000 more during the quarter, and ends with $900,000 on hand. COGS is $1,000,000 plus $400,000 minus $900,000, which comes to $500,000 (Preferred CFO). In a smaller example, imagine a business that starts with $10,000, purchases $5,000, and ends with $7,000. COGS is $8,000 (HubiFi).
Calculating COGS for different inventory methods
- FIFO (First In, First Out): earliest purchased goods are sold first
- LIFO (Last In, First Out): most recently purchased goods are sold first
- Weighted Average: averages the cost of all units available for sale
The choice of inventory method changes COGS even when the physical flow of goods is identical. During periods of rising prices, FIFO produces lower COGS and higher gross profit because older, cheaper inventory is expensed first. LIFO does the opposite — it expenses the more recent, more expensive inventory first, resulting in higher COGS and lower reported profit. Weighted Average smooths the effect. Each method is permissible under generally accepted accounting principles, and the choice depends on tax strategy and financial reporting goals.
What this means: the inventory method you select is not a neutral accounting detail. It directly shapes your reported gross profit and the tax you pay. A business that switches from LIFO to FIFO, for example, may see gross margin jump several points on paper without any change in operations.
Bottom line: Your choice of inventory method (FIFO, LIFO, Weighted Average) directly affects reported COGS and gross profit. Understand the tax and reporting implications before selecting.
What are common COGS examples?
Retail and manufacturing examples
- For a retailer: the wholesale cost of merchandise purchased for resale (Square)
- For a manufacturer: raw materials, direct labor, and factory overhead (HubiFi)
- For a bakery: flour, sugar, butter, and baker wages are COGS
A clothing retailer pays $25 per shirt from the supplier and sells it for $60. The $25 is COGS. A furniture maker buys lumber for $200, pays $100 in direct labor to build a table, and allocates $50 in factory overhead. The $350 total is COGS. In both cases, the costs scale directly with the number of units sold — sell more shirts, spend more on inventory; sell more tables, spend more on wood and labor.
Service industry COGS considerations
- Service businesses may have minimal or no COGS if no physical product changes hands
- Professional services like consulting and law typically classify labor as operating expense, not COGS
- Some service businesses can include direct labor and materials under COGS if they produce a deliverable
For pure service firms — a tax consultancy or a digital marketing agency — the line between COGS and operating expenses blurs. Salaries for consultants who deliver billable work are sometimes categorized as cost of sales rather than operating expense, depending on how the business reports. However, standard accounting guidance from sources like Reckon treats administrative salaries, office rent, and marketing as operating expenses, not COGS.
The trade-off: classifying a cost as COGS vs. operating expense changes gross margin but not net income. A business with low COGS and high operating expenses looks profitable at the gross level but may be inefficient in administration. Investors read this distinction carefully.
What should not be included in COGS?
Common exclusions
- Sales and marketing expenses are not COGS (Reckon)
- Distribution and shipping costs are excluded (Reckon)
- Administrative salaries, rent, and utilities for corporate offices are not COGS (Reckon)
The guiding principle is simple: if a cost would exist even if no products were sold, it is probably not COGS. Marketing salaries, office rent, and management overhead stay regardless of how many units move out the door. COGS, by contrast, should rise and fall directly with sales volume.
Many small business owners mistakenly lump shipping and packaging into COGS. Under standard reporting, those costs belong in operating expenses unless they are directly tied to production. Misclassification can overstate gross profit and mislead lenders.
Distinguishing COGS from operating expenses
- Operating expenses include rent, utilities, insurance, marketing, and administrative payroll (HubiFi)
- COGS covers direct production costs like materials and factory labor (HubiFi)
- Depreciation of production equipment may be included in COGS, while depreciation of office furniture is an operating expense
The clearest way to separate COGS from operating expenses is to ask whether the cost can be traced directly to a specific unit sold. A factory worker’s wage is traceable to the product; the CEO’s salary is not. A raw material can be mapped to inventory; an advertising campaign cannot. This distinction is not just accounting trivia — it determines gross margin, which investors use to compare businesses across industries.
Why this matters: confusing COGS with operating expenses inflates gross profit and hides inefficiencies. A manufacturer that misclassifies factory rent as an operating expense, for instance, reports a higher gross margin than it actually earns.
Are COGS still used today?
Modern relevance of COGS
- COGS remains a standard metric on every income statement (Square)
- Required for calculating gross profit and gross margin — core investor metrics
- Even digital and subscription businesses report some form of COGS
COGS is not a relic of old-school manufacturing. Every business that sells a product or service with direct costs needs to track it. The metric is embedded in accounting standards worldwide and appears on income statements from sole proprietorships to publicly traded companies. Without COGS, gross profit cannot be calculated, and without gross profit, a business cannot evaluate whether its core product is economically viable.
COGS in different business models
- Retailers and wholesalers use purchase costs as COGS
- Manufacturers calculate COGS from raw materials, labor, and overhead
- Service businesses may have near-zero COGS if they resell no physical goods
A SaaS company, for example, typically includes server hosting, data center costs, and customer support payroll in COGS. A law firm includes paralegal time and filing fees if those are billable. Each industry adapts the definition, but the core idea remains unchanged: COGS captures the expenses that disappear if no sale happens.
SaaS and digital COGS
- Cloud infrastructure costs (AWS, Azure, Google Cloud) are COGS for SaaS companies
- Customer onboarding and support directly tied to delivery can be COGS
- Software development salaries are generally R&D expense, not COGS
Digital businesses pushed the accounting industry to reconsider what counts as COGS. When a customer pays $100 per month for a software subscription, the provider’s direct costs include servers, bandwidth, and support agents who keep the product running. Those costs scale with user count. Development salaries, on the other hand, are typically classified as research and development — an operating expense — because they do not vary directly with the number of customers served.
Step-by-step guide: How to calculate COGS for your business
- Determine your beginning inventory. Pull the inventory value from your balance sheet at the start of the period. This is the inventory carried over from the previous period (Square).
- Add all purchases made during the period. Include raw materials, finished goods, or components bought for production or resale (Square).
- Count ending inventory. Physically count or estimate the value of unsold inventory at the end of the period.
- Apply the formula. COGS = Beginning Inventory + Purchases – Ending Inventory (Wall Street Prep).
- Record COGS on the income statement. Place it after revenue and before gross profit (Wall Street Prep).
- Calculate gross profit. Subtract COGS from total revenue to get gross profit (Square).
For a small business using cash-basis accounting, the same formula applies, but the timing of when purchases are recorded may differ from accrual accounting. In either case, the inventory count at period end is the most critical input — if it is wrong, the entire COGS calculation is wrong.
Confirmed facts
- COGS formula is Beginning Inventory + Purchases – Ending Inventory (Square)
- Gross profit equals revenue minus COGS (Wall Street Prep)
- COGS appears on the income statement after revenue (Wall Street Prep)
- COGS includes raw materials and direct labor (HubiFi)
What’s unclear
- Whether digital-only products like software licenses have meaningful COGS beyond hosting
- How to classify costs that straddle production and distribution (e.g., warehouse rent)
- How COGS definitions will evolve as hybrid product-service models become more common
COGS refers to the direct costs of producing the goods a company sells.
COGS is recorded as an expense and subtracted from revenue to determine gross profit.
Understanding COGS is not just about getting the books right — it is about knowing whether your business can sustainably turn revenue into profit. For the small business owner in Canada or the United States, the accounting treatment of COGS directly impacts tax liability and lender confidence. Miscalculating it means overpaying taxes or underreporting margin. The formula is simple, but the inputs — inventory tracking, purchase records, period-end counts — demand discipline. For the entrepreneur building a product-based business, the choice is clear: invest in accurate COGS tracking now, or discover the hard way that your gross margin is thinner than you thought.
Related reading: Best Cashback Credit Card · Forex Awards Best Nominations
Understanding direct costs is essential because the definition of gross profit directly depends on how accurately you calculate COGS.
Frequently asked questions
How do I calculate COGS in Excel?
Set up a table with columns for Beginning Inventory, Purchases, and Ending Inventory. Use the formula =Beginning_Inventory + Purchases – Ending_Inventory. For multiple products, use SUMPRODUCT to weight quantities by per-unit cost.
Is COGS the same as cost of sales?
In most contexts, yes. Cost of sales is a broader term that sometimes includes direct labor and overhead for service businesses. COGS traditionally applies to physical goods, but the two are often used interchangeably on income statements.
Can COGS be negative?
No. A negative COGS would imply that ending inventory exceeds beginning inventory plus purchases, which would mean inventory increased more than what was bought — generally impossible outside of data entry errors or inventory write-ups.
What is the difference between COGS and operating expenses?
COGS covers direct costs of producing goods — materials, direct labor, factory overhead. Operating expenses cover everything else: marketing, rent, administrative salaries, and research. COGS varies with sales volume; operating expenses tend to be fixed over a period (HubiFi).
How does COGS affect gross profit?
Gross profit equals revenue minus COGS. Every dollar increase in COGS reduces gross profit by the same amount. A business with $100,000 revenue and $60,000 COGS has $40,000 gross profit. If COGS rises to $70,000, gross profit falls to $30,000 — a 25 percent drop (Square).
What is the COGS formula in one sentence?
Beginning Inventory plus Purchases minus Ending Inventory equals Cost of Goods Sold (Square).
Do I need COGS if I only sell services?
If you resell no physical goods and incur no direct production costs, your COGS may be zero. However, many service businesses still categorize billable labor and materials as cost of sales. Check with your accountant for your specific reporting framework.