What is a Snowflake ID?
A Snowflake ID is a 64-bit unique identifier designed for distributed systems. Created by Twitter in 2010, it allows multiple servers to generate unique IDs independently without any coordination. Discord, Instagram, and many other platforms have adopted this approach.
Unlike auto-increment IDs that require a central database, or random UUIDs that can't be sorted by time, Snowflake IDs are both distributed and time-ordered. You can sort them chronologically and extract the creation timestamp.
How to Decode a Twitter/X Snowflake ID
Every Twitter/X tweet ID, user ID, and other entity ID is a Snowflake containing its creation timestamp. Twitter created the Snowflake system in 2010 to handle their massive scale. To decode a Twitter Snowflake ID manually:
- Right-shift by 22 bits: This extracts the timestamp portion from the 64-bit ID
- Add Twitter's epoch: 1288834974657 (November 4, 2010, 01:42:54.657 UTC) - this is when Twitter launched Snowflake
- Convert to date: The result is Unix milliseconds, which you can convert to a readable date
For example, to find when a tweet was posted, just paste the tweet ID into this tool above and select "Twitter/X" as the platform. The tool automatically extracts the date and time when the tweet was created!
How to Decode a Discord ID
Every Discord ID, whether it's a user, message, server, or channel, is a Snowflake containing its creation time. To decode manually:
- Right-shift by 22 bits: This extracts the timestamp portion
- Add Discord's epoch: 1420070400000 (January 1, 2015)
- Convert to date: The result is Unix milliseconds
Or just paste the ID above and let this tool do it for you!
Why Companies Use Snowflake IDs
- No coordination needed: Each server generates IDs independently using its worker ID
- Time-sortable: Newer IDs are always larger. Great for chronological queries
- Compact: 64 bits vs 128-bit UUIDs. Fits in a single database integer
- High throughput: 4,096 IDs per millisecond per machine (4M+ IDs/second cluster-wide)
- Embedded metadata: Extract creation time without a database lookup
The Math Behind Decoding
A Snowflake ID encodes data using bit positions:
- Bits 63: Sign bit (always 0 for positive numbers)
- Bits 22-62: Timestamp. milliseconds since platform epoch
- Bits 17-21: Worker ID. Which machine generated this
- Bits 12-16: Process ID. Which process on that machine
- Bits 0-11: Sequence. counter for same-millisecond IDs
To extract each component, use bit shifting and masking. This tool performs these operations automatically.