Snowflake ID Converter — Discord & Twitter Timestamps
Paste any 64-bit snowflake ID — from Discord, Twitter/X, or your own service — and this tool bit-shifts out the timestamp, worker, process, and sequence fields. Every conversion is pure integer arithmetic against a fixed epoch constant.
Snowflake ID → timestamp.
Decode Discord, Twitter/X, or custom 64-bit snowflake IDs into dates — pure bit-shifts against a fixed epoch, no lookups.
How a snowflake ID is laid out
A snowflake is a 64-bit integer. The sign bit (bit 63) is unused, the next 41 bits are a timestamp in milliseconds since a service-specific epoch, and the remaining 22 bits identify the machine and the request:
- Bits 62–22 — timestamp in ms. Shift right by 22 and add the epoch to get the date.
- Bits 21–17 — 5 bits: the worker (Discord) or datacenter (Twitter) ID.
- Bits 16–12 — 5 bits: the process (Discord) or worker (Twitter) ID.
- Bits 11–0 — 12 bits: a per-millisecond sequence counter (0–4095).
Because the timestamp is stored in the most significant bits, snowflake IDs sort in chronological order — which is exactly why so many services use them for primary keys.
Known epochs
- Discord — epoch
1420070400000ms (2015-01-01 00:00:00 UTC). Worker / process / sequence layout. - Twitter / X — epoch
1288834974657ms (2010-11-04 01:42:54.657 UTC). Datacenter / worker / sequence layout. - Custom — any epoch in milliseconds, for self-hosted snowflake implementations.
Example conversions
1535074998681600000→ August 7, 2026 00:00:00 UTC (Discord epoch, worker 0, process 0, sequence 0).0→ exactly the selected epoch — the first ID a service could ever issue.
In your own code
- JavaScript:
(id >> 22n) + 1420070400000n— the timestamp in ms (useBigInt; IDs exceedNumber.MAX_SAFE_INTEGER). - Python:
(id >> 22) + 1420070400000— thendatetime.fromtimestamp(ms / 1000, tz=timezone.utc). - Go:
time.UnixMilli((id >> 22) + 1420070400000). - SQL:
FROM_UNIXTIME((id >> 22 + 1420070400000) / 1000)— on 64-bit integers only.
Gotchas
- Precision — IDs are up to 19 digits, larger than JavaScript's safe-integer limit. This converter reads them with
BigInt, so nothing is lost. In your own JS, never parse an ID withNumber(). - The 22 bits — timestamp is
id >> 22with arithmetic shift; worker is(id >> 17) & 0x1F; process is(id >> 12) & 0x1F; sequence isid & 0xFFF. - Epochs differ — a Discord ID decoded against the Twitter epoch is off by about four years. Always pick the right preset (or supply the custom epoch).
- Microservices — many self-hosted snowflake forks keep the same 41/5/5/12 layout but change the epoch; the Custom preset covers those.
Related tools
Once you have the timestamp part, theUnix timestamp to date converter can format it in any timezone, and the date to epoch converter does the reverse.
Related converters
- Full online epoch converter — Unix time with batch conversion and code snippets.
- Unix timestamp to date converter — decode any epoch value into a readable date.
- Date to epoch converter — turn any date string back into a Unix timestamp.
- Milliseconds to epoch converter — for
Date.now()values and high-precision APIs. - Snowflake ID converter — decode Discord and Twitter/X 64-bit IDs.
- LDAP / Active Directory timestamp converter— 100-nanosecond FileTime values.
- GPS time converter — week numbers and seconds-of-week since 1980.
- NTP timestamp converter — seconds since 1900, with the 64-bit packet form.
- .NET DateTime ticks converter — 100-nanosecond ticks since year 1.
- Mac HFS+ timestamp converter — seconds since 1904.
- Excel date converter — OADate serial numbers, days since 1900.