How to Calculate Gross Profit Using FIFO: Layers, COGS, and Pitfalls

To calculate gross profit using the FIFO method, assign the cost of your oldest inventory to the units you sold first, total those layer costs to get cost of goods sold, then subtract that figure from your sales revenue. The math is subtraction. The work is in the layering: FIFO (First-In, First-Out) treats the earliest units purchased as the first ones sold, regardless of which physical units actually left the warehouse.

What You Need Before You Start

Four inputs drive the whole calculation:

  • Total sales revenue for the period, from your general ledger or accounting software.
  • Beginning inventory: the units on hand at the start of the period and the per-unit cost for each.
  • Every purchase made during the period, in date order, with quantity and per-unit price for each batch.
  • The number of units actually sold during the period.

Purchase invoices, receiving reports, and vendor contracts are the raw documents behind those numbers. Most accounting software tracks inventory batches automatically, but spot-checking the digital records against physical invoices catches data-entry errors before they reach your financial statements. The per-unit cost on each invoice should include the item price plus normal inbound freight and handling. Abnormal shipping costs, such as rerouting inventory after a natural disaster, get expensed in the current period rather than folded into inventory cost.

One consistency rule matters up front. Once you adopt FIFO, the IRS requires you to keep using it unless you formally request a change by filing Form 3115.1Internal Revenue Service. Publication 538 (01/2022), Accounting Periods and Methods

How FIFO Layers Work

Picture your inventory as a stack of purchase batches arranged by date. The batch you bought first sits at the bottom of the stack. When you sell units, FIFO pulls from the bottom first, and only after that batch is exhausted does it move to the next one up.

Say you start the quarter with 100 units purchased at $10 each. During the quarter you buy two more batches: 200 units at $12, then 150 units at $14. Your inventory has three layers:

  • Layer 1: 100 units at $10
  • Layer 2: 200 units at $12
  • Layer 3: 150 units at $14

The layers are cost assignments, not physical bins. Even if you ship a unit from the newest shipment, FIFO still assigns the oldest cost to that sale for accounting purposes.

Working Out Cost of Goods Sold

Using the inventory above, suppose you sell 250 units during the quarter. FIFO pulls the costs in order:

  • From Layer 1: 100 units × $10 = $1,000
  • From Layer 2: 150 units × $12 = $1,800

Layer 1 is fully used up. Layer 2 has 50 units left. Total cost of goods sold: $2,800. That figure represents the historical cost of the specific inventory FIFO considers sold.

The remaining inventory on your balance sheet is the 50 leftover units from Layer 2 at $12 ($600) plus all 150 units in Layer 3 at $14 ($2,100), totaling $2,700. Because FIFO leaves the newest, most expensive purchases in ending inventory, the balance sheet tends to reflect something close to current replacement cost. That is one reason FIFO is popular under Generally Accepted Accounting Principles.

Subtracting to Get Gross Profit

Once you have cost of goods sold, the rest is arithmetic:

Gross Profit = Total Sales Revenue − Cost of Goods Sold

If those 250 units sold for $20 each, revenue is $5,000. Subtract the $2,800 in COGS and gross profit is $2,200. That $2,200 is what remains to cover rent, salaries, marketing, interest, taxes, and everything else that is not a direct production cost.

You can also express the result as a margin: gross profit divided by revenue, times 100. In this example, $2,200 ÷ $5,000 × 100 = 44%. A margin that declines over several quarters signals that input costs are rising faster than prices, or that the product mix is shifting toward lower-margin items.

What Belongs in Each Layer’s Per-Unit Cost

The accuracy of the whole calculation depends on what you fold into each layer’s per-unit cost. Direct costs are straightforward: purchase price of raw materials, labor to produce finished goods, and normal inbound shipping.

Under the Uniform Capitalization rules in Section 263A of the tax code, businesses with average annual gross receipts above $32 million must also include certain indirect costs in inventory.2Office of the Law Revision Counsel. 26 U.S. Code 263A – Capitalization and Inclusion in Inventory Costs of Certain Expenses Those indirect costs include utilities for production facilities, officers’ compensation allocable to production, warehouse costs, and administrative expenses like cost accounting and payroll functions tied to manufacturing.3eCFR. 26 CFR 1.263A-1 – Uniform Capitalization of Costs

Ignoring Section 263A when it applies understates inventory cost and overstates gross profit, and the IRS is equipped to catch the discrepancy.

How Inflation Skews FIFO Gross Profit

FIFO has a well-known weakness in periods of rising prices. Because it assigns the oldest, cheapest costs to units sold, COGS stays artificially low while revenue reflects today’s prices. Gross profit looks strong, but it overstates how much cash is actually available to reinvest.

Accountants call this “phantom profit.” The income statement shows a healthy margin, but replacing the inventory you just sold costs more than what FIFO charged against revenue, so you end up paying tax on profit you need to spend on restocking. A CPA Journal analysis found that with a 10% cost increase and a 30% tax rate, FIFO produced a tax bill roughly 45% higher than the same scenario under LIFO.4The CPA Journal. LIFO or FIFO During Inflationary Times

In deflationary periods the effect reverses: FIFO charges higher old costs against revenue, producing lower gross profit and a smaller tax bill. The method does not change; the economic environment decides whether it works for or against you.

When You Can Skip FIFO Layering Entirely

Not every business has to do this. If average annual gross receipts over the prior three tax years are $32 million or less (the threshold for tax years beginning in 2026), you qualify for a small business exemption from both the general inventory accounting rules under Section 471 and the Uniform Capitalization rules under Section 263A.5Internal Revenue Service. Revenue Procedure 2025-326Office of the Law Revision Counsel. 26 U.S. Code 471 – General Rule for Inventories

Under the exemption, you can treat inventory as non-incidental materials and supplies, deducting the cost when you use or sell the items instead of maintaining FIFO layers. You can also conform your tax inventory method to whatever method you use on your financial statements.6Office of the Law Revision Counsel. 26 U.S. Code 471 – General Rule for Inventories Tax shelters are excluded from the exemption regardless of gross receipts.

Even businesses that qualify often stay with FIFO voluntarily because lenders and investors expect GAAP-compliant statements with proper inventory valuation. The exemption simplifies the tax return, not necessarily the financial reporting.

If the Numbers Are Wrong

Errors in a FIFO gross profit calculation flow straight into taxable income. Understating COGS overstates gross profit and overpays tax. Overstating COGS underreports income, which can trigger accuracy-related penalties of 20% of the underpayment under IRC Section 6662, or 40% for gross valuation misstatements.7Office of the Law Revision Counsel. 26 U.S. Code 6662 – Imposition of Accuracy-Related Penalty on Underpayments

Corporations that underpay estimated taxes because of a bad income figure also face an addition to tax under IRC Section 6655, calculated by applying the IRS underpayment rate to the shortfall for the period it stays unpaid.8Office of the Law Revision Counsel. 26 U.S. Code 6655 – Failure by Corporation to Pay Estimated Income Tax For the first quarter of 2026, that rate is 7% for most corporations and 9% for large corporate underpayments.9Internal Revenue Service. Revenue Ruling 2025-22, Section 6621 Determination of Rate of Interest

Keep inventory records, purchase invoices, and related tax documents at least three years after filing the return they support. The retention period extends to six years if you have omitted more than 25% of gross income and seven years for certain loss deductions.10Internal Revenue Service. How Long Should I Keep Records? Holding inventory records for at least seven years is the safer practice, because FIFO layer costs from earlier years feed into later periods’ COGS and may need to be substantiated long after the original purchase.