hashCode() visualizer
Pick a hash function on the red → green scale, choose how many objects, and press Play. Watch them fill the buckets — and turn into red-black trees.
Hash function quality bad good
@Override public int hashCode() {
return Objects.hash(id, name, age);
}The idiomatic choice. Combines all identity fields with good distribution.
Number of objects
custom
Speed
0 / 100 inserted
Hashing pipeline
Object
hashCode()
spread ^>>>16
(n-1) & h
Bucket
Buckets · capacity 16
chain load1 → many tree
Size / Capacity
0 / 16
Est. lookup
O(1)
hashCode() calls
0
equals() calls
0
Collisions
0
Longest chain
0
Avg chain
0
Utilization
0%
Load factor
0.75
Resizes
0
Healthy distribution. Keys spread evenly, chains stay short, and lookups stay near O(1). This is what a good hashCode() looks like.