Code tool

Snowflake ID Generator

Choose the Twitter epoch, the Discord epoch only, or custom Unix milliseconds. Generate up to 1,000 IDs using your local clock, or decode a decimal ID using the same fixed layout.

In-browser processingNo account requiredPrivacy details ↗

Epoch range: 0–8,637,800,976,744,449 Unix milliseconds. Generation uses your local clock. Sequence exhaustion waits for the next millisecond without wrapping.

Fixed layout: 41 relative milliseconds / 10 node / 12 sequence bits. Discord changes only the epoch; this is not native Discord 42/5/5/12 decoding. State lives in this page and current configuration only. Configuration changes reset it. No uniqueness guarantee across configurations, pages or devices.

A QUICK WALKTHROUGH

How to use this tool

  1. Choose generation or decoding and select the epoch.
  2. For generation, enter node 0–1,023, initial sequence 0–4,095 and count 1–1,000; for decoding, enter a decimal ID.
  3. Run and copy the complete result. You can cancel generation; incomplete batches are never displayed.

Fixed generic layout

The ID has 41 relative millisecond bits, 10 combined node bits and 12 sequence bits, within 0–2⁶³−1. Twitter epoch is 1288834974657. Discord epoch is 1420070400000, but selecting it changes only the epoch: this is not native Discord 42/5/5/12 decoding.

Bounded generation

Date.now supplies local time. Within each millisecond the sequence increments without wrapping; exhaustion yields while waiting for the next millisecond. Clock rollback is rejected. Batches have at most 1,000 IDs, a 2-second budget and 25,000 output characters. Cancellation or failure hides the entire batch while retaining consumed sequence state.

Epoch and state limits

Custom epoch must be a whole Unix-millisecond value from 0 to 8,637,800,976,744,449, keeping all decoded dates within the JavaScript date range. Relative time is 0–2⁴¹−1. Decode accepts 1–19 decimal digits. State exists only in this page and current configuration; changing epoch, node or initial sequence resets it. No global uniqueness guarantee across configurations, pages or devices. Nothing is uploaded.

GOOD TO KNOW

Common questions

Does this generate or decode native Discord IDs?

No. The Discord option reuses its epoch only; the layout always remains generic 41/10/12.

Are the IDs exact?

Yes. Packing, masks and decimal conversion use BigInt, not floating-point IDs.

Is this a coordinated production ID service?

No. It has no shared node allocation or persistent state. Page reloads, other pages, devices or configuration changes may produce duplicates.