Basis Report/Resources/Cost of Goods Sold Guide

Income statement · Direct costs

Cost of Goods Sold (COGS): Formula, Definition & Industry Benchmarks

Cost of goods sold is the direct cost of producing what a company actually sold during a period — the single line that sits between revenue and gross profit on every income statement. Getting COGS right matters because it determines gross margin, which sets the ceiling for every dollar that flows down to operating income, net income, and free cash flow. Understanding the formula, what COGS does and does not include, and how it varies across industries is the foundation for reading any 10-K income statement.

Short answer

Cost of goods sold (COGS) is the direct cost of producing the goods a company sold in a period — materials, direct labor, and manufacturing overhead. Formula: COGS = Beginning Inventory + Purchases − Ending Inventory. Apple (AAPL) FY2024: $391B revenue − $211B COGS = $180B gross profit, a 46% gross margin.

COGS = Beginning Inventory + Purchases − Ending Inventory

What Is Cost of Goods Sold?

Cost of goods sold (COGS) — sometimes labeled cost of revenue or cost of sales on a 10-K — is the direct expense tied to producing the specific units a company sold in a given period. It appears as the first deduction from revenue on the income statement, immediately creating the gross profit line that every subsequent cost must be paid out of.

COGS is a matched cost: it includes only the costs associated with inventory actually sold, not inventory still sitting in a warehouse. The cost of unsold goods remains on the balance sheet as an inventory asset until those units are eventually sold, at which point the cost moves from the balance sheet into COGS on the income statement.

What counts as COGS depends on the business model. For a manufacturer, COGS is raw materials, direct factory labor, and manufacturing overhead (equipment depreciation, factory utilities). For a retailer, COGS is simply the wholesale price of merchandise sold. For a SaaS company, COGS includes hosting infrastructure, third-party data costs, and the support headcount dedicated to delivering the software. The common thread: only the direct cost of delivering the product or service to the customer qualifies.

COGS Formula

There are two ways to calculate cost of goods sold. The inventory-build formula is used when preparing financial statements; the income statement identity is used to cross-check or derive COGS when gross profit is already known.

Beginning Inventory
The cost of unsold inventory carried over from the prior period (opening balance sheet amount).
+ Purchases (or Production Costs)
Materials purchased, direct labor incurred, and manufacturing overhead applied during the period.
− Ending Inventory
The cost of unsold goods remaining at period end (closing balance sheet amount). Only what was sold flows through.
= Cost of Goods Sold
The direct cost matched to the units actually sold this period. Subtracting from revenue gives gross profit.

The income statement identity — COGS = Revenue − Gross Profit — is the faster check. Apple reports Revenue of $391B and Gross Profit of $180B, so COGS must be $211B. You rarely need to reconstruct the inventory build from a 10-K; the identity confirms the numbers tie.

Worked Example: Apple (AAPL) FY2024

Apple reports COGS as “Cost of Revenue” in its income statement — a common label for service-heavy companies where “goods sold” is a partial description. The waterfall below shows how COGS feeds every line below it.

Income Statement LineAmount% of Revenue
Revenue$391B100%
− Cost of Revenue (COGS)$211B54%
= Gross Profit$180B46%
− Operating Expenses (R&D + SG&A)$57B15%
= Operating Income (EBIT)$123B31%
= Net Income (after interest & taxes)$94B24%

Apple's 54% COGS ratio is lower than a typical hardware company because its high-margin Services segment (App Store, iCloud, AppleCare) carries almost no incremental COGS per transaction. That mix shift is the story inside the $211B number — and why gross margin has expanded even as iPhone unit volumes have plateaued.

COGS vs. Operating Expenses: The Key Distinction

The line between COGS and operating expenses (OpEx) is the line between direct production costs and indirect business costs. COGS only includes costs that would not exist if the company did not produce and sell that unit. Operating expenses — SG&A, R&D, marketing — are incurred to run the business as a whole, not to produce any specific unit.

In practice: a factory worker's wages assembling a product belong in COGS; the CFO's salary belongs in SG&A. The raw material in a finished good is COGS; the advertising campaign that sells it is SG&A. A software engineer writing the core product (capitalized development cost, then amortized through COGS) is different from a sales engineer closing deals (SG&A). The boundary is whether the cost is tied to making the product or running the business.

Why it matters: misclassifying an expense between COGS and OpEx does not change net income, but it changes gross margin and operating margin — two of the most commonly compared metrics between peers. A company that capitalizes excess overhead into COGS (deferring it to future periods via inventory) will report temporarily higher gross margins until that inventory is sold. This is one of the earnings quality red flags analysts look for in EBITDA adjustments and working capital analysis.

COGS as % of Revenue: Industry Benchmarks

COGS as a percentage of revenue is the inverse of gross margin — a sector with 70% gross margin has a 30% COGS ratio. The table below shows typical ranges and why they differ.

SectorCOGS / RevenueWhy it lands here
SaaS / Software15–30%Near-zero marginal cost per additional user; COGS is mostly hosting, support, and third-party APIs
Pharmaceuticals25–40%Manufacturing cost is low relative to drug price; generic drugs sit at the high end
Consumer Staples / Branded45–65%Commodity input costs offset by brand pricing power; higher COGS in private-label
Industrials / Manufacturing60–80%Material and direct labor costs are large relative to selling price; thin gross margins
Retail (non-food)60–75%Merchandise cost dominates; luxury retail sits at the low end, mass-market at the high end
Grocery / Food Retail70–80%Volume model with thin per-unit margins; store-brand mix improves the ratio slightly

For live sector data, the gross margin by industry tool shows current median gross margins — and by inversion, the COGS ratio — for every major sector, pulled from live market data.

Why COGS Matters for Investors

COGS is the first place where a company's pricing power and supply chain efficiency show up in the numbers. A rising COGS ratio (COGS growing faster than revenue) signals that either input costs are inflating, the product mix is shifting toward lower-margin SKUs, or the company is discounting to drive volume. Each is a different problem with a different prognosis.

The relationship between COGS and gross profit is the foundation for return on invested capital (ROIC). A durable low-COGS model — SaaS, branded consumer, pharma — creates a structural gross margin advantage that compounds: more gross profit dollars fund more R&D and distribution, which widens the moat, which sustains the low-COGS advantage. Businesses with structurally high COGS ratios must compensate through inventory velocity (fast-turning retail) or operating leverage (fixed-cost manufacturing at scale).

When analyzing a 10-K, always compare COGS as a percentage of revenue across at least three years. A stable or declining COGS ratio with growing revenue is a strong quality signal. A rising COGS ratio should trigger questions: Is it commodity inflation? Channel mix? A new product segment with lower margins being deliberately built? The answer changes whether a margin compression is a temporary headwind or a structural deterioration.

🧮
Try the Gross Margin by Industry
Compare any ticker's gross margin (and COGS ratio) to its sector median in real time.
Open Calculator →
🧮
Try the DCF Calculator
Model free cash flow from first principles. COGS and gross margin drive the FCF assumptions.
Open Calculator →
Want the full picture on AAPL?See how our AI scores AAPL across earnings quality, capital allocation, moat, and 12 more dimensions.→ Generate Free AAPL Report