How to Calculate Gross Profit Using FIFO: Step-by-Step Guide with Examples

Kartika Musle
Kartika Musle
May 20, 2024
Updated on: May 23, 2026
12 Mins Read
How to Calculate Gross Profit Using FIFO

To calculate gross profit using FIFO, subtract the cost of goods sold (COGS) from your total revenue. In FIFO, COGS is calculated by using the cost of your oldest inventory first for each item sold.

This is simple when you’re dealing with a single batch of inventory. But most eCommerce sellers buy the same product multiple times at different prices. That’s where things get confusing, and where many store owners make mistakes.

Here’s the thing most guides skip: FIFO doesn’t just affect how you value inventory. It directly shapes your gross profit number, your tax bill, and how your business looks on paper. Get the method right, and your financials tell a true story. Get it wrong, and you’re either overpaying taxes or understating profit to investors.

This guide explains the FIFO gross profit formula. It includes a real example with multiple batches. You’ll also learn the difference between periodic and perpetual methods. It also covers common mistakes eCommerce sellers make.

What Is FIFO and Why Does It Matter for Gross Profit?

What is FIFO

FIFO stands for First In, First Out. It’s an inventory method where the oldest items are sold first. You don’t track the exact physical item leaving the warehouse. Instead, FIFO assumes which cost applies to each sale. FIFO is the most widely used inventory accounting method for good reason. It matches how most product-based businesses operate. It’s accepted under GAAP and IFRS. Under IFRS, it’s required because LIFO is not allowed.

Why does it matter for gross profit specifically? Because gross profit equals revenue minus COGS, and FIFO determines your COGS. Change the cost assigned to each unit sold, and you change the gross profit number. It’s that direct.

The FIFO Formula in Plain English

The gross profit calculation using FIFO has two parts:

  • Step 1. Calculate COGS: COGS = (Units from Oldest Batch x Cost per Unit) + (Units from Next Batch x Cost per Unit) + …
  • Step 2. Calculate Gross Profit: Gross Profit = Total Revenue – COGS

Simple when you have one batch. More involved when you have several. That’s why the worked example below matters.

How to Calculate Gross Profit Using FIFO: Step-by-Step

Step-by-step process for calculating gross profit using the FIFO inventory method

Here’s the full process, broken down so you can apply it to your own inventory. This is how you calculate gross profit using FIFO, no matter how many batches you have.

Step 1: List your inventory batches in chronological order

Start with the oldest purchase first. For each batch, record:

  • Date purchased
  • Number of units
  • Cost per unit

You need this layered view before you can assign costs correctly. If you skip this step and average the costs, you’re not using FIFO.
You’re using weighted average cost instead.

Step 2: Determine how many units were sold in the period

Pull your total units sold for the period (week, month, quarter). FIFO then assigns costs to sold units, starting with the oldest batch.

Step 3: Calculate COGS using FIFO

Start with your oldest batch. If the number of units sold is less than or equal to that batch size, multiply units sold by the cost per unit. That’s your COGS.

If units sold exceed the oldest batch, exhaust that batch first, then move to the next oldest. Add both amounts together. Keep moving forward through batches until you’ve accounted for all units sold.

Step 4: Calculate ending inventory value

Any units remaining unsold are valued at the most recent purchase prices. This gives you your ending inventory figure, which sits on the balance sheet as a current asset.

Step 5: Calculate gross profit

Gross Profit = Total Revenue – COGS (calculated in Step 3). That’s your gross profit using FIFO.

A Real FIFO Gross Profit Example (Multi-Batch Inventory)

Let’s say you run an eCommerce store selling skincare serums. In the past two months, you bought stock twice at different prices.
Your supplier increased the price between orders.

Here’s your inventory position:

BatchUnits PurchasedCost Per Unit
Batch 1 (February)200 units$8.00
Batch 2 (March)150 units$10.00
Total350 units

During March, you sold 260 units at $25.00 each.

Step 1: Calculate Total Revenue

260 units x $25.00 = $6,500

Step 2: Calculate COGS Using FIFO

Start with the oldest batch (February, $8.00/unit):

  • 200 units x $8.00 = $1,600

You’ve exhausted Batch 1. You still need to account for 60 more units sold (260 – 200). Move to Batch 2 (March, $10.00/unit):

  • 60 units x $10.00 = $600

Total COGS = $1,600 + $600 = $2,200

Step 3: Calculate Gross Profit

Gross Profit = $6,500 – $2,200 = $4,300

Step 4: Ending Inventory Value

You have 90 units left (150 – 60) from Batch 2, valued at the most recent price: 90 units x $10.00 = $900 on the balance sheet

