How 64-Bit Snowflake IDs Store Time

Large distributed platforms cannot rely on a single database auto-increment counter because millions of messages arrive every second across different servers. Twitter created the Snowflake format in 2010 to generate unique, time-sorted 64-bit integers independently on every server node.

64-bit Snowflake ID structure showing 42-bit timestamp, 5-bit worker ID, 5-bit process ID, and 12-bit increment
Figure 1: Bit allocation inside a standard 64-bit Snowflake identifier.

Verified Platform Epoch Values

PlatformEpoch Date (UTC)Offset (Milliseconds)Bit Shift
Discord2015-01-01 00:00:00.0001420070400000>> 22
Twitter / X2010-11-04 01:42:54.6571288834974657>> 22

Why JavaScript Needs BigInt for Snowflakes

A 64-bit Snowflake ID uses up to 19 decimal digits. Standard JavaScript numbers lose accuracy above 9007199254740991 (16 digits), which corrupts the last few digits of the ID and shifts worker bits. This tool uses BigInt arithmetic so every single bit stays accurate.

To extract a Discord creation timestamp in your own JavaScript code, shift the BigInt right by 22 bits and add the Discord epoch:

const snowflake = 175928847299117063n;
const discordEpoch = 1420070400000n;
const timestampMs = Number((snowflake >> 22n) + discordEpoch);
console.log(new Date(timestampMs).toISOString());