Binary Search Visualizer
Step through binary search on a sorted array, inspect low, high, and mid indexes, and compare exact search with lower bound search.
Array input
The tool sorts numeric input before running binary search.
Step controls
Step 1 of 5: Start exact search for 11.
Search range
Start exact search for 11.
Current comparison
- Target
- 11
- Mode
- Exact
- Mid value
- -
- Result
- -
Result
What is a Binary Search Visualizer?
A binary search visualizer shows how an algorithm repeatedly cuts a sorted search range in half. The range starts with a low index and a high index, then each step checks the middle value.
This tool supports exact target search and lower bound search. It is useful for understanding sorted array problems, boundary updates, and common coding interview patterns.
For the full cluster of related tools, browse the Data Structure Visualizers hub.
How to use this binary search visualizer
- Paste an array such as
[1, 3, 5, 7, 9, 11, 13]. - Choose exact search or lower bound mode.
- Enter the target value.
- Step through each low, high, and mid update.
- Compare the highlighted range with the current comparison and final result.
Exact search vs lower bound
Exact binary search stops when the middle value equals the target. If the target is not found, the algorithm returns no matching index.
Lower bound binary search finds the first index whose value is greater than or equal to the target. This pattern is useful for insertion positions, threshold problems, and “first valid answer” searches.
Compare this page with the Two Pointers Visualizer, Sliding Window Visualizer, and Sorting Algorithm Visualizer.