Your gross profit margin for the period: $4,300 / $6,500 = 66.2%

That’s the full picture. Revenue, COGS, gross profit, and ending inventory, all from one FIFO calculation.

Worth Knowing: If supplier costs are rising (as they have been across many product categories since 2021), that $900 ending inventory will be replaced with stock that costs more than $10 per unit. Your next period’s FIFO calculation will reflect those higher costs in COGS. More on that in the FIFO and inflation section below.

FIFO Gross Profit in a Periodic vs. Perpetual Inventory System

This is the part most guides skip entirely. And it actually matters for how you track gross profit throughout the year.

Periodic inventory system: You calculate COGS and update inventory values at set intervals, monthly, quarterly, or annually. You run a physical count, then apply FIFO to the period’s total sales in one calculation at the end. Simpler to operate, but it means your gross profit figures are estimates until the count happens.

Perpetual inventory system: Every sale updates COGS in real time. Perpetual inventory systems update COGS with each transaction as it occurs; it assigns the oldest available cost to the sale as it happens. This gives you an accurate gross profit at any point in time.

Here’s why this matters for eCommerce: Most WooCommerce and modern platforms use a perpetual system by default. Sales data updates with every order. If you manage inventory in a spreadsheet and apply FIFO at month-end, you’re using a periodic approach. That means your gross profit numbers won’t be accurate during the period until you run that calculation.

For most online sellers with more than a few hundred transactions a month, a perpetual system is worth it. You can price better, reorder with confidence, and see up-to-date gross profit numbers.

One Important Note: Under FIFO, periodic and perpetual systems give the same COGS and gross profit for a period, as long as no new inventory is added during that time. They start to differ when you receive new stock while also making sales. Under LIFO, this difference is even larger. For FIFO, the real difference is timing. It affects when you see your gross profit, not the final number.

FIFO vs. LIFO: How Your Choice Affects Gross Profit

FIFO vs. LIFO

Using the same skincare serum example from above, here’s how the gross profit changes under LIFO versus FIFO:

FIFOLIFO
Units Sold260260
COGS$2,200$2,400*
Revenue$6,500$6,500
Gross Profit$4,300$4,100
Gross Margin66.2%63.1%
Ending Inventory Value$900$700*

*LIFO uses the most recent costs first: 150 units x $10.00 = $1,500, then 110 units x $8.00 = $880. Total COGS = $2,380 (rounded to $2,400 for illustration). Ending inventory reflects older, cheaper stock.

The difference here is $200 in gross profit, not enormous for one period, but it compounds over a full year and it affects your taxable income directly. FIFO results in higher profit margins when costs are rising, while LIFO produces lower margins but can reduce tax liability.

Here is the guide by which you can learn in detail about how to calculate gross profit using the LIFO method.

What Happens to Gross Profit During Inflation?

This is where FIFO creates a specific trap for eCommerce sellers.

When your supplier prices are rising, FIFO assigns your cheapest (oldest) costs to COGS. That lowers COGS, which pushes gross profit higher. On paper, your business looks more profitable. But here’s the problem: when you go to reorder that inventory, you’ll pay the new, higher price. The profit you recorded doesn’t account for the true cost of staying in stock.

Economists refer to this as “phantom profit,” a term used in accounting for decades. The gross profit looks healthy, but part of it disappears when you restock. The median gross profit for eCommerce brands ranges from 52% to 55% for 7- to 8-figure businesses. Rising COGS from tariffs and supply chain changes are putting pressure on that number. This is especially true for sellers using FIFO without tracking replacement costs.

The fix is simple: Track your actual reorder cost alongside your FIFO gross profit. If your FIFO gross profit is 66% but your replacement cost of inventory has risen 15%, your real sustainable margin is closer to 51%. That gap matters when you’re making decisions about pricing or ad spend.

Which Method Is Right for Your eCommerce Store?

FIFO is almost always the better default for eCommerce businesses for three reasons. First, it’s accepted under IFRS, which matters if you sell internationally or plan to raise investment outside the US. Second, it reflects how products actually move; older stock usually sells first. Third, it provides a cleaner balance sheet, as ending inventory is valued at current costs.

LIFO can make sense if your costs are rising, you operate only in the US, and you want to reduce taxable income. But it makes your inventory look undervalued on the balance sheet. This can hurt when you’re seeking financing or planning an exit. Switching inventory methods takes planning and may require IRS approval. It’s not a decision to take lightly.

If you’re in the early stages of thinking through how to value an eCommerce business, your choice of inventory method will directly affect the financial picture you present to buyers or investors. Getting it right from the start saves a lot of headaches later.

Common Mistakes eCommerce Sellers Make When Using FIFO

Common mistakes when calculating gross profit using FIFO for eCommerce inventory

Most of these aren’t calculation errors. They’re structural mistakes that make the calculation meaningless.

  • Mixing batches without dates: FIFO only works if you know when each batch arrived. If you receive two shipments in the same month and log them as one lump entry, you can’t apply FIFO correctly. Every purchase needs its own dated entry with the cost per unit.
  • Recalculating mid-period without a system: Recalculating mid-period without a system: Record new inventory as a separate batch, or your FIFO layers will get mixed up. The oldest costs get mis-assigned, and your gross profit figure is off for that period.
  • Confusing gross profit with net profit: FIFO affects gross profit, revenue minus COGS. It doesn’t account for operating expenses, shipping, platform fees, advertising, or returns. A 66% FIFO gross margin sounds strong until you subtract everything else. Track both numbers separately.
  • Ignoring the tax impact of high FIFO profit: A higher FIFO profit means higher taxes when costs are rising. If your supplier costs have risen a lot in the past 12 months, talk to your accountant about whether FIFO is still the right call, or at least factor replacement cost into your pricing decisions.

Using the right WooCommerce plugins for managing your online store can automate inventory tracking and reduce errors that break FIFO. Spreadsheets may work at low volume, but they become risky as order volume grows.

Conclusion

Calculating gross profit using FIFO comes down to three steps: Track inventory by date and cost, use the oldest costs first to calculate COGS, and subtract COGS from revenue.

The formula is simple. The real work is keeping your inventory records clean so you can apply them correctly.

FIFO usually shows a higher gross profit than LIFO when costs are rising. That looks good, but it can overstate your true margin if replacement costs have increased. If you’re using a perpetual inventory system, your gross profit updates with every sale. This gives you real-time visibility instead of a month-end estimate.

If you’re working to understand your eCommerce profitability metrics, look beyond gross profit. Use FIFO as a base, but build a full view of how your business performs financially.

Frequently Asked Questions

Q1. What is the gross profit formula when using FIFO?

Gross profit = Total revenue − COGS. Under FIFO, COGS is calculated using the cost of your oldest inventory first. You then move through each purchase batch until all sold units are covered.

Q2. Does FIFO always produce a higher gross profit than LIFO?

FIFO uses your oldest (usually cheaper) inventory costs for COGS. This leads to lower COGS and higher gross profit than LIFO. When prices fall, the opposite happens. FIFO then gives lower gross profit than LIFO. When prices are stable, the difference is minimal.

Q3. Can I switch from FIFO to another inventory method if my margins are being affected?

Yes, but it requires care. In the US, switching inventory costing methods is considered an accounting change and may require IRS approval, depending on the method you’re moving to. Consult your accountant before changing methods, especially mid-year. Outside the US, LIFO is not permitted under IFRS, so FIFO or weighted average cost is the practical option.

Q4. How does FIFO affect ending inventory on the balance sheet?

Under FIFO, ending inventory is valued at your most recent purchase prices. These are the costs left after older batches are used for COGS. During inflation, this means your inventory is closer to the current market value. This is one of FIFO’s key advantages over LIFO. Under LIFO, ending inventory can be valued at older, lower costs.

Q5. Is FIFO gross profit the same in a periodic and perpetual inventory system?

For the same period with the same purchase and sales data, FIFO will produce the same COGS and gross profit under both systems. The difference is timing: a perpetual system gives you an updated gross profit figure after every sale, while a periodic system only gives you an accurate gross profit after a physical count and end-of-period calculation. For high-volume eCommerce stores, the perpetual approach gives far more actionable data.

Q6. What is “phantom profit” in the context of FIFO?

Phantom profit is the part of FIFO gross profit that looks real on paper but won’t last when you restock. If your older inventory costs $8 per unit but replacement now costs $12, your FIFO profit looks higher than it really is. That extra $4 per unit will go into your next purchase, making the profit temporary. This is a real issue for eCommerce sellers in categories where supplier prices have risen quickly.

Kartika Musle

Kartika Musle

Kartika Musle is a tech writer at DevDiggers covering WooCommerce features, web design, and development security. Her articles translate technically dense subjects into guides that a non-developer can follow without losing the detail that matters, drawing on a background that touches both design and development.

Join our Affiliate Program

Earn upto 30% commissions on successful referrals.

Stay Updated

Join thousands of readers getting smarter every week.

Newsletter Form

Leave a Reply

Your email address will not be published. Required fields are marked *