How to Calculate Cost of Goods Sold for Tax Returns
To calculate cost of goods sold for a tax return, add your beginning inventory to net purchases and any direct production costs, then subtract your ending inventory. The formula looks like this: COGS = Beginning Inventory + Net Purchases + Direct Costs − Ending Inventory. The result is what you deduct from gross receipts to determine your gross profit, and it is the number the IRS expects to see supported by real inventory records, not estimates.
In my 20+ years leading Complete Controller, I have watched small-business owners accidentally overstate deductions by writing off every purchase instead of just the goods they actually sold—or worse, pull an ending inventory number out of thin air that doesn’t match their books. That one mistake can trigger an audit faster than almost anything else. In this guide, I will walk you through the exact formula, a step-by-step calculation, how inventory valuation shifts your numbers, what to report on your tax form, and the most common errors I see so you can file with confidence and keep more of what you earn.
What is cost of goods sold and how do you calculate it for a tax return?
- COGS = Beginning Inventory + Net Purchases + Direct Costs − Ending Inventory, deducted from gross receipts to determine gross profit.
- Beginning inventory should match the prior year’s ending inventory on your tax return.
- Net purchases include inventory bought for resale, adjusted for returns, discounts, and freight-in.
- Direct costs apply to manufacturers—qualifying labor, materials, and production overhead.
- Ending inventory is the cost (not retail value) of goods still on hand at year-end, verified by a physical count.
The IRS is clear that COGS is not a business expense—you subtract it from gross receipts to calculate gross profit, which is why your inventory records and year-end counts carry real tax weight.
The Cost of Goods Sold Formula (and Why It Matters)
The COGS formula measures what you actually sold—not what you bought. That distinction is where most tax errors begin.
For retailers and resellers:
COGS = Beginning Inventory + Net Purchases − Ending Inventory
For manufacturers:
COGS = Beginning Inventory + Net Purchases + Direct Labor + Manufacturing Costs − Ending Inventory
Cost of Sales vs. COGS
“Cost of sales” and “cost of goods sold” are often used interchangeably. Both refer to the direct cost of revenue-producing inventory. Service businesses sometimes use “cost of sales” for direct service-delivery costs even without physical inventory.
A quick worked example
Say your retail shop has beginning inventory of $20,000, purchases of $75,000, $3,000 in returns and discounts, $2,000 in freight-in, and ending inventory of $25,000.
- Net purchases: $75,000 − $3,000 + $2,000 = $74,000
- COGS: $20,000 + $74,000 − $25,000 = $69,000
- If sales were $110,000, gross profit = $41,000
How to Calculate COGS Step by Step
Step 1: Lock down beginning inventory
Beginning inventory should equal your prior year’s ending inventory. Pull it from last year’s tax return, balance sheet, and inventory subledger. If the numbers don’t match, stop and document why before you file. For a deeper refresher on tying records together, our team’s guide on the importance of reconciling your accounting statements regularly is a solid starting point.
Step 2: Add purchases and adjust
Include everything bought for resale or production. Then adjust:
- Add: merchandise, raw materials, freight-in, import duties, packaging
- Subtract: returns, allowances, trade discounts, rebates, and anything the owner took for personal use
Step 3: Identify direct materials and direct labor
Manufacturers add qualifying production costs—direct labor, raw materials, and overhead like factory rent, production equipment depreciation, and manufacturing supplies. Do not throw in administrative salaries, advertising, or sales commissions. Those are operating expenses, not COGS.
Step 4: Count and value ending inventory
Ending inventory is the cost of goods still on hand—not the retail price you plan to charge. Run a real physical count:
- Set a count date and assign staff.
- Freeze or separately log shipments during the count.
- Count finished goods, raw materials, and work in process.
- Record unit costs, damage, and obsolete stock.
- Reconcile the count to your inventory ledger.
- Save count sheets and write-off approvals.
Step 5: Apply the formula and reconcile
Plug the numbers in. Then connect COGS back to your income statement, gross profit back to sales, and your tax-return figures back to the general ledger. A sudden gross margin swing often reveals duplicate purchases, cutoff errors, or valuation problems.
COGS Giving You a Headache? Let Complete Controller simplify your small business bookkeeping, keep your inventory records accurate, and make tax season less stressful. Get expert bookkeeping support today!
How Inventory Valuation Changes Your COGS
The same physical inventory can produce different COGS numbers depending on the valuation method you use consistently.
FIFO and weighted average
FIFO (first in, first out) assigns the oldest costs to goods sold first. In rising-price environments, FIFO typically produces lower COGS and higher ending inventory.
Weighted average calculates one average unit cost:
Average Unit Cost = Total Cost of Goods Available ÷ Total Units Available
COGS then equals units sold × average unit cost. Switching methods mid-stream is a bad idea—review your prior filings, software settings, and financial statements before changing anything. Investopedia’s inventory valuation breakdown is a helpful reference if you want to compare approaches side by side.
What to Report on Your Tax Return
The form you use depends on your entity type.
Form 1125-A and COGS reporting
Corporations, partnerships, and certain other entities use Form 1125-A to calculate COGS. The form breaks COGS into the exact building blocks the IRS wants to see:
- Inventory at beginning of year
- Purchases
- Cost of labor
- Additional section 263A costs
- Other costs
- Inventory at end of year
Sole proprietors generally report COGS on their business schedule. Partnerships and S corps report through their entity return. Always confirm the current year’s form instructions before filing. Our overview of tax preparer roles and qualifications can help you decide when to bring in professional help.
Records to retain
Keep count sheets, purchase invoices, freight and customs records, vendor credits, sales reports, production payroll records, write-off approvals, general-ledger reconciliations, and prior-year returns. If the IRS asks, you want paper.
The Most Common COGS Errors (and How to Avoid Them)
The IRS has warned that taxpayers often overstate COGS by inflating purchases, understating ending inventory, or both—usually because they relied on estimates instead of an actual count. Here are the mistakes I see most often:
- Counting purchases as COGS. Unsold inventory stays in ending inventory. It is not deductible until it sells.
- Skipping freight-in and purchase adjustments. Inbound freight belongs in inventory cost; returns and discounts reduce net purchases.
- Valuing ending inventory at retail. Use cost-based valuation, not what you hope to charge customers.
- Forgetting personal withdrawals. Merchandise you take home must come out of purchases.
- Cutoff errors. Goods received before year-end belong in inventory even if the invoice arrives later.
- Copying management reports onto the tax return. Monthly estimates are not supportable year-end numbers.
For small-business bookkeeping fundamentals that prevent these errors, see our list of 9 bookkeeping tips for small businesses.
How Complete Controller Helps You Calculate COGS Accurately
An accurate COGS number is built month by month, not the night before filing. The businesses I see sail through tax season all share one habit: they treat inventory as a year-round discipline.
A practical month-end workflow
- Reconcile inventory purchases to accounts payable
- Match receiving records to vendor invoices
- Review returns, credits, discounts, and freight
- Investigate negative or unusual inventory balances
- Update unit costs and quantities
- Compare gross margin against prior months
- Maintain a running year-to-date COGS schedule
Year-end COGS checklist
Before handing anything to a tax preparer, confirm beginning inventory matches last year’s ending inventory, complete a physical count, remove personal withdrawals, record all purchase adjustments, separate direct production costs from operating expenses, and reconcile COGS to the general ledger.
Final Thoughts
Calculating cost of goods sold for your tax return comes down to five things: a correct beginning inventory, well-documented net purchases, properly classified direct costs, an accurate physical count for ending inventory, and a clean reconciliation to your books. Get those right and you lower audit risk, sharpen your pricing decisions, and keep gross profit honest.
Inventory is one of those areas where small, consistent habits pay off enormously at tax time. If your records, COGS schedule, or year-end reconciliation could use expert eyes, visit Complete Controller and let my team help you build a system that holds up to any scrutiny.
Frequently Asked Questions About Calculate Cost of Goods Sold
What is the formula to calculate cost of goods sold?
Beginning inventory + net purchases − ending inventory. Manufacturers also add eligible direct labor, materials, and production overhead before subtracting ending inventory.
Is COGS an expense or a deduction?
The IRS treats COGS as a reduction of gross receipts to arrive at gross profit—not a standard business expense. That is why strong inventory records matter so much for tax accuracy.
Does COGS include labor?
Direct production labor can be included for manufacturers and producers. Administrative, sales, and office labor should not be classified as COGS.
What happens if ending inventory is higher than beginning inventory?
Higher ending inventory generally lowers COGS when purchases stay constant, because more inventory remains unsold. Just make sure the number is supported by a physical count.
Can a service business claim COGS?
A pure service business typically does not have merchandise COGS. If it sells products or carries inventory alongside services, those items follow standard COGS rules.
Sources
- Internal Revenue Service. (2026). Cost of Goods Sold. IRS Topic No. 703. https://www.irs.gov/taxtopics/tc703
- Internal Revenue Service. (Sept. 3, 2013). Cost of Goods Sold and the Tax Gap. Erickson, Michael D. & Pashev, Irina D. https://www.irs.gov/pub/irs-soi/13rescongss.pdf
- Internal Revenue Service. (Dec. 2023). Form 1125-A: Cost of Goods Sold. https://www.irs.gov/pub/irs-pdf/f1125a.pdf
- Internal Revenue Service. (2026). Publication 334: Tax Guide for Small Business. https://www.irs.gov/publications/p334
- Intuit QuickBooks. (Sept. 23, 2020, updated 2026). Cost of Goods Sold Formula. https://quickbooks.intuit.com/global/resources/expenses/cost-of-goods-sold-formula/
- Investopedia. (2026). Inventory Valuation. https://www.investopedia.com/terms/i/inventory-valuation.asp
- Xero. (2026). Cost of Goods Sold: What It Is and How to Calculate It. https://www.xero.com/us/guides/cost-of-goods-sold/
- Complete Controller. (2026). Importance of Reconciling Your Accounting Statements Regularly. https://www.completecontroller.com/importance-of-reconciling-your-accounting-statements-regularly/
- Complete Controller. (2026). 9 Bookkeeping Tips for Small Businesses. https://www.completecontroller.com/9-bookkeeping-tips-for-small-businesses/
- Complete Controller. (2026). Tax Preparers Roles Qualifications. https://www.completecontroller.com/tax-preparers-roles-qualifications/
About Complete Controller® – America’s Bookkeeping Experts Complete Controller is the Nation’s Leader in virtual bookkeeping, providing service to businesses and households alike. Utilizing Complete Controller’s technology, clients gain access to a cloud platform where their QuickBooks™️ file, critical financial documents, and back-office tools are hosted in an efficient SSO environment. Complete Controller’s team of certified US-based accounting professionals provide bookkeeping, record storage, performance reporting, and controller services including training, cash-flow management, budgeting and forecasting, process and controls advisement, and bill-pay. With flat-rate service plans, Complete Controller is the most cost-effective expert accounting solution for business, family-office, trusts, and households of any size or complexity.
Reviewed By: