Cost of Goods Sold (COGS): The Calculation Playbook
The number that decides your gross profit
Cost of goods sold is the cost of what you actually sold in the year. Revenue minus COGS is gross profit, the line every lender, buyer, and auditor reads first — it shows whether the core business makes money before rent, salaries, and marketing. Get COGS wrong and the tax return misstates income, and every margin, price, and break-even decision built on it is wrong too.
The formula fits on one line; the work sits in the three inputs: opening inventory, what you added during the year, and closing inventory. This playbook works the computation end to end — retailer, manufacturer, and service business — with the numbers shown and the two small-business exceptions most companies can use. Cost-flow methods live in our inventory valuation playbook; this guide takes unit cost as given and computes what was sold.
The core formula, mapped to the forms
Section 471(a) requires inventories when the production, purchase, or sale of merchandise is an income-producing factor. Publication 538 states it plainly: value inventory at the beginning and end of each tax year. The computation is the same on both federal forms that carry it:
Form 1125-A (Rev. November 2024) is the corporate and partnership form, Schedule C Part III the sole-proprietor version:
| Line | Form 1125-A | Schedule C Part III |
|---|---|---|
| Beginning inventory | Line 1 | Line 35 |
| Purchases | Line 2 | Line 36 |
| Cost of labor | Line 3 | Line 37 |
| Section 263A costs | Line 4 | — (in line 39) |
| Other costs | Line 5 | Lines 38–39 |
| Ending inventory | Line 7 | Line 41 |
| Cost of goods sold | Line 8 | Line 42 |
Two details matter. Purchases are reduced by items withdrawn for personal use — the owner taking goods off the shelf is not a sale and not COGS. Line 9a asks how closing inventory was valued, with boxes 9a(iv)–(vi) for the small-business alternatives, and line 9e asks whether section 263A applies. Answer it wrong and the return contradicts its own schedule.
Worked example — the retailer
A retail LLC, 2025: beginning inventory $120,000, purchases $480,000 net of discounts and after freight-in, ending inventory $145,000, revenue $800,000.
The $480,000 is not the sum of supplier invoices. Under Publication 538, cost means invoice price minus discounts plus transportation and other acquisition charges, and can include costs capitalized under section 263A. A 2 percent early-payment discount on $100,000 of invoices cuts purchases by $2,000. Freight-in is part of cost; freight-out is a selling expense. Check the margin through our profit calculator before locking the price list.
Manufacturing COGS: direct materials, direct labor, overhead
A manufacturer does not buy COGS off a shelf; it builds it. Direct materials, direct labor, and overhead sum to the cost of goods manufactured, and COGS then follows the same inventory equation for finished goods:
Worked example — a furniture maker: materials $210,000, labor $165,000, overhead $95,000 (including $18,000 section 263A costs), beginning finished goods $60,000, ending $85,000, revenue $760,000.
A 41.4 percent margin on $760,000 of revenue. Labor is where most audit adjustments start. Direct labor is the wages of people who touch the product — machine operators, assemblers, finishers. The plant manager, the quality inspector, and the maintenance crew are indirect labor: they sit in overhead. Owner pay is its own trap: Schedule C line 37 says, "Do not include any amounts paid to yourself" — a sole proprietor's own labor never enters COGS. An S-Corp owner-employee's salary is a real wage, subject to FICA: the production share is direct labor, the administrative share is not. A C-Corp follows the same split.
Founder & CEO Insight — Enow A. Jovial
Service-business COGS: when services have a cost of goods sold
A pure service business — consulting, legal advice, design billed by the hour — generally has no COGS: no inventory, no goods sold, no line 42 on its Schedule C. But two common service models do, and the test is always the same: is the cost directly tied to a specific sale or project?
| Business | COGS? | What goes in | Authority |
|---|---|---|---|
| Pure consulting or advisory | No | Nothing — operating expenses only | Schedule C Part III |
| Agency with subcontractors | Yes | Subcontractor costs for a client project | Schedule C lines 37–39 |
| Contractor / builder | Yes | Materials, subcontractors, site labor | Form 1125-A lines 2–5 |
Worked example — a design agency: $240,000 revenue, $96,000 subcontractor costs tied to client projects:
A 60.0 percent margin. The agency's own salaried designers stay in operating expenses; only outside specialists hired for a named project enter COGS. For a contractor, lumber, concrete, and the crew on site are COGS; the office and the estimator are not. Misclassifying operating costs as COGS does not change total profit — it changes gross profit, the number banks and buyers read.
Gross margin and markup: two numbers, one confusion
Margin and markup describe the same $345,000 of retailer gross profit, divided by two different bases: margin by revenue, markup by cost. Confusing them is the most expensive arithmetic error in small business — a 43.1 percent margin is a 75.8 percent markup:
A 50 percent markup on cost is a 33.3 percent margin on price; a 50 percent margin needs a 100 percent markup. When a supplier quotes a 40 percent margin and the buyer hears a 40 percent markup, the price comes out low and the deal loses money from the first unit. Write the base on every quote: "43.1% margin on revenue" or "75.8% markup on cost." A thinner margin means less cash per sale to fund the next order — the cash conversion cycle playbook starts from gross profit, not revenue.
Lower of cost or NRV, and lower of cost or market
Inventory is not always worth what it cost, and the two rulebooks diverged in 2015.
Under GAAP, FASB ASU 2015-11 requires inventory measured with FIFO or average cost to be carried at the lower of cost or net realizable value — estimated selling price in the ordinary course of business, less reasonably predictable costs of completion, disposal, and transportation:
Worked example — goods carried at $40,000: selling price $45,000, completion $3,000, disposal $2,000, transportation $1,000:
Cost exceeds NRV by $1,000, so the lot is written down and the loss hits earnings. Inventory measured with LIFO or the retail inventory method stays on the older lower of cost or market test — ASU 2015-11 left those two methods out.
For federal tax, the rule is still lower of cost or market under Regulation section 1.471-4, and Publication 538 works it item by item: R at cost $300 and market $500, S at $200 and $100, T at $450 and $200 — valued at $300, $100, and $200, for closing inventory of $600 against cost of $950 and market of $800. Value each item separately. Damaged, imperfect, or out-of-style goods are valued at bona fide selling price minus direct cost of disposition, never below scrap value.
Section 263A: UNICAP, the capitalization rule
Section 263A — the uniform capitalization rules, UNICAP — is why manufacturing COGS cannot be computed from the checkbook alone. It requires direct costs plus the property's proper share of indirect costs (including taxes) to be included in inventory costs for property produced by the taxpayer. For a reseller, it reaches additional acquisition costs: off-site storage, purchasing, handling, and mixed-service G&A.
Three limits keep it proportionate. First, interest is capitalized only in narrow cases: section 263A(f) reaches interest only for property with a long useful life — real property or a class life of 20 years or more — or for property whose production period exceeds one year and whose cost exceeds $1,000,000. Second, the statute lists its own exceptions: personal-use property, section 174 research, oil and gas, long-term contracts, timber, and farming under section 263A(d). Third, section 263A(i) switches the whole section off for a taxpayer meeting the section 448(c) gross receipts test. Form 1125-A line 9e asks outright whether section 263A applies. A "No" backed by a failed gross receipts test is defensible; a "No" backed by nothing is an audit finding.
The small-business exceptions: sections 471(c) and 263A(i)
Most businesses reading this guide will never run UNICAP — the Tax Cuts and Jobs Act of 2017 switched it off. Section 471(c) provides that, for a taxpayer meeting the section 448(c) gross receipts test, subsection (a) does not apply, and the inventory method does not fail to clearly reflect income if it treats inventory as non-incidental materials and supplies (NIMS), or conforms to its applicable financial statement or, without one, its books and records. Section 263A(i) gives the matching UNICAP exemption. Tax shelters are barred from both, whatever their size.
The test is a three-year average of gross receipts, re-run every year, against an inflation-adjusted threshold:
| Tax year beginning in | Section 448(c) threshold | Source |
|---|---|---|
| 2025 | $31,000,000 | Rev. Proc. 2024-40 |
| 2026 | $32,000,000 | Rev. Proc. 2025-32, section 4.30 |
Worked example — a wholesaler testing for 2026, with gross receipts of $28,000,000 in 2023, $30,000,000 in 2024, and $33,000,000 in 2025:
$30,333,333 is below the $32,000,000 threshold for 2026, so the wholesaler qualifies for 2026. Change the 2025 figure to $40,000,000 and the average becomes $32,666,667: the test fails, the section 471(c) election falls away, and the business returns to formal inventory accounting, including UNICAP, via a Form 3115 method change. Under NIMS, the business deducts inventory costs in the year items are first used or consumed — for a reseller, when goods are delivered — and labor and indirect costs are never capitalized.
The execution checklist
- Step 1 — Count the stock. Take a physical count at year-end, by SKU, and reconcile it to the books.
- Step 2 — Run the gross receipts test. Average the last three years of gross receipts against the filing-year threshold — $31 million for 2025, $32 million for 2026 — to decide whether sections 471(c) and 263A(i) apply.
- Step 3 — Pick the valuation method and write it down. Cost, lower of cost or market, or a small-business alternative (Form 1125-A line 9a) — it cannot change without a method-change request.
- Step 4 — Build the cost pools. Separate direct materials, direct labor, and overhead. Code payroll by function now, not at year-end.
- Step 5 — Apply section 263A or document why it does not apply. List additional costs on Form 1125-A line 4, or record the gross receipts test behind the exemption.
- Step 6 — Test the write-down. Compare each item's cost to NRV for the books and to market for tax; value damaged, obsolete, or slow stock at bona fide selling price minus direct cost of disposition.
- Step 7 — Reconcile and file. Tie beginning inventory to last year's closing inventory, COGS to the return (Form 1125-A line 8 or Schedule C line 42), and gross profit to the bank statement.
Who should not use this playbook
This guide is for businesses that sell goods or produce them. If you sell only your time and never touch a product, you have no COGS — your costs are operating expenses, and forcing them into Part III misstates gross profit without changing total profit. If you use LIFO, the cost-flow mechanics and the LIFO reserve live in our inventory valuation playbook — this guide takes unit cost as given. If your inventory sits in more than one country, transfer-pricing and customs-valuation rules sit on top of everything here; the automated bank reconciliation playbook keeps the multi-currency ledger honest. When in doubt, the CPA who signs the return decides the method — this playbook decides the arithmetic.

