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.