How to Find COGS: Formula, Section 263A, and Tax Reporting

To find cost of goods sold, take your beginning inventory, add what you spent on purchases and production during the year, and subtract the inventory still on hand at year-end. That difference is what you sold. The formula is the same whether you run a bakery, a machine shop, or an online store, and it drives both the gross profit on your income statement and the taxable income you report to the IRS.

The Formula With Real Numbers

Beginning Inventory + Purchases and Production Costs − Ending Inventory = Cost of Goods Sold.

Say a retailer opens the year with $50,000 of inventory, buys another $100,000 of merchandise during the year, and counts $30,000 still on the shelves on the last day of the tax year:

  • Beginning inventory: $50,000
  • Plus purchases: $100,000
  • Goods available for sale: $150,000
  • Minus ending inventory: $30,000
  • Cost of goods sold: $120,000

Beginning inventory is the dollar value of goods on hand the first day of your tax year, and for most businesses it matches last year’s ending inventory exactly. A manufacturer follows the same structure but adds direct labor and factory overhead alongside raw material purchases in the middle term.

What Goes Into Purchases and Production Costs

The middle term is where most mistakes happen, because businesses either leave out costs that belong or fold in expenses that don’t. IRS Publication 538 groups the costs that belong into direct materials, direct labor, and certain indirect production costs.1Internal Revenue Service. IRS Publication 538

Direct materials are the raw inputs that become part of the finished product: lumber for a furniture maker, flour for a bakery. The cost is the invoice price minus trade discounts, plus freight and other charges to get the materials to your facility.2eCFR. 26 CFR Part 1 – Inventories

Direct labor is what you pay the workers who physically produce the goods. It goes beyond the hourly rate. Payroll taxes, vacation and holiday pay, sick leave, and shift differentials for production employees all belong in inventory as direct labor.3GovInfo. 26 CFR 1.471-11 – Inventories of Manufacturers

Factory overhead covers production-related costs like utilities for the manufacturing floor, depreciation on production equipment, and containers or packaging that become part of the finished product.

What does not belong in COGS: office rent, marketing, executive salaries, and other expenses that don’t move with the number of units you produce. Rolling those in inflates the deduction and creates a problem if the IRS looks closely.

Valuing the Ending Inventory

The ending inventory figure is the other place errors cluster, and the number you use depends on which valuation method you’re on. The IRS cares about consistency from year to year more than which method you pick, as long as it reasonably reflects income.2eCFR. 26 CFR Part 1 – Inventories

  • First-In, First-Out (FIFO): Assumes the oldest inventory sells first. When prices are rising, FIFO produces lower COGS and higher taxable income, because you’re matching older, cheaper costs against current revenue.
  • Last-In, First-Out (LIFO): Assumes the newest inventory sells first, generally producing higher COGS and lower taxable income when prices rise. If you use LIFO on your tax return, you must also use it in the financial statements you give shareholders and creditors.4Internal Revenue Service. IRS Practice Unit – LIFO Conformity
  • Average cost: Divides the total cost of goods available for sale by the number of units available, producing a single weighted average per unit.
  • Lower of cost or market: Values each item at whichever is less, your actual cost or the current market replacement cost. Damaged, obsolete, or unsaleable goods get valued at the realistic selling price minus the cost of selling them.5eCFR. 26 CFR 1.471-2 – Valuation of Inventories

A physical count at year-end is the reliable way to get the ending number. The IRS does allow shrinkage estimates between counts, as long as you count on a regular and consistent schedule and adjust the estimates when a physical count shows a discrepancy.6Office of the Law Revision Counsel. 26 U.S. Code 471 – General Rule for Inventories

The Section 263A Layer for Larger Businesses

Businesses that produce property or buy goods for resale can face an extra layer of costs that must be capitalized into inventory rather than deducted right away. Under the uniform capitalization rules of Section 263A, indirect costs such as purchasing department expenses, warehouse and storage costs, and handling costs like assembling, repackaging, and transporting goods get folded into inventory value.7eCFR. 26 CFR 1.263A-1 – Uniform Capitalization of Costs The practical effect is that these costs come out of income only when the related inventory is sold, not when you incur the expense.

Section 263A does not apply if your average annual gross receipts over the prior three tax years are $31 million or less (for tax years beginning in 2025, adjusted annually for inflation) and you are not a tax shelter.8Internal Revenue Service. IRS Publication 551 – Basis of Assets The IRS updates the threshold each year through a revenue procedure, so check the current figure at filing time.9Internal Revenue Service. Revenue Procedure 2024-40

The Small Business Off-Ramp

If you meet that same $31 million average-receipts test and are not a tax shelter, you qualify as a small business taxpayer and can skip traditional inventory accounting altogether.10Internal Revenue Service. IRS Publication 334 – Tax Guide for Small Business You can treat inventory as non-incidental materials and supplies and deduct items in the year you use or consume them, rather than running them through beginning and ending inventory. Valuation is limited to specific identification, FIFO, or average cost. LIFO is not available under this option.2eCFR. 26 CFR Part 1 – Inventories Choosing this route also lifts the Section 263A capitalization requirement.

Where the Number Goes on Your Tax Return

The form depends on how your business is organized.

Sole Proprietors: Schedule C, Part III

If you file Schedule C with your personal return, Part III walks the calculation line by line: beginning inventory, purchases (less anything withdrawn for personal use), cost of labor, materials and supplies, and other costs, minus ending inventory. The result flows to Line 4 of Schedule C and reduces your gross income. Part III also asks which valuation method you used for closing inventory so the IRS can check consistency against prior years.

Corporations and Partnerships: Form 1125-A

Corporations filing Form 1120 and partnerships filing Form 1065 report COGS on Form 1125-A.11Internal Revenue Service. About Form 1125-A, Cost of Goods Sold The form collects the same core data (beginning inventory on Line 1, purchases on Line 2, labor on Line 3) and adds a dedicated line for Section 263A costs on Line 4 and other costs on Line 5. Lines 6 through 8 total everything up and subtract ending inventory to reach the final figure.12Internal Revenue Service. Form 1125-A, Cost of Goods Sold The bottom of the form asks whether you used LIFO (and the LIFO reserve amount), whether Section 263A applies, and whether you changed any inventory methods during the year.

Service Businesses and Mixed Operations

You track inventory and calculate COGS when the production, purchase, or sale of merchandise is an income-producing factor in your business.2eCFR. 26 CFR Part 1 – Inventories A pure service business, such as a law firm or consulting practice, typically has no COGS.

The line blurs when a service business also sells physical goods. A landscaper installing plants, a tattoo artist using ink and needles, or an auto mechanic selling parts alongside labor all have a merchandise component and should track COGS for those items. The labor that goes into installing them is generally an operating expense for a service provider, not part of COGS.

What Happens If You Get It Wrong

Misreporting COGS by inflating purchases, undervaluing ending inventory, or slipping in expenses that don’t belong understates your taxable income. The IRS can impose an accuracy-related penalty of 20% of the underpaid tax when the shortfall results from negligence or disregard of tax rules.13Office of the Law Revision Counsel. 26 U.S. Code 6662 – Imposition of Accuracy-Related Penalty on Underpayments Negligence includes any failure to make a reasonable attempt to comply, so sloppy records alone can be enough.

An audit that finds inventory problems rarely stops at one issue. Examiners tend to look next at whether your valuation method has been consistent, whether Section 263A was properly applied, and whether any method changes were authorized. Keep detailed purchase records, do physical counts on a regular schedule, and apply the same valuation method every year.