Last in, first out is an accounting method for inventory and cost of sales in which the last items produced or purchased are assumed to be sold first.