Hash Table Visualizer

Paste key-value pairs, choose a table size, and compare separate chaining with linear probing as collisions happen.

Keys
5
Buckets
7
Load
0.71
Collisions
1

Table input

Key operations

Hash table diagram

Sample table loaded with separate chaining. Try search or switch to linear probing.

Probe Collision
bucket 0
2 items
banana
value: 7
hash: 0
lemon
value: 5
hash: 0
bucket 1
0 items
empty
bucket 2
1 item
grape
value: 2
hash: 2
bucket 3
0 items
empty
bucket 4
0 items
empty
bucket 5
1 item
apple
value: 4
hash: 5
bucket 6
1 item
orange
value: 9
hash: 6

Operation details

Sample table loaded with separate chaining. Try search or switch to linear probing.

Current entries

apple: 4banana: 7orange: 9grape: 2lemon: 5

What is a Hash Table Visualizer?

A hash table visualizer shows how keys are converted into bucket indexes and how collision handling changes the final table layout. It is useful for learning hash maps, dictionaries, lookup tables, separate chaining, and open addressing.

This tool uses a simple deterministic hash so the result is easy to follow. Numeric keys use the number itself, while string keys use a character-code total before applying modulo by the table size.

For the full cluster of related tools, browse the Data Structure Visualizers hub.

How to use this hash table visualizer

  • Paste key-value pairs such as apple: 4 or 42: answer.
  • Choose a table size.
  • Switch between chaining and linear probing.
  • Insert, search, or delete a key.
  • Inspect the hash index, probe path, collisions, and bucket contents.

Separate chaining stores colliding keys in a list inside the same bucket. Linear probing searches forward for the next open bucket.

Hash table vs linked list

A linked list search usually checks nodes one by one. A hash table tries to jump directly to a bucket using a hash function.

The speed depends on the hash function, table size, load factor, and collision handling. Compare this with the Linked List Visualizer to see why hash maps are often used for fast lookup. To see a practical hash map plus linked list pattern, try the LRU Cache Visualizer.

Frequently Asked Questions

What input format does this hash table visualizer use?
Paste one key-value pair per line, such as `name: Ada`, `42: answer`, or `orange 12`. If no value is provided, the key is also used as the value.
What is a collision in a hash table?
A collision happens when two different keys map to the same bucket index.
What is separate chaining?
Separate chaining keeps a small list of entries inside each bucket that receives more than one key.
What is linear probing?
Linear probing stores one entry per bucket and checks the next bucket when the hashed bucket is already occupied.

Related tools