| 2113793141252292608 | |
|---|---|
Snowflake ID | |
| Other names | Twitter Snowflake X Snowflake |

Snowflake IDs, or snowflakes, are a form of unique identifier used in distributed computing. The format was created by Twitter (now X) and is used for the IDs of tweets. It is popularly believed that every snowflake has a unique structure, so they took the name "snowflake ID". The format has been adopted by other companies, including Discord and Instagram. The Mastodon social network uses a modified version.
A snowflake is composed of 64 bits:
Only 63 bits are variable, so that a non-negative number can be processed readily as a 64-bit signed integer; the final number is generally serialized textually as a decimal number.
Snowflakes are sortable by time, because they are based on the time they were created. Additionally, the time a snowflake was created can be calculated from the snowflake. This can be used to get snowflakes (and their associated objects) that were created before or after a particular date.
| Offsets | Octet | 0 | 1 | 2 | 3 | |||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Octet | Bit | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | |
| 0 | 0 | 0 | Timestamp - first 31 bits | |||||||||||||||||||||||||||||||
| 4 | 32 | Timestamp - last 10 bits | Machine ID | Machine Sequence Number | ||||||||||||||||||||||||||||||
A tweet produced by @Wikipedia in February 2025 has the snowflake ID 1888944671579078978. The number may be converted to binary as 0001 1010 0011 0110 1110 0001 0010 1011 1011 0101 11 | 01 0110 1000 | 0001 0100 0010, with pipe symbols denoting the three parts of the ID.
The format was first announced by Twitter in June 2010. Due to implementation challenges, they waited until later in the year to roll out the update.