Snowflake ID Decoder
All processing happens in your browser. No data is sent to any server.
About this tool
The four fields inside a Snowflake ID
A Snowflake is a signed 64-bit integer whose bits are partitioned into fixed-width fields, which is why it can be decoded with nothing but shifts and masks. The most significant bit is unused and always zero, keeping the value positive so it fits in a signed 64-bit database column and sorts correctly as a number. The next 41 bits hold a millisecond timestamp measured from a service-specific epoch rather than the Unix epoch, giving roughly 69 years of range from whenever that epoch was chosen. The following 5 bits identify the datacenter and the 5 bits after that identify the worker within it, allowing 32 datacenters of 32 workers each. The final 12 bits are a sequence counter that increments for each ID a single worker produces within the same millisecond, capping one worker at 4096 IDs per millisecond before it must wait for the clock to advance. Because every field has a fixed position and every worker has a distinct datacenter and worker pair, IDs are unique across the fleet with no coordination between machines, and they sort chronologically by plain numeric comparison.
Why the epoch matters, and how to find it
The timestamp in a Snowflake is an offset from a custom epoch chosen by whoever designed that particular ID scheme, and decoding with the wrong epoch produces a date that is wrong by exactly the difference between the two epochs. Twitter, which invented the format, uses 4 November 2010. Discord uses 1 January 2015, which is why a Discord ID decoded against the Twitter epoch reads as roughly four years too early. Instagram, Sony, Baidu, and many in-house implementations each picked their own, and some redistribute the bit widths as well, trading sequence bits for machine bits or extending the timestamp. This decoder auto-detects the Twitter and Discord epochs by checking which one yields a plausible date, and lets you supply a custom epoch when the ID comes from something else. If you do not know the epoch, you can recover it: take an ID whose real creation time you know from another source, decode the raw 41-bit timestamp field, and subtract it from the known time in Unix milliseconds. The remainder is the epoch. Doing this with two or three known IDs confirms the bit layout at the same time, since a wrong field width will not give a consistent answer across samples.
Frequently Asked Questions
How do I decode a Discord ID?
A Discord ID is a Snowflake with Discord bit widths and the Discord epoch of 1 January 2015, so paste it into this decoder and the epoch is detected automatically. Discord splits the 64 bits as 42 bits of millisecond timestamp offset from its epoch, 5 bits of internal worker ID, 5 bits of internal process ID, and 12 bits of a per-process increment. Every object Discord exposes uses the same scheme, which means the creation time of a user account, a guild, a channel, or a message can be read directly from its ID with no API call. That is genuinely useful for moderation and for debugging ordering issues, since comparing two message IDs numerically tells you which was sent first without fetching either message. Note that the worker and process fields are internal to Discord infrastructure and carry no meaning for API consumers, so there is nothing to be learned from them. If the decoded date lands in the early 2010s, the ID has almost certainly been decoded against the Twitter epoch instead: switch the epoch selector to Discord.
Why does my Snowflake decode to the wrong date?
Nearly always the epoch. The 41-bit timestamp field is an offset, not an absolute time, so a decoder using the Twitter epoch on a Discord ID reports a date about four years and two months early, and a decoder assuming the Unix epoch on any Snowflake reports a date in the early 1970s. Switch the epoch selector, or enter the correct custom epoch if the ID comes from an in-house generator. A second cause is a non-standard bit layout: some implementations widen the timestamp field or narrow the sequence, so reading the standard 41-bit slice picks up bits that belong to a neighbouring field and produces a date that is wrong in an unobvious way. A third cause is precision loss in JavaScript, which is worth checking before blaming the decoder. A 64-bit Snowflake exceeds the 53 bits of integer precision a JavaScript number can hold exactly, so any code path that parses the ID with JSON.parse or Number and then re-serialises it will silently corrupt the low digits. Keep Snowflakes as strings or BigInt end to end, and confirm that the value you pasted still matches the source.
Can a Snowflake ID be forged or guessed?
A Snowflake is not a secret and should never be treated as one. Every field is derived from public or low-entropy information: the timestamp is the wall clock, the datacenter and worker identifiers are small integers, and the sequence is a counter starting at zero each millisecond. Given one valid ID, an attacker can construct plausible neighbouring IDs by adjusting the timestamp and sequence, and in a system that assigns sequential IDs to sequential records those guesses will frequently hit real objects. This makes Snowflakes unsuitable as capability tokens, unguessable share links, or password reset identifiers, all of which need cryptographic randomness rather than structure. The correct use is as a primary key or event identifier behind a proper authorisation check, where being guessable does not matter because the server verifies that the caller may access the object. The same reasoning applies in reverse: because the timestamp is readable by anyone, publishing Snowflakes discloses exactly when each record was created and, by comparing sequence numbers across a time window, roughly how many records you are creating.
Standards & References
- Twitter Snowflake — The original implementation and bit layout
- Discord Snowflakes — Discord field layout and its 2015 epoch