A loop invariant is a statement that is true before and after each loop iteration. It helps you prove correctness: if it holds initially, stays true each step, and implies the goal at the end, the algorithm is correct.