How to Calculate Cost of Goods Sold Using LIFO | Pro Calculator


LIFO Cost of Goods Sold Calculator

An expert tool to help you learn and apply the Last-In, First-Out inventory method.

LIFO Calculator

Enter your inventory purchases and sales data to see how to calculate cost of goods sold using LIFO. The results will update in real-time.

Inventory Purchases (Oldest to Newest)


Units in the first (oldest) inventory batch.
Please enter a valid, positive number.


Cost per unit for the first batch.
Please enter a valid, positive number.



Please enter a valid, positive number.


Please enter a valid, positive number.



Please enter a valid, positive number.


Please enter a valid, positive number.

Sales Information


The total number of units sold during the period.
Units sold cannot exceed total available units.


Cost of Goods Sold (LIFO)
$0.00

Ending Inventory Value
$0.00

Ending Inventory Units
0

Goods Available for Sale (Value)
$0.00

Goods Available for Sale (Units)
0

Formula Used: Under LIFO (Last-In, First-Out), the cost of the most recently purchased items are the first costs recorded as Cost of Goods Sold (COGS).

COGS vs. Ending Inventory Value

A dynamic bar chart comparing the value of Cost of Goods Sold (LIFO) and the remaining Ending Inventory.

Inventory Layer Breakdown

Layer Beginning Units Cost/Unit Units Sold Ending Units Ending Value
This table shows how units sold are allocated from each inventory layer according to the LIFO method.

What is Cost of Goods Sold Using LIFO?

The Last-In, First-Out (LIFO) method is a significant inventory valuation technique used in accounting. When you learn how to calculate cost of goods sold using lifo, you are working under the assumption that the last items added to your inventory are the first ones to be sold. This concept is a cornerstone of inventory accounting for many businesses in the United States, as it directly impacts the calculation of Cost of Goods Sold (COGS) on the income statement and the value of ending inventory on the balance sheet. During periods of rising prices (inflation), the LIFO method results in matching the most recent, higher costs with current revenues, which typically leads to a higher COGS, lower reported profit, and consequently, a lower income tax liability.

This method is particularly favored by businesses whose inventory costs trend upwards over time, such as sellers of commodities like oil or gasoline, and automobiles. By expensing the newest, most expensive inventory first, companies can better reflect the current cost of replacing that inventory. However, it’s crucial to understand that how to calculate cost of goods sold using lifo is a cost-flow assumption, not necessarily a reflection of the actual physical flow of goods. A common misconception is that companies must physically sell their newest products first; in reality, LIFO is purely an accounting convention. It is permitted under U.S. Generally Accepted Accounting Principles (GAAP) but is forbidden under International Financial Reporting Standards (IFRS) due to potential distortions in reported earnings and inventory values.

The LIFO Formula and Mathematical Explanation

To properly understand how to calculate cost of goods sold using lifo, you don’t use a single, simple formula like `COGS = Beginning Inventory + Purchases – Ending Inventory`. Instead, it’s an algorithmic process of assigning costs. The calculation involves identifying the cost of the most recent inventory purchases and allocating those costs to the units sold until the total number of sold units is accounted for.

Here’s a step-by-step derivation:

  1. Identify Inventory Layers: First, list all inventory purchases made during the period, including the number of units and the cost per unit for each purchase. These are your “inventory layers.”
  2. Determine Units Sold: Note the total quantity of units sold during the same period.
  3. Allocate Costs from the Last Layer: Begin with the most recent purchase (the “last-in” layer). Assign the cost of this layer to the units sold.
  4. Work Backwards: If the number of units sold exceeds the units in the last layer, move to the next most recent layer (second-to-last) and continue assigning costs. Repeat this process, moving backward through your inventory layers until all sold units have been costed.
  5. Calculate Total COGS: Sum the costs allocated in the previous steps. This total is your Cost of Goods Sold under the LIFO method.
  6. Determine Ending Inventory: Any inventory layers that were not allocated to COGS remain as ending inventory. The value of ending inventory is the sum of the costs of these remaining units.

Variables Table

Variable Meaning Unit Typical Range
Inventory Layer A specific batch of inventory purchased at a specific cost. N/A 1 to N layers
Units Purchased The number of items in an inventory layer. Units 1 – 1,000,000+
Cost per Unit The purchase price for one item in a specific layer. Currency ($) $0.01 – $100,000+
Units Sold The total quantity of items sold during the period. Units 1 – Total available units

Practical Examples of How to Calculate Cost of Goods Sold Using LIFO

Example 1: Rising Prices

A bookstore makes the following purchases of a particular novel in a quarter:

  • Jan 10: 50 books @ $10/book
  • Feb 15: 60 books @ $12/book
  • Mar 20: 40 books @ $15/book

In that quarter, the store sells 70 books. Here’s how to calculate cost of goods sold using lifo:

  1. Start with the last purchase (Mar 20): Sell all 40 books. COGS = 40 * $15 = $600.
  2. Units remaining to be costed: 70 – 40 = 30 books.
  3. Move to the next-to-last purchase (Feb 15): Sell 30 books from this layer. COGS = 30 * $12 = $360.
  4. Total COGS = $600 + $360 = $960.
  5. Ending Inventory: 50 books @ $10, and 30 books (60-30) @ $12. Value = (50 * $10) + (30 * $12) = $500 + $360 = $860.

Example 2: Selling Through Multiple Layers

A tech retailer has the following inventory of a graphics card:

  • Batch 1: 100 units @ $500/unit
  • Batch 2: 150 units @ $550/unit
  • Batch 3: 120 units @ $600/unit

