How snowflake IDs work
A snowflake is a 64-bit integer: 41 bits of timestamp (milliseconds since a platform-specific epoch), 5 bits worker, 5 bits process, 12 bits sequence. That's why IDs are roughly time-ordered — and why the timestamp is recoverable: timestamp = (id >> 22) + epoch.
Platform epochs
- Discord: epoch 1420070400000 = 2015-01-01 UTC. Discord IDs include a leading "c" in some client displays — strip it before decoding.
- Twitter / X: epoch 1288834974657 = 2010-11-04 01:42:54 UTC. Tweet and user IDs decode the same way.
- Instagram: epoch 1314220021721 ≈ 2011-08-24. Media IDs use the same 41-bit scheme.
- Custom: some in-house systems use their own epoch — enter it (ms since 1970-01-01) and the decoder applies the same shift.
Practical uses
- Account age: decode a Discord user ID to see when the account was created — useful for spotting brand-new accounts.
- Message forensics: a message ID's timestamp beats the displayed time for exact ordering.
- Batch log analysis: paste thousands of IDs; the table shows each with its UTC time.
- IDs are 64-bit — they exceed JS safe-integer range, so the decoder handles them as BigInt internally and never loses precision.
Under the hood
A snowflake ID is a 64-bit integer that packs a timestamp, a machine identifier and a sequence number. The page uses BigInt for the shifts and masks, because a plain JavaScript number only holds 53 bits of precision and would silently corrupt the low bits. Different platforms count from different epochs — Discord, Twitter and Instagram each have their own — and choosing the wrong one shifts the decoded time by years.
Formats, sizes and other limits
64-bit snowflake-style IDs only. UUIDs, MongoDB ObjectIds and Sonyflake have different widths and epochs and need their own tools. The epoch must match the generator or the timestamp is meaningless, and the bit layout is not universal: the common 5+5+12 split for machine, worker and sequence is a convention, not a standard, so custom implementations need checking against their own documentation.
Privacy: nothing is uploaded
IDs are decoded with bitwise arithmetic locally. No database is queried, so the record behind an ID is never touched.
Frequently asked questions
Why is the timestamp years off?
The epoch is wrong. Each platform counts from its own start date, and Twitter's and Discord's differ by several years.
Does it work with UUIDs?
No. UUIDs are 128-bit identifiers with a completely different structure.
How are machine and sequence read?
The common layout is 5 bits of machine, 5 of worker and 12 of sequence, but the widths are set by the implementation — verify against its docs.