Binary search step visualizer

Trace lower-bound binary search on an ordered numeric list.

Enter values

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

How it works

Halve the candidate interval until the first index with value at least the target is found. Indices start at zero.

Try an example

Sorted list: 1, 3, 5, 5, 8; Target: 5. The form starts with these values; change them to explore your own case.

Example result: First index = 2

  1. Inspect index 2: 5; interval [0, 5).
  2. Inspect index 1: 3; interval [0, 2).

Learn more in Algorithm reasoning and step visualizers.

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