Snowflake ID Generator & Decoder

Generate or decode Twitter-style 64-bit Snowflake ids. The canonical layout packs a 41-bit millisecond timestamp, a 10-bit datacenter + worker id, and a 12-bit per-millisecond sequence number into a single bigint. Pick a custom epoch (Twitter ships 1288834974657, Discord / Instagram / BigQuery shard use the same shape with their own), set the generator's datacenter + worker id, and the page produces a strictly-ordered stream of ids — or paste one in to see the pieces. Pure client-side, no upload.

Decode a Snowflake id

Numbers above 253-1 lose precision in JavaScript's number type — paste them as decimal strings or hex strings (with or without 0x prefix).

Generate Snowflake ids

Twitter ships 1288834974657 (2010-11-04 01:42:54.657 UTC). For other systems, paste the ms epoch they publish.

1 – 100. Within the same ms, sequences increment monotonically.

How a Snowflake id is laid out

A Snowflake id is a 64-bit unsigned integer. Reading from most to least significant bit:

FieldBitsLengthRange
Sign (always 0)6310
Timestamp ms (since epoch)22–6241~69.7 years
Datacenter id17–2150–31
Worker id12–1650–31
Sequence0–11120–4095

Within a single millisecond the same (datacenter, worker) generator can produce up to 4096 distinct ids; once the sequence fills, the timestamp is bumped by one and the sequence rolls back to 0. Different datacenter+worker pairs generate independently — they don't collide because the id-space is partitioned by those bits.