Cost of Goods Sold (COGS)
Cost of Goods Sold (COGS) is the direct cost of inventory sold during a period, calculated as beginning inventory plus purchases (including freight-in) minus ending inventory. It appears on tax returns, reduces taxable income, and is subtracted from revenue to determine gross profit and gross margin. Only traceable direct costs belong in COGS; indirect overhead is excluded.
Table of Contents
- How Cost of Goods Sold Impacts Your Business Tax Return
- The Basic COGS Formula Explained Step by Step
- Direct Costs That Belong in Your COGS Calculation
- Indirect Expenses You Must Exclude from COGS
- Inventory Valuation Methods
- How Service-Based Businesses Handle COGS Differently
- Common Accounting Mistakes That Distort Your Gross Margin
- Real-World Walkthrough
How Cost of Goods Sold Impacts Your Business Tax Return
Cost of Goods Sold plays a direct role in shaping the taxable income your business reports each year. When you file a Schedule C as a sole proprietor, COGS appears in Part III of the form and then carries forward to line 4 of Part II, where it is subtracted from gross receipts to arrive at gross income. The same logic applies on corporate and partnership returns, where COGS reduces gross receipts before ordinary business expenses are applied. Every dollar recorded as COGS lowers the income figure that the IRS uses to calculate your tax liability, which makes this line one of the most financially significant entries on the entire return.
Because COGS carries that much weight, accuracy matters for compliance as well as for tax savings. The IRS expects COGS to be calculated using a consistent inventory method, whether that is cost, lower of cost or market, or a method permitted under the uniform capitalization rules. Records should support the beginning inventory, purchases, ending inventory, and any adjustments such as shrinkage or returns. When those figures are documented and internally consistent, the return tells a coherent story and stands up well if questions arise.
Errors in COGS tend to attract attention because they distort the relationship between gross receipts and reported profit. A cost of goods sold figure that swings sharply from year to year, or that produces a gross profit margin far outside industry norms, can prompt scrutiny. Overstating COGS understates income and can be treated as underreporting, exposing the business to additional tax, penalties, and interest. Understating COGS has the opposite effect: the business pays more tax than necessary and loses deductions it was entitled to claim. Both directions represent a real cost, one in risk and the other in cash.
Accurate COGS depends on disciplined bookkeeping throughout the year, including reliable inventory counts at the close of each period. Reconciling inventory records against physical counts before filing reduces the chance that mistakes flow onto the return. A clean, well-supported COGS figure protects the deduction, keeps reported income defensible, and helps ensure the business pays exactly what it owes, no more and no less.
The Basic COGS Formula Explained Step by Step
The basic COGS formula captures the flow of inventory through a business over a defined period, typically a month, quarter, or year. It starts with beginning inventory, the value of goods on hand when the period opens. This figure usually matches the ending inventory from the prior period, so it grounds the calculation in a known, verifiable number. Suppose a small retailer opens the year with $20,000 of inventory on its books. That $20,000 becomes the first input in the formula.
The second component is purchases, which includes the cost of all new inventory acquired during the period, including freight and other costs necessary to bring goods to saleable condition. If the same retailer buys $50,000 of goods over the year, the purchases figure is $50,000. Adding purchases to beginning inventory gives the total goods available for sale, which in this case is $70,000. This sum represents every dollar of inventory the business could have sold during the period, whether acquired earlier or bought fresh.
The third component is ending inventory, the value of goods still on hand at the close of the period, determined by a physical count or a bookkeeping estimate. If the retailer counts $15,000 of inventory remaining at year end, that number is subtracted from total goods available. The calculation is: $20,000 beginning inventory plus $50,000 purchases, totaling $70,000, minus $15,000 ending inventory, yielding $55,000 of cost of goods sold.
The logic behind the subtraction is straightforward. Whatever was available for sale either left the business as a sale or stayed behind as ending inventory. By removing the ending balance from the total available, the formula isolates the cost of what was actually sold. Running a second example with a service-focused reseller reinforces the mechanics: opening inventory of $8,000, purchases of $12,000, and ending inventory of $5,000 produce a COGS of $15,000. Each step depends on accurate records at both ends of the period, since beginning and ending inventory values directly shape the final result and, in turn, the reported gross profit.
Direct Costs That Belong in Your COGS Calculation
A precise COGS calculation begins with a disciplined inventory of the costs that attach directly to the goods you sell. Raw materials form the foundation of this category. For a manufacturer, these are the physical inputs that become part of the finished product—steel, fabric, lumber, chemicals, or components purchased from suppliers. A retailer’s equivalent is the wholesale purchase price of merchandise held for resale. In both cases, the cost is traceable to specific units, which is the defining test for inclusion.
Freight-in belongs in COGS as well. The shipping charges incurred to bring materials or merchandise to your facility are part of what it costs to make inventory saleable, so they should be capitalized into inventory value rather than expensed as general shipping overhead. The same logic applies to duties, tariffs, and customs brokerage fees on imported goods. Direct labor covers the wages and payroll costs of employees whose work can be tied directly to production—machine operators, assembly line workers, and hands-on fabricators. Production supplies, such as machine oil, molds, jigs, small tools, and consumables used up in manufacturing, round out the direct cost picture.
The core distinction between direct and indirect costs is traceability. A cost is direct when it can be assigned to a specific product or batch without arbitrary allocation. Indirect costs—factory rent, supervisory salaries, quality control staff, utilities, depreciation on the building, and administrative overhead—benefit production as a whole yet resist clean assignment to individual units. These belong in operating expenses or manufacturing overhead, not COGS, for a simple reason: including them distorts unit economics and makes gross margin comparisons across products unreliable.
Practical guidance helps here. Build cost records at the purchase-order or work-order level so every invoice ties to specific inventory. Treat the question of whether a cost would disappear if you stopped producing that item as a useful filter. Costs that vanish with the product line are strong candidates for COGS; costs that persist regardless are typically indirect. Consistency matters too—apply the same classification rules period after period so your margin trends remain meaningful and comparable.
Indirect Expenses You Must Exclude from COGS
Indirect expenses are the overhead costs that support your business as a whole rather than any specific product or service. Common examples include rent for your office or warehouse, marketing and advertising spend, administrative salaries for roles like HR or finance, and utilities such as electricity and internet. These costs are essential to running the business, yet they do not attach directly to the production or acquisition of the goods you sell. For that reason, they belong below the gross profit line, in the operating expenses section of your income statement, and must be excluded from COGS.
The reason for this exclusion is that COGS is designed to measure the direct cost of the goods you sold during a period. Including indirect expenses in COGS distorts gross margin, which is the key metric for understanding the profitability of your core product or service. If rent or marketing costs are folded into COGS, gross margin appears lower than it actually is, making it harder to compare your performance against industry benchmarks or prior periods. Investors and managers rely on gross margin to assess pricing strategy and production efficiency; a distorted figure can lead to poor decisions, such as raising prices unnecessarily or cutting costs that are actually under control.
Tax reporting is another area where misclassification causes problems. COGS is deducted from revenue to arrive at gross profit, and it directly reduces taxable income. However, tax authorities require that indirect expenses be treated as operating expenses, which are subject to different rules and limitations. For example, some marketing costs may need to be capitalized or amortized, and certain administrative expenses may be partially nondeductible. Including them in COGS can understate taxable income in the current year and create compliance risk, penalties, and amended returns. Consistent classification also matters for financial statement comparability and for audits, where mixing direct and indirect costs can raise questions about the accuracy of your records.
In practice, keeping indirect expenses out of COGS means establishing clear cost accounting policies. Review each expense and ask whether it can be traced directly to the goods you sold. If not, it belongs in operating expenses. This discipline protects the integrity of your gross margin and keeps your tax filings accurate.
Inventory Valuation Methods
Inventory valuation methods determine how costs flow through a business’s financial statements, and the choice among them directly shapes both cost of goods sold and ending inventory. Under the first-in, first-out (FIFO) method, the oldest inventory costs are assigned to COGS first, while the most recent costs remain in ending inventory. In a period of rising prices, FIFO produces a lower COGS and a higher ending inventory balance, which typically results in higher reported gross profit and net income. The last-in, first-out (LIFO) method reverses this flow, charging the newest costs to COGS first and leaving older, cheaper costs in ending inventory. During inflation, LIFO generates a higher COGS, a lower ending inventory value, and correspondingly lower taxable income, which is why some businesses adopt it for tax advantages. The weighted average cost method blends all costs by dividing the total cost of goods available for sale by the total units available, producing a single per-unit cost applied to both COGS and ending inventory. This approach smooths out price fluctuations and tends to sit between FIFO and LIFO in its effect on reported results.
Method selection carries specific tax consequences, and the Internal Revenue Service imposes rules that govern both the choice of method and ongoing consistency. A taxpayer generally adopts an inventory method on the first federal income tax return filed for the tax year, and once adopted, that method must be applied consistently from year to year. Changes to an established method require IRS approval, typically through Form 3115, Application for Change in Accounting Method. The LIFO conformity rule adds a further constraint: a business that uses LIFO for tax purposes must also use LIFO in its financial statements and reports, which limits flexibility for companies weighing the trade-offs. Businesses should document their method selection, apply it uniformly across inventory categories, and monitor how shifting prices affect reported COGS and ending inventory balances.
How Service-Based Businesses Handle COGS Differently
For a business that sells hours of expertise, advice, or labor rather than physical goods, the traditional COGS framework requires careful interpretation. Pure service businesses, such as law firms, consultancies, and accounting practices, often report no COGS at all. The reason is structural: these firms do not purchase inventory, hold stock, or transform raw materials into finished products. Their primary expense is people, and payroll is typically classified as an operating expense rather than a cost of goods sold. This does not mean service firms lack direct costs; it means the accounting convention treats those costs as part of selling, general, and administrative expenses unless the business chooses a more granular approach.
That approach becomes essential for hybrid or productized services. A marketing agency that resells software licenses, a design studio that orders printed materials, or a consulting firm that bills clients for specialized data subscriptions all carry costs directly tied to delivering a specific engagement. In these cases, direct materials, third-party subcontractor fees, and pass-through expenses belong in COGS because they rise and fall with client work. Direct labor is treated similarly when employees are billed specifically to client projects and their time is tracked against engagements. The judgment call is whether that labor is a cost of revenue or an operating cost; many firms put billable staff in COGS to calculate gross margin on service delivery, while keeping administrative and sales staff in operating expenses.
The broader concept that captures this is cost of revenue. Rather than the narrower cost of goods sold, cost of revenue includes every expense directly required to earn revenue, whether that revenue comes from products, services, or a mix. For a software company, it might include hosting and customer support; for a service firm, it might include project labor and reimbursable expenses. Using cost of revenue gives a clearer picture of gross margin and allows managers to compare profitability across product lines and service engagements. The key discipline is consistency: define which costs are direct, apply that definition uniformly, and disclose the policy so that gross profit figures remain meaningful to owners, lenders, and investors.
Common Accounting Mistakes That Distort Your Gross Margin
Gross margin is only as reliable as the numbers feeding into it, and several frequent bookkeeping errors quietly distort that figure. One of the most common is miscounting ending inventory. Because cost of goods sold equals beginning inventory plus purchases minus ending inventory, even a small overstatement of what remains on the shelf lowers reported COGS and inflates gross margin. An undercount does the reverse, pushing costs into the current period and making the margin look weaker than it is. Seasonal businesses and companies with stock spread across multiple locations are especially vulnerable, since a rushed or partial count can miss entire categories of goods.
Mixing personal and business purchases creates a different kind of distortion. When an owner runs personal expenses through the business account and those transactions get lumped into purchases or overhead, COGS swells and margin appears thinner than reality. The reverse also happens when legitimate business costs are paid from personal funds and never recorded, leaving costs out of the equation entirely.
Ignoring freight-in is another frequent oversight. Costs to bring inventory to your door, including shipping, duties, and handling, are part of inventory cost under standard accounting rules. When these charges are expensed elsewhere or simply missed, product costs are understated and gross margin looks healthier than the underlying economics support. Businesses that rely on suppliers at a distance tend to see the largest gaps here.
Failing to adjust for returns skews margin in both directions. Sales returns reduce revenue, and the associated inventory should flow back into stock with its cost removed from COGS. When returns are recorded as revenue reductions without the matching inventory adjustment, or when returned goods are written off without updating COGS, the margin calculation drifts from reality. High-return categories such as apparel or electronics are particularly exposed.
Each of these errors is small on its own, yet together they can shift reported margin by several percentage points, enough to mislead pricing decisions and lender conversations.
Real-World Walkthrough
To see how COGS works in practice, consider a fictional retail shop called Harbor Lane Outfitters, a small store selling outdoor apparel and gear. The store operates on a calendar year, and we will walk through its COGS calculation for the most recent fiscal year using the standard formula: beginning inventory plus purchases, minus ending inventory.
The year opens with Harbor Lane holding $48,000 in beginning inventory, representing the value of goods on hand at the close of the prior year. Over the course of twelve months, the shop purchases $312,000 worth of new merchandise from suppliers, including jackets, boots, camping equipment, and accessories. Freight and shipping charges paid to bring those goods into the store total $9,000, which get added to the purchase figure because they are costs directly tied to acquiring inventory. This brings total goods available for sale to $369,000 ($48,000 + $312,000 + $9,000).
At year-end, the staff conducts a physical count and values the remaining inventory at $57,000. That ending figure reflects unsold merchandise still sitting on shelves and in the stockroom. Subtracting it from goods available for sale gives Harbor Lane its COGS: $369,000 minus $57,000 equals $312,000.
Now consider the income statement. Total net sales for the year came to $540,000 after returns and discounts. Subtracting COGS of $312,000 produces a gross profit of $228,000, which translates to a gross margin of roughly 42.2 percent ($228,000 divided by $540,000).
What does that figure tell the owner? A 42 percent gross margin means the store retains about 42 cents from every sales dollar to cover operating expenses such as rent, wages, utilities, and marketing, with whatever remains contributing to net profit. If a prior year showed a margin of 46 percent, the drop would prompt questions: Did supplier costs rise? Was discounting heavier than usual? Did shrinkage or theft inflate COGS through a lower-than-expected ending count? Each of these possibilities can be investigated using the components that fed into the calculation. Tracking these numbers year over year turns a simple formula into a practical diagnostic tool for managing a retail business.
Frequently Asked Questions
How does cost of goods sold affect my business tax return?
COGS appears in Part III of Schedule C and carries forward to line 4 of Part II, where it is subtracted from gross receipts to arrive at gross income. Every dollar recorded as COGS lowers the income figure the IRS uses to calculate tax liability, but overstating COGS understates income and can be treated as underreporting, exposing the business to additional tax, penalties, and interest.
What is the basic COGS formula?
The basic COGS formula is beginning inventory plus purchases, minus ending inventory. This isolates the cost of what was actually sold during the period.
What costs belong in a COGS calculation?
Direct costs that can be traced to specific products or batches belong in COGS, such as raw materials, freight-in, duties and tariffs, direct labor, and production supplies. Indirect costs like rent, marketing, administrative salaries, and utilities should be excluded from COGS and treated as operating expenses.
How do FIFO, LIFO, and weighted average affect COGS?
FIFO assigns the oldest inventory costs to COGS first, LIFO charges the newest costs to COGS first, and weighted average blends all costs into a single per-unit cost. Once an inventory method is adopted, it must be applied consistently, changes generally require IRS approval through Form 3115, and businesses using LIFO for tax must also use LIFO in financial statements and reports.
Do service-based businesses report COGS?
Pure service businesses often report no COGS at all because they do not purchase inventory, hold stock, or transform raw materials into finished products, and payroll is typically classified as an operating expense. Hybrid or productized services may include direct materials, third-party subcontractor fees, pass-through expenses, and direct labor in COGS when those costs are directly tied to delivering a specific engagement.
What common accounting mistakes distort gross margin?
Common mistakes include miscounting ending inventory, mixing personal and business purchases, ignoring freight-in, and failing to adjust for returns. Each error is small on its own, but together they can shift reported margin by several percentage points.