Cost of sales is the total direct expense a business incurs to produce or deliver what it sold during an accounting period. It sits near the top of the income statement, gets subtracted from revenue to produce gross profit, and drives what a business owes in tax. For product businesses it usually equals cost of goods sold (COGS); for service firms it captures the direct labor and project costs behind the work billed to clients. The IRS uses “cost of goods sold” on its forms, but the underlying question is the same: how much did it cost to deliver the thing you got paid for?
What Counts as a Direct Cost
A cost belongs in this category when it can be tied to producing a specific unit of product or delivering a specific piece of work. Four buckets cover most of what businesses record.
Materials and Purchased Goods
For a manufacturer, this is raw materials. For a retailer, it is the wholesale price of merchandise bought for resale. Freight charges to move materials into your facility, often called freight-in, belong here too, because the true cost of inventory includes everything you spent getting it warehouse-ready.
Direct Labor
Direct labor is the wages of employees who physically build the product or perform the service sold. A factory assembler counts. An accountant at a tax preparation firm whose billable hours generate revenue counts. The CEO’s salary does not. The employer’s share of payroll taxes on these workers travels with the wages into cost of sales.
Production Overhead
Some production costs cannot be traced to a single unit or employee: electricity powering factory equipment, machine maintenance, supplies consumed on the line, depreciation on manufacturing equipment. Accounting rules require these costs to be folded into inventory value until the product actually sells, at which point they become part of cost of sales.
The Software and Services Equivalent
A SaaS company has no steel or fabric, but it still has direct costs. Cloud hosting fees typically run 6% to 12% of revenue and function as the digital equivalent of raw materials. Customer support teams keeping the service running, third-party API fees, payment processing, and data center costs all fall inside cost of sales. Development work on new features does not; that spending is treated as research and development and follows its own tax rules.
What Does Not Belong in Cost of Sales
If a cost would exist even when nothing shipped and no client was served, it probably belongs elsewhere. The tax code separates production costs from the general “ordinary and necessary” business expenses deductible under Section 162.1Office of the Law Revision Counsel. 26 USC 162 – Trade or Business Expenses The regulation reinforces the split by treating the cost of goods purchased for resale as a subtraction from gross sales when computing gross income, not as a general business expense.2eCFR. 26 CFR 1.162-1 – Business Expenses
Common exclusions:
- Office and administrative costs: corporate rent, executive salaries, HR staff, office utilities.
- Marketing and advertising: a campaign promotes the brand; it does not create the product.
- Research and development: since 2022, R&D spending can no longer be deducted immediately. Domestic research must be amortized over five years and foreign research over 15 years, with software development following the same rule.3Internal Revenue Service. Notice 2023-63 – Guidance on Amortization of Specified Research or Experimental Expenditures Under Section 174
- Interest and financing costs: the price of borrowing is a financial expense, not a production cost.
Keeping these figures out lets you see whether the production side of the business generates enough margin to carry everything else. If cost of sales already eats 90% of revenue, no amount of administrative trimming will fix the model.
The Formula
For a business that holds inventory:
Cost of Sales = Beginning Inventory + Purchases − Ending Inventory
Beginning inventory is the dollar value of goods on hand at the start of the period, which equals the prior period’s ending inventory on the balance sheet. Purchases include raw materials, finished goods bought for resale, and direct production costs incurred during the period. Ending inventory is whatever remains unsold at the close. Subtracting it isolates the cost of only what actually went out the door.
Physical counts matter. The IRS allows shrinkage estimates during the year if a business regularly conducts physical counts and adjusts its records when actual numbers arrive.4Office of the Law Revision Counsel. 26 USC 471 – General Rule for Inventories
Shrinkage and Spoilage
Inventory does not always leave through a sale. Theft, damage in transit, spoilage of perishables, and counting errors all reduce what is on the shelves. When a physical count shows fewer items than the records do, the gap is shrinkage. The adjustment reduces the inventory asset on the balance sheet and records an expense that flows into cost of sales. Ignoring shrinkage overstates ending inventory, understates cost of sales, and inflates reported profit, which is the kind of error that draws IRS attention.
Service Businesses
Service firms skip the inventory math. Instead, they sum the direct costs incurred on client work during the period: labor for billable staff, subcontractor fees, project-specific software, and similar items. The output is the same metric, calculated by tracking project costs rather than counting units.
Inventory Valuation Methods Change the Number
The formula relies on one critical assumption: when a unit leaves inventory, what did it cost? The method you pick directly changes reported cost of sales, gross profit, and taxable income.
FIFO (First-In, First-Out)
FIFO assumes the oldest inventory sells first. In a period of rising prices, the cheaper early purchases flow into cost of sales and the more expensive recent purchases stay in ending inventory. Reported cost of sales is lower, gross profit is higher, and the tax bill rises. FIFO tends to leave a balance sheet inventory figure that reflects current market prices.
LIFO (Last-In, First-Out)
LIFO reverses the assumption. The most recent purchases are treated as sold first. In rising-price periods this pushes higher costs into cost of sales, lowering profit and current taxes. Businesses electing LIFO for the first time must file IRS Form 970 with the return for the year the method takes effect. One limitation: international accounting standards under IAS 2 do not permit LIFO, so companies reporting under IFRS cannot use it.5IFRS Foundation. IAS 2 Inventories
Weighted Average Cost
Weighted average blends everything together. Total cost of goods available for sale divided by total units gives a single per-unit cost applied across the board. Results land between FIFO and LIFO, and the method is the easiest to maintain when a business handles large volumes of similar items.
Whichever method you use, apply it consistently period to period. Switching is possible but must be justified as preferable and triggers formal change-in-accounting-principle procedures. The IRS also requires that the method used for tax reporting match the method used in your financial statements.
How to Report Cost of Sales on Your Taxes
The IRS requires businesses that produce, purchase, or sell merchandise to account for inventories and report cost of goods sold on their tax returns.4Office of the Law Revision Counsel. 26 USC 471 – General Rule for Inventories Sole proprietors report it in Part III of Schedule C (Form 1040), listing beginning inventory, purchases, labor, and other costs, then subtracting ending inventory.6Internal Revenue Service. Instructions for Schedule C (Form 1040) Corporations and partnerships use Form 1125-A, which attaches to Form 1120 or Form 1065 and follows the same structure.7Internal Revenue Service. Form 1125-A – Cost of Goods Sold
Uniform Capitalization (UNICAP)
Section 263A requires certain businesses to capitalize direct costs and a share of indirect costs into inventory rather than deducting them immediately.8Office of the Law Revision Counsel. 26 USC 263A – Capitalization and Inclusion in Inventory Costs of Certain Expenses It reaches businesses that produce real or tangible personal property or acquire property for resale. In practice, costs such as factory insurance, warehousing, and purchasing department salaries get folded into inventory value and stay off the income statement until the inventory sells.
Small businesses are exempt. If your average annual gross receipts over the prior three years fall at or below the Section 448(c) threshold, set at $25 million and adjusted annually for inflation, UNICAP does not apply.9Federal Register. Small Business Taxpayer Exceptions Under Sections 263A, 448, 460 and 471 The same gross receipts test also exempts small businesses from the general inventory rules under Section 471, letting them treat inventory as non-incidental materials and supplies or follow their financial statement method.4Office of the Law Revision Counsel. 26 USC 471 – General Rule for Inventories
Penalties for Getting It Wrong
Errors in cost of sales flow straight through to taxable income. Overstating cost of sales underpays tax; understating it overpays. Where the IRS finds a substantial understatement, the standard accuracy-related penalty is 20% of the underpayment.10Office of the Law Revision Counsel. 26 USC 6662 – Imposition of Accuracy-Related Penalty on Underpayments For gross valuation misstatements, such as dramatically inflating inventory values, the penalty doubles to 40%. These stack on top of the tax owed plus interest.
Why Cost of Sales Drives Gross Profit
Revenue minus cost of sales equals gross profit. That figure is the money left to pay rent, marketing, executive salaries, debt service, and eventually the owner. Gross margin, gross profit divided by revenue, is what investors and lenders track over time to see whether a business is holding its pricing power or getting squeezed. A declining gross margin across several quarters usually signals rising input costs, discounting pressure, or production inefficiency. Cutting overhead can offset the drop temporarily, but if the core production economics stop working, no amount of administrative trimming will save the business. That is why the cost of sales figure is worth calculating carefully: every financial decision downstream depends on it.