Distributed ID Generator

Visualize the Twitter Snowflake Algorithm generating 64-bit unique numbers

Generator Configuration

Set up your machine instance identity to generate unique IDs without centralized coordination.

1
1

Resulting 64-bit Decimal Integer

Binary Breakdown (64 bits)

0
Sign
(1)
00000000000000000000000000000000000000000
Timestamp ms
(41 bits)
00000
Datacenter
(5 bits)
00000
Machine
(5 bits)
000000000000
Sequence
(12 bits)

Why Snowflake?

  • Sortable by TimeBecause the first 41 bits are a timestamp, the IDs naturally sort chronologically, making it highly efficient for database primary keys.
  • Decentralized & ScalableBy allocating bits to Datacenter ID and Machine ID, servers generate IDs independently without locking or network calls to a central server.
  • 64-bit Integer SizeUnlike 128-bit UUID strings, these fit natively into a standard 64-bit integer, indexing faster in relational databases like MySQL.

Generation Log (Last 5)