UtilityKit

500+ fast, free tools. Most run in your browser only; Image & PDF tools upload files to the backend when you run them.

Snowflake ID Generator

Generate Twitter-style Snowflake IDs — 64-bit time-ordered unique integers used in distributed social platforms.

About Snowflake ID Generator

The Snowflake ID Generator creates 64-bit integer IDs in the Snowflake format, originally developed by Twitter (now X) and widely adopted by Discord, Instagram, Mastodon, and other high-volume distributed platforms. A Snowflake ID packs a 41-bit millisecond timestamp, a 10-bit machine/worker ID, and a 12-bit sequence number into a 64-bit integer. This makes Snowflakes time-ordered, unique across nodes, and generatable at up to 4096 IDs per millisecond per node with no coordination required. The tool also includes a decoder that extracts the timestamp, worker ID, and sequence from any existing Snowflake ID.

Why use Snowflake ID Generator

  • Generates time-ordered 64-bit integer IDs compatible with Discord, Twitter formats.
  • Decodes existing Snowflake IDs to reveal embedded timestamp and node info.
  • Supports configurable worker ID for multi-node simulation.
  • Shows both decimal and binary representation for learning.
  • Compatible with Discord, Twitter, Mastodon, and many other large-scale platforms out of the box.
  • 64-bit integer storage is half the size of a UUID, reducing primary-key index width substantially in high-volume tables.

How to use Snowflake ID Generator

  1. Click Generate to produce a Snowflake ID at the current timestamp.
  2. Set a Worker ID (0-1023) to simulate multi-node generation.
  3. Use the Decode tab to paste any Snowflake ID and extract its components.
  4. Copy the Snowflake ID string or its BigInt representation.
  5. Switch the epoch preset to Discord, Twitter, or Custom to match the system whose IDs you are decoding or producing.
  6. Use the Bulk generation field with a fixed Worker ID to simulate a single node generating thousands of IDs in one millisecond.

When to use Snowflake ID Generator

  • Building high-throughput distributed systems that need time-ordered IDs.
  • Decoding Discord or Twitter Snowflakes to find creation timestamps.
  • Learning the Snowflake ID format for implementation in your own system.
  • Generating compatible IDs for testing Snowflake-aware APIs.
  • Forensic analysis on Discord or Twitter data exports where you need to reconstruct message timing from the ID alone.
  • Designing a high-throughput message broker or feed system that must generate millions of unique IDs per second across nodes.

Examples

Generate at a known time

Input: Epoch: 1288834974657 (Twitter), Worker: 1, Time: 2023-11-15T14:23:51Z

Output: 1724813574123520001

Decode a Discord message ID

Input: 1014143476327878758

Output: Timestamp: 2022-08-30T20:33:13.094Z Worker: 4 Sequence: 38

Multi-worker batch

Input: Worker: 5, Count: 3

Output: 1724813574123544576 1724813574123544577 1724813574123544578

Decode a Twitter ID

Input: 1700000000000000000

Output: Timestamp: 2023-09-08T05:51:50.857Z Worker: 0 Sequence: 0

Tips

  • Pick a Snowflake epoch and document it in source control — once IDs are minted, you cannot change the epoch without breaking timestamp decoding for existing rows.
  • Worker IDs must be globally unique across all generators in the same cluster. A common pattern is reading them from environment variables baked at deploy time.
  • If you need more than 4096 IDs per millisecond per node, you must add nodes (not raise the sequence width); that limit is a structural property of the 12-bit sequence field.
  • Treat Snowflake IDs as 64-bit integers in storage but always serialize as strings in JSON — JavaScript loses precision above 2^53, and a numeric IEEE 754 will mangle them.
  • Decoding a Snowflake gives you the creation time exactly because the timestamp is embedded; this is invaluable for incident forensics on Discord or Twitter data dumps.
  • Do not reuse worker IDs after a host is decommissioned for at least one full epoch wraparound period; clock-skew bugs can otherwise surface long after the host is gone.
  • When building your own Snowflake service, monotonic clock readings (CLOCK_MONOTONIC) prevent NTP corrections from minting duplicate IDs after the wall clock jumps backward.

Frequently Asked Questions

What is the maximum throughput of Snowflake IDs?
A single node can generate 4096 unique IDs per millisecond. With 1024 nodes, the system supports over 4 million unique IDs per millisecond.
Why does Discord use Snowflake IDs?
Discord adopted the Snowflake format because it produces globally unique IDs at massive scale with no coordination, and the embedded timestamp makes message ordering trivial.
How do I extract the creation time from a Discord ID?
Paste the Discord Snowflake into the Decode tab. The tool extracts the Unix millisecond timestamp and converts it to a human-readable date and time.
Does this use JavaScript BigInt?
Yes. Snowflake IDs exceed JavaScript's safe integer range (2^53), so the tool uses BigInt for accurate representation.
Can I customize the epoch?
Yes. The tool defaults to Twitter's epoch (1288834974657 ms). You can enter a custom epoch for other systems.
Will Snowflake IDs run out?
Standard Snowflakes use a 41-bit timestamp, giving about 69 years from the chosen epoch before rollover. Twitter's epoch rolls over around 2079; design for migration well before that.
Why use BigInt instead of regular numbers?
JavaScript Number is a 64-bit IEEE 754 float with only 53 bits of integer precision. Snowflake IDs use the full 64 bits, so they must be handled as BigInt to avoid silent rounding to even.
Are Snowflake IDs cryptographically secure?
No. They are predictable: knowing one ID lets you guess nearby IDs. Never use Snowflakes for session tokens, password reset codes, or anything where unguessability matters.

Explore the category

Glossary

Snowflake ID
A 64-bit unique identifier format introduced by Twitter in 2010, structured as a timestamp + worker ID + sequence number.
Snowflake epoch
A custom Unix-millisecond starting point from which Snowflake timestamps are measured. Twitter's default is 2010-11-04T01:42:54.657Z.
Machine/Worker ID bits
The 10 bits in the middle of a Snowflake (5 datacenter, 5 worker) that uniquely identify the generating node, supporting 1024 workers.
Sequence number
The trailing 12 bits incremented within a single millisecond on a single worker, allowing 4096 IDs per worker per millisecond.
Clock skew
Drift between the wall clocks of multiple Snowflake workers; large skew can cause ID ordering or duplicate-issuance bugs.
Twitter Snowflake vs Discord Snowflake
Both use the same bit layout but different epochs (Twitter 2010-11-04, Discord 2015-01-01). Decoding requires the matching epoch.
BigInt
JavaScript's native arbitrary-precision integer type, required for Snowflake math because IDs exceed Number's safe 2^53 limit.