/ˈlaɪ.foʊ/

noun — "last item in, first item out."

LIFO, short for Last In, First Out, is a data handling or storage method in which the most recently added item is the first to be removed. This ordering principle is used in stacks, memory management, and certain inventory accounting practices, ensuring that the latest entries are processed before earlier ones.

Technically, a LIFO stack supports two primary operations: push (adding an item to the top) and pop (removing the item from the top). No element below the top can be removed until the top element is processed, preserving the strict ordering. In programming, stacks implemented with arrays or linked lists commonly use this principle for function call management, expression evaluation, and undo operations.

In workflow terms, consider a stack of plates: the last plate placed on top is the first one you remove. In computing, when a function calls another function, the return address and local variables are stored on the call stack using LIFO, ensuring proper execution flow and return sequencing.

Conceptually, LIFO acts like a stack of boxes: you can only remove the one on top, leaving the earlier ones untouched until the top layers are cleared.

See Stack, FIFO, Memory.