Insertion sort step visualizer

Sort a numeric list and inspect comparisons and shifts.

Enter values

Start with the example below, or enter your own values.

How it works

Insert each next element into the sorted prefix; show the first twelve insertion steps. At most 256 elements.

Try an example

Numbers: 5, 2, 4, 1, 3. The form starts with these values; change them to explore your own case.

Example result: 1, 2, 3, 4, 5

  1. Insert 2: 2, 5.
  2. Insert 4: 2, 4, 5.
  3. Insert 1: 1, 2, 4, 5.
  4. Insert 3: 1, 2, 3, 4, 5.

Learn more in Algorithm reasoning and step visualizers.

Results are calculated locally. Floating-point tools provide numerical approximations, not formal proof certificates.