Unlocking the Secrets of Cost of Goods Sold (CoGS) – What You Need to Know
Cost of goods sold (COGS) is the inventory and production cost attached to the goods a business actually sold during a reporting period. It is not the same as every cash payment to suppliers, every variable expense, or total operating cost. Calculate it from the flow of inventory, apply one consistent cost policy, and subtract it from net sales to find gross profit. The most important controls are accurate cutoffs, reliable inventory counts, and clear rules for what belongs in product cost.
Scope: U.S.-focused educational guidance. Federal tax references use 2025 IRS instructions and publications available as of August 5, 2026. Financial-reporting and tax treatment can differ, so material classifications and method changes should be reviewed with a qualified accountant.
What exactly is cost of goods sold?
COGS is the portion of product or inventory cost recognized as an expense because the related goods were sold during the period.
Before sale, product cost normally sits in inventory as an asset. When the product is sold, its assigned carrying cost moves from inventory to COGS, matching the expense with the related revenue. The IRS Tax Guide for Small Business expresses the same inventory-flow logic for tax reporting: add the costs available for sale, then subtract closing inventory to determine the cost associated with goods sold.
Retailers may use the label cost of sales; manufacturers may present COGS or cost of products sold; service and software businesses may present cost of revenue. These labels can cover different cost pools. The decision-useful question is not the label but whether the policy consistently captures the costs of delivering the revenue shown above gross profit.
The income-statement bridge
Net sales − COGS = Gross profit
Gross profit shows what remains from product or service revenue after the assigned direct or production costs of that revenue. It must still cover selling, general, administrative, financing, and tax costs before the business reaches net profit.
What COGS includes—and what it excludes
COGS usually includes the purchase or production costs needed to bring inventory to a saleable condition. It usually excludes costs primarily tied to selling the product, running the corporate office, financing the business, or paying income taxes. The boundary can require judgment, especially for manufacturing overhead, fulfillment, service-delivery payroll, and mixed-use facilities.
How do you calculate COGS correctly?
Start with beginning inventory, add the inventoriable costs acquired or produced during the period, and subtract ending inventory.
Core periodic-inventory formula
COGS = Beginning inventory + Net purchases + Direct production costs + Allocable production overhead − Ending inventory
For a retailer, the middle terms may be summarized as net merchandise purchases plus freight-in and other acquisition costs. For a manufacturer, they may include raw materials used, direct labor, and allocable factory overhead. The exact cost pool depends on the accounting framework and policy.
Worked example: a small manufacturer
The following is an illustrative planning example, not an observed industry benchmark. Assume the business uses the same inventory valuation policy at the beginning and end of the year.
Illustrative COGS schedule for one year
The schedule connects inventory, production spending, and ending stock to the amount recognized in COGS.
Illustrative cost of goods sold calculation
Line item
Amount
Treatment
Beginning inventory
$48,000
Unsold cost carried in from the prior period
Net materials and merchandise purchases
$162,000
Acquisition cost after returns and trade discounts
Direct production labor
$36,000
Paid labor traceable to production
Allocable production overhead
$24,000
Factory costs assigned under the stated policy
Cost available for sale
$270,000
Sum of the four lines above
Less: ending inventory
($54,000)
Cost not yet recognized because the goods remain unsold
If net sales were $360,000, gross profit would be $144,000 and gross margin would be 40%: ($360,000 − $216,000) ÷ $360,000. This does not mean the business earned $144,000 in cash or net income; operating expenses, working-capital changes, capital spending, interest, and taxes still matter.
How should a perpetual system reconcile to the formula?
A perpetual inventory system records an estimated or assigned cost each time a unit is sold, but the period-end result should still reconcile to physical inventory and the accounting policy. Cycle counts, year-end counts, purchase cutoffs, returns, shrinkage, and write-downs can all create adjustments between book inventory and actual inventory.
Which costs belong in COGS—and which do not?
Include costs that are part of acquiring, producing, or preparing the sold goods under the applicable policy; exclude costs whose main function is selling, administration, financing, or income tax.
For U.S. federal tax reporting, the IRS states that freight-in on merchandise or production inputs is part of COGS and that direct and necessary manufacturing overhead can be included. The same publication distinguishes an integral product container from a package used only for shipping or selling. See the IRS discussion of COGS components.
Practical classification map
Use this as a decision framework, then document the final policy for your business and reporting basis.
Examples of costs generally included in or excluded from COGS
Cost
Likely treatment
Reason and caution
Merchandise purchased for resale
Inventory, then COGS when sold
Use invoice cost adjusted for returns, trade discounts, and eligible acquisition costs.
Raw materials incorporated into products
Inventory, then COGS when sold
Trace directly where practical.
Production-line wages
Usually production cost
Include paid labor attributable to making the product; owner labor that was not paid is not an invented cost.
Allocation must be systematic and linked to production, not used to shift unrelated corporate overhead into COGS.
Inbound freight and handling
Usually acquisition or inventory cost
Distinguish freight-in from outbound delivery and selling costs.
Outbound customer shipping
Often fulfillment or selling expense
Presentation varies by policy and reporting framework; apply the policy consistently and disclose material judgments.
Sales commissions and advertising
Usually operating expense
These costs generate demand rather than manufacture or acquire inventory.
Head-office payroll, legal, and finance costs
Usually operating expense
Do not allocate general administration to product cost without a valid requirement and rational basis.
Interest and income tax
Not COGS in ordinary presentation
They appear below operating results, subject to specialized capitalization rules and facts.
A cost is not automatically COGS merely because it varies with sales. Payment-processing fees, marketplace commissions, and last-mile delivery may be variable but are often presented outside COGS.
Can a service business have COGS?
A pure service business may have no merchandise inventory and therefore no tax COGS schedule. The IRS notes that most service businesses do not need to calculate COGS when merchandise is not an income-producing factor. Management reporting may still present a cost-of-revenue line for directly attributable service-delivery costs, such as subcontractors, hosting, or delivery payroll. That managerial presentation should not be assumed to equal the tax treatment.
Why does ending inventory have such a large effect on profit?
Because ending inventory is subtracted in the COGS formula, every dollar of error in ending inventory produces an equal-dollar error in COGS and gross profit before tax effects.
Ending-inventory error sensitivity
This relationship follows directly from the formula and assumes all other inputs are correct.
Effect of ending inventory errors on COGS and gross profit
Inventory-count error
Effect on COGS
Effect on gross profit
Effect on ending inventory asset
Ending inventory overstated by $10,000
Understated by $10,000
Overstated by $10,000
Overstated by $10,000
Ending inventory understated by $10,000
Overstated by $10,000
Understated by $10,000
Understated by $10,000
The error can reverse in the following period if the incorrect ending inventory becomes the next period’s beginning inventory, but that does not make the original statements correct.
Watch the cutoff, not just the count
A perfectly counted warehouse can still produce the wrong COGS if goods in transit, consigned inventory, supplier invoices, customer returns, or December and January shipments are recorded in the wrong period. Ownership terms and the reporting policy determine whether a unit belongs in inventory at the cutoff date.
Physical counts should reconcile quantities, locations, ownership, condition, and unit cost. Slow-moving, damaged, or obsolete goods may also require valuation adjustments. For U.S. GAAP inventory outside LIFO and the retail inventory method, FASB Accounting Standards Update 2015-11 describes subsequent measurement at the lower of cost and net realizable value; LIFO and retail-method inventory remain outside that simplification. Review the FASB inventory measurement update for the formal scope and definitions.
How do FIFO, LIFO, and specific identification change COGS?
They assign different historical costs to the units sold and the units left in inventory, so they can change reported COGS even when physical sales volume is identical.
A cost-flow assumption is an accounting method, not necessarily a statement about which physical box left the warehouse. The IRS accounting-method guide defines specific identification, FIFO, and LIFO and warns that LIFO rules are complex.
Inventory cost-flow methods compared
The rising-price effects below are directional, not guaranteed, because actual purchase patterns, quantities, write-downs, and inventory layers matter.
Comparison of specific identification, FIFO, weighted average, and LIFO
Method
How cost is assigned
Likely effect when purchase costs rise
Best fit and limitation
Specific identification
Matches the actual recorded cost to the specific item sold.
Depends on which identified items sell.
Useful for unique, high-value, or serial-numbered items; impractical for large pools of interchangeable units.
FIFO
Assigns older costs to units sold first and recent costs to ending inventory.
Usually lower COGS and higher ending inventory than LIFO.
Intuitive for many products; reported margin may reflect older costs while replacement costs are higher.
Weighted average
Blends unit costs across the defined inventory pool or period.
Smooths the effect between older and newer costs.
Useful for homogeneous inventory; can mask sharp changes in the cost of recent purchases.
LIFO
Assigns the newest costs to units sold first for accounting purposes.
Usually higher COGS and lower ending inventory than FIFO.
Permitted in certain U.S. contexts but operationally and tax-accounting intensive; adoption and maintenance require specialized review.
Changing the method can affect taxable income, book income, comparability, inventory carrying values, and disclosures. Do not switch methods simply to obtain a preferred margin.
How is COGS different from operating expenses and contribution margin?
COGS is a financial-statement cost category tied to sold goods or delivered revenue, while operating expenses and contribution-margin costs answer different questions.
Four measures that should not be mixed
A cost can be variable without being COGS, and a production cost can be fixed while still being allocated to inventory.
Comparison of COGS, gross profit, operating expenses, and contribution margin
Measure
Core formula or role
Decision it supports
COGS
Cost assigned to the revenue recognized from sold goods or delivered output
Product-cost control, inventory accounting, and gross-profit reporting
Gross profit
Net sales − COGS
Whether pricing and the production or delivery model leave enough value to cover the rest of the business
Operating expenses
Selling, general, administrative, research, and other operating costs outside COGS
Cost of running the organization beyond the product or revenue-delivery layer
Contribution margin
Revenue − all variable costs included in the chosen management definition
Short-run volume, pricing, channel, and break-even decisions
Define contribution margin explicitly. Some teams subtract only variable COGS; others also subtract payment fees, commissions, or variable fulfillment costs.
Why gross margin percentage needs context
Gross margin percentage is (net sales − COGS) ÷ net sales. A rising margin can come from higher prices, cheaper inputs, better product mix, less scrap, better labor efficiency, or an inventory-method effect. A falling margin can reflect the opposite—or a deliberate strategy such as launching an entry product. The ratio identifies a change; it does not prove the cause.
How should managers use COGS to improve decisions?
Break total COGS into controllable drivers—volume, purchase price, yield, labor time, overhead absorption, product mix, and inventory adjustments—rather than managing only the final percentage.
Define one written cost policy.
List every recurring cost category and state whether it goes to inventory, COGS, fulfillment, sales, or administration. Record the allocation basis for shared production costs.
Build unit economics from operational drivers.
Track material quantity per unit, purchase price, scrap rate, direct labor hours, labor rate, and machine or production hours. These drivers explain why unit COGS changed.
Reconcile book inventory to physical reality.
Use cycle counts and period-end counts to investigate shrinkage, damage, misplaced stock, duplicate SKUs, negative inventory, and timing errors.
Separate price, volume, mix, and efficiency effects.
A higher COGS total may be healthy if sales volume rose faster. Compare COGS per unit and gross margin by product, customer, channel, and period before cutting costs.
Forecast COGS with scenarios, not one flat percentage.
In an FML-style forecast, keep sales volume, unit cost, purchase lead time, inventory days, and supplier price changes as separate assumptions. This makes margin and cash needs explainable.
A useful monthly COGS review
Reconcile beginning inventory to the prior period’s ending balance.
Compare purchase prices and freight-in against supplier terms.
Review labor hours, yield, scrap, and production downtime.
Inspect returns, shrinkage, damage, and obsolete stock adjustments.
Explain gross-margin variance by product and channel, not only in total.
Tie the COGS roll-forward to the general ledger and inventory subledger.
What mistakes most often distort COGS?
The most damaging errors come from inconsistent classification, poor cutoffs, unreliable inventory quantities, and cost methods that do not match the documented policy.
Expensing purchases immediately. Buying inventory does not automatically mean the full purchase cost belongs in the current period’s COGS; unsold cost remains in ending inventory.
Ignoring returns and personal withdrawals. Supplier returns, trade discounts, customer returns, samples, gifts, and owner withdrawals can alter purchases, inventory, revenue, or COGS. The IRS specifically instructs sole proprietors to remove inventory items withdrawn for personal use from purchases used in the COGS schedule.
Mixing inbound and outbound logistics. Freight-in may be an acquisition cost, while customer delivery may be a selling or fulfillment cost. Combining them hides the source of margin change.
Loading unrelated overhead into product cost. A production allocation should represent resources used to make or prepare inventory, not become a plug used to improve operating-expense ratios.
Leaving shrinkage and obsolescence unrecorded. Book inventory that no longer exists or cannot be sold at its recorded amount can overstate assets and profit.
Changing methods informally. Switching from FIFO to another method, revising capitalization practices, or changing how inventory is treated can be an accounting-method change rather than a simple estimate update.
Using one blended margin for every decision. Product, channel, customer, and geography mixes can move total COGS even when each item’s unit economics are unchanged.
What tax and financial-reporting rules require extra care?
Inventory accounting is a method issue, not merely a spreadsheet choice; tax rules, U.S. GAAP, management reporting, and operational systems can require different treatments and reconciliations.
Small-business tax exceptions are specific and dated
The 2025 Schedule C instructions state that a qualifying small business taxpayer may choose not to keep tax inventory if the alternative method clearly reflects income and follows one of the permitted treatments. For that 2025 instruction set, the small-business gross-receipts threshold is $31 million averaged over the three prior tax years, subject to the tax-shelter restriction and detailed aggregation rules. The threshold is inflation-indexed, so do not reuse the 2025 amount for a later year without checking that year’s return instructions.
Capitalization can extend beyond obvious direct costs
The IRS basis and capitalization guidance explains that businesses subject to the uniform capitalization rules may need to capitalize direct costs and an allocable share of indirect costs into inventory or produced property. Those costs are then recovered through COGS or another applicable mechanism rather than deducted immediately.
Method changes may need formal consent or filing
The IRS identifies Form 3115 as the form used to request a change in an overall accounting method or in the accounting treatment of an item. Whether a change is automatic, nonautomatic, or not a method change depends on the facts and current procedures.
When professional review is warranted
Get individualized accounting or tax advice before adopting LIFO, changing an inventory method, changing capitalization policy, writing down material inventory, preparing audited or reviewed statements, correcting a prior-period error, or reconciling materially different book and tax inventory balances. A generic COGS formula cannot resolve ownership terms, specialized industry rules, related-party imports, tax elections, or financial-statement disclosure requirements.
What should you do next?
Treat COGS as a controlled inventory roll-forward, not as a percentage copied from last year. Document what enters product cost, reconcile quantities and values, separate operational drivers, and verify that every period uses the same policy. When COGS changes, explain the change through price, volume, mix, yield, labor, overhead, and inventory adjustments. That turns one income-statement line into a practical tool for pricing, purchasing, production, cash planning, and margin control.
Disclaimer
Financial Models Lab provides this article and its calculators for educational and business-planning purposes only. They are not personalized financial, accounting, tax, legal, investment, or lending advice. Figures shown are illustrative planning estimates based on publicly available sources, observed market information, and stated assumptions; they are not guaranteed benchmarks, forecasts, quotes, or expected results. Actual startup costs, revenue, expenses, margins, funding needs, and break-even timing vary by location, date, business size, operating model, financing, and execution. Review the cited sources and replace sample assumptions with current local data, supplier quotes, and your own operating inputs. Calculator and financial-model outputs change when assumptions change. Consult qualified professional advisers before making material commitments. Financial Models Lab sells related templates and may link to its own products. Please report suspected errors through our contact page.
Choosing a selection results in a full page refresh.