Omni Calculator logo

LIFO Calculator for Inventory

Created by Arturo Barrantes
Reviewed by Anna Szczepanek, PhD and Steven Wooding
Based on research by
Mahmut Parlar, David Perry & Wolfgang Stadje FIFO Versus LIFO Issuing Policies for Stochastic Perishable Inventory Systems; Springer Link; 07 January 2010
Last updated: Jan 18, 2024

The LIFO calculator for inventory and costs of goods sold (COGS) is an intelligent tool that can help you calculate your current inventory value and the amount you have to report as COGS by considering the LIFO method.

This article will cover how to determine ending inventory by LIFO after selling in contrast to the FIFO method, which you can discover in Omni's FIFO calculator. Also, we will see how to calculate its cost of goods sold using LIFO, and show how to use our LIFO calculator online to make more profits.

What is LIFO (last-in, first-out)?

LIFO stands for last-in, first-out, and it's an accounting method for measuring the COGS (costs of goods sold) based on inventory prices. The particularity of the LIFO method is that it takes into account the price of the last acquired items whenever you sell stock.

Let's consider this example. The company acquired T-shirts as per the following scheme:

T-shirts quantity

T-shirt buying price







The company receives a sell order of 10 T-shirts. What will be the related costs? If you use our LIFO calculator, you will see the result is 144 USD.

This is because we took the last seven items at 15 USD and added the three items we bought at 13 USD:

7ร—15+3ร—13=1447 \times 15 + 3 \times 13 = 144.

That is LIFO. Last-in the inventory, first-out when the sell occurs.

It is quite different from the FIFO method (first-in, first-out), where we would have taken the two t-shirts bought at 10 USD, then the other five t-shirts at 13 USD, and finally the last three ones at 15 USD. COGS, in this case, would be 130 USD. A percentage decrease of 9.7%.

Keep in mind the LIFO vs. FIFO difference, as we will explain it more in the following paragraphs.

How to use LIFO for costs of goods sold calculation

As mentioned above, companies have to define their cost of goods sold for determining a selling price that can keep their profit margins. Let's explain how they do it when using the LIFO method. We adopt the following notation:

q1q_1 = Number of units purchased 1st time.
p1p_1 = 1st units purchased price.
q2q_2 = Number of units purchased 2nd time.
p2p_2 = 2nd units purchased price.
qiq_i = Number of units purchased last time.
pip_i = Last units purchased price.

Then the inventory value InvVal\text{InvVal} formula reads:

InvVal=p1q1+p2q2+โ€ฆ+piqi\text{InvVal} = p_1 q_1 + p_2 q_2 + \ldots + p_i q_i

Here, we are assuming the company has not sold any product yet. Please note how increasing/decreasing inventory prices through time can affect the inventory value.

The LIFO method assumes that it will take the last acquired items when the company sells its inventory. Assuming the company sells nn products:

qiq_i = Number of units purchased the last time.

qiโˆ’1q_{i-1} = Number of units purchased one time before the last one.

qiโˆ’2q_{i-2} = Number of units purchased two times before the last one.

...and so on, until the number of sold items is equal to n. Assuming,

n=qi+qiโˆ’1+qiโˆ’2n = q_i + q_{i-1} + q_{i-2} ,

COGS would be:

COGS=qipi+qiโˆ’1piโˆ’1+qiโˆ’2piโˆ’2\text{COGS} = q_i p_i + q_{i-1} p_{i-1} + q_{i-2} p_{i-2}

Following our example above:

COGS=3ร—13+7ร—15=144\text{COGS} = 3 \times 13+ 7 \times 15 = 144

Notice how the cost of goods sold could increase if the last prices of the items the company bought also increase. What happens during inflationary times, and by rising COGS, it would reduce not only the operating profits but also the tax payment. Visit the inflation calculator to learn more.

How to calculate ending inventory by LIFO

Continuing with out formulas above, we would not have the last items because we sold them accordingly to the LIFO method. Then, the ending inventory/remaining inventory InvVal\text{InvVal} would be:

InvVal=q1p1+q2p2โ€ฆ+qiโˆ’3piโˆ’3\text{InvVal} = q_1 p_1 + q_2 p_2 \ldots + q_{i-3} p_{i-3}

In the T-shirt example we mentioned above, the initial inventory value was 190 USD. You can use our LIFO calculator or go through all the T-shirts we bought and multiply them by their respective price. Then after selling the last ten items, the inventory value is:

InvVal=2ร—10+2ร—13+0ร—15=46\footnotesize \text{InvVal} = 2 \times 10 + 2 \times 13 + 0 \times 15 = 46

Thus, we end up with an inventory value of 46 USD.

How to use our LIFO method calculator

Here we are going to determine the cost of goods sold using the LIFO calculator, our revenue, and our profit margin:

  1. Add the number of items you bought and their respective prices. Our LIFO calculator will indicate the current amount of your existing inventory.
  2. In the next section, add the number of total units sold. Our tool will indicate the COGS.
  3. Finally, include the selling price. Our LIFO calculator online will indicate the total revenues and the profit margin.

Continuing with our example above, assume we sell the 10 items at a 16 USD each:

Revenues=16ร—10=160\text{Revenues} = 16 \times 10 = 160

COGS=144\text{COGS} = 144

Profits=160โˆ’144=16\text{Profits} = 160 - 144 = 16

Note that we have income. Besides, the formula for the profit margin is:

Profit margin=ProfitsRevenueโ‹…100%\text{Profit margin} = \frac{\text{Profits}}{\text{Revenue}} \cdot 100\%,


Profit margin=16160โ‹…100%=10%\text{Profit margin} = \frac{16}{160} \cdot 100\% = 10\%.


How does the LIFO method affect taxable profits?

When you compare the cost of goods sold using the LIFO calculator, you see that COGS increases when the prices of acquired items rise. Such a situation will reduce the profits on which the company pays taxes. Consequently, LIFO can help lower taxable income.

Which one is better FIFO or LIFO?

LIFO is only allowed in the USA, whereas, in the world, companies use FIFO. In the USA, companies prefer to use LIFO because it can help them reduce their taxable income. Furthermore, when USA companies have operations outside their country of origin, they present a section where the overseas inventory registered by FIFO is modified to LIFO. You can also check FIFO and LIFO calculators at the Omni Calculator website to learn what happens in inflationary/deflationary environments.

How do I calculate ending inventory using LIFO?

To determine the ending inventory using LIFO follows these steps:

  1. Determine the existing inventory by multiplying each acquisition price per the amount bought.
  2. Define how many items you are going to sell.
  3. Subtract the items you sold from the existing inventory. Start removing the last ones.
  4. Multiply the remaining ones (which are the ones you bought first) per their respective prices. Then, you have the ending inventory amount using LIFO. You can also try our LIFO calculator online.

How do I calculate COGS using LIFO?

To calculate COGS using LIFO:

  1. Keep a record of each acquisition price per the amount bought.
  2. Define how many items you are going to sell. Our LIFO method calculator would bring a result here.
  3. Take the last items and their respective prices. Select only the ones you sold.
  4. Multiply their prices by their amount. There you have your COGS as per the LIFO method.

How does inflation affect FIFO ending inventory calculation?

If you use a LIFO calculator as an ending inventory calculator, you will see that you keep the cheapest inventory in your accounts with inflation (and rising prices through time). The most expensive items would go to the COGS calculation. In that sense, we will see a smaller ending inventory during inflation compared to a non-inflationary period.

Which financial ratios does LIFO ending inventory calculation affect?

If LIFO affects COGS and makes it more significant during inflationary times, we will have a reduced net income margin. Besides, inventory turnover will be much higher as it will have higher COGS and smaller inventory. Also, all the current asset-related ratios will be affected because of the change in inventory value.

How does deflation affect LIFO ending inventory calculation?

Considering that deflation is the item's price decrease through time, you will see a smaller COGS with the LIFO method. Also, you will see a more significant remaining inventory value because the most expensive items were bought and kept at the very beginning.

Arturo Barrantes
Related calculators
Inventories bought
1st units purchased price
Number of units purchased 1st time
Enter at least your 1st inventory buy and its price.
Units sold
Total units sold
Selling price
Revenues and margin
Check out 55 similar microeconomics calculators ๐Ÿ’ฒ
Accounting profitAccrual ratioActual cash valueโ€ฆ 52 more
People also viewedโ€ฆ

Body fat

Use our free Body Fat Calculator, based on BMI, to determine your body fat percentage and explore your ideal body fat range.


Our budget calculator will help you establish your monthly personal budget.

Humans vs vampires

Vampire apocalypse calculator shows what would happen if vampires were among us using the predator - prey model.

Sales tax

Sales tax calculator works out the tax imposed on the sale of goods and services.
Copyright by Omni Calculator sp. z o.o.
Privacy, Cookies & Terms of Service