The retailer sells 300 units. The process for how to calculate cost of goods sold using lifo is as follows:

  1. Sell all 120 units from Batch 3. COGS = 120 * $600 = $72,000.
  2. Units remaining to be costed: 300 – 120 = 180.
  3. Sell all 150 units from Batch 2. COGS = 150 * $550 = $82,500.
  4. Units remaining to be costed: 180 – 150 = 30.
  5. Sell 30 units from Batch 1. COGS = 30 * $500 = $15,000.
  6. Total COGS = $72,000 + $82,500 + $15,000 = $169,500.
  7. Ending Inventory: 70 units (100-30) from Batch 1. Value = 70 * $500 = $35,000. For more comparisons, check our FIFO vs LIFO guide.

How to Use This Cost of Goods Sold Calculator

Our calculator simplifies the process of applying the LIFO method. Here’s a step-by-step guide to mastering how to calculate cost of goods sold using lifo with this tool:

  1. Enter Inventory Layers: Start by inputting your inventory purchases. The calculator provides fields for three distinct layers. Enter the number of units and the cost per unit for each batch, starting with the oldest purchase in “Purchase Layer 1”.
  2. Input Units Sold: In the “Sales Information” section, enter the total number of units you sold during the accounting period. The calculator will validate that this number does not exceed your total available inventory.
  3. Review the Real-Time Results: As you type, the calculator automatically updates all result fields. The primary highlighted result is your Cost of Goods Sold (LIFO).
  4. Analyze Intermediate Values: Below the main result, you can see crucial metrics like Ending Inventory Value, Ending Inventory Units, and the total Goods Available for Sale. These numbers provide a complete picture of your inventory’s financial status.
  5. Interpret the Chart and Table: The dynamic bar chart visually compares your COGS to your Ending Inventory Value. The “Inventory Layer Breakdown” table shows exactly how many units were “sold” from each layer, providing a transparent look at the LIFO logic. This is fundamental to understanding the mechanics of how to calculate cost of goods sold using lifo. More information on inventory can be found in our article on inventory valuation.

Key Factors That Affect LIFO COGS Results

The results from a LIFO calculation are sensitive to several business and economic factors. Understanding these is key to accurate financial reporting.

  • Inflation and Supplier Pricing: During periods of rising prices, LIFO yields a higher COGS. This is because the most recent, more expensive items are considered sold first. This directly reduces your taxable income, a primary reason companies choose LIFO. Our inflation calculator can help you analyze price trends.
  • Deflation: In a deflationary environment (falling prices), the opposite occurs. LIFO would result in a lower COGS and higher taxable income, making it less advantageous.
  • Purchase Timing: The timing and size of your inventory purchases are critical. A large, expensive purchase made right before the end of an accounting period can significantly increase the COGS for that period if sales are made. Mastering how to calculate cost of goods sold using lifo requires careful purchase planning.
  • Inventory Liquidation (LIFO Liquidation): If a company sells significantly more inventory than it purchases in a period, it may have to dip into older, cheaper inventory layers. This “LIFO liquidation” can lead to an abnormally low COGS and a sharp, often misleading, increase in reported net income and tax liability.
  • Inventory Management Systems: The ability to accurately track each inventory layer is paramount. Poor inventory tracking can make an accurate LIFO calculation impossible. Modern inventory systems are essential for companies that need to know how to calculate cost of goods sold using lifo correctly. Explore our supply chain management resources for more.
  • Industry Type: LIFO is most suitable for businesses with non-perishable goods and rising inventory costs. It’s impractical for businesses with perishable items (like food) where the oldest items must physically be sold first (a FIFO flow).

Frequently Asked Questions (FAQ)

1. Why would a company choose LIFO over FIFO?
The primary benefit of LIFO is tax reduction during periods of rising prices. By reporting a higher COGS, a company can report a lower net income, thus lowering its income tax bill. This is a significant cash flow advantage.
2. Is LIFO allowed for all companies?
LIFO is permitted under U.S. GAAP but is strictly prohibited under International Financial Reporting Standards (IFRS), which are used by most other countries. This creates a major accounting difference for multinational corporations.
3. Does LIFO reflect the actual flow of goods?
Rarely. For most businesses, especially in retail or food service, it’s practical to sell the oldest goods first to avoid spoilage or obsolescence. LIFO is an accounting assumption about cost flow, not necessarily the physical flow of products. The process of learning how to calculate cost of goods sold using lifo is about financial reporting, not logistics.
4. What is a “LIFO reserve”?
The LIFO reserve is the difference between the inventory value stated under FIFO and the value stated under LIFO. Companies using LIFO in the U.S. must disclose this reserve, allowing analysts to convert their statements to a FIFO basis for comparison with other companies.
5. What happens if I sell more than I have in my most recent layer?
This is the core of the LIFO process. You simply move to the next most recent layer and continue allocating costs from there until you’ve accounted for all sold units. Our calculator automates this for you.
6. Can using LIFO make my company look less profitable?
Yes. Because LIFO often leads to a higher COGS during inflation, it results in lower reported gross profit and net income. While good for taxes, it can make the company appear less profitable to investors or lenders comparing it to a company using FIFO. Our gross profit calculator can show this effect.
7. Is it hard to switch from FIFO to LIFO?
Switching inventory methods can be complex and requires approval from the IRS in the United States. It involves recalculating inventory values and can have significant one-time tax implications. Understanding how to calculate cost of goods sold using lifo is the first step.
8. What are the main direct costs included in COGS?
COGS typically includes the cost of raw materials, direct labor for production, and manufacturing overhead directly tied to creating the goods. For a retailer, it is primarily the purchase cost of the items for resale.

Related Tools and Internal Resources

Continue your financial education with these related calculators and articles:

© 2026 Professional Calculators. All Rights Reserved. For educational purposes only.


Leave a Reply

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