1001Ferramentas
❄️Generators

Discord Snowflake ID Generator

Generate Discord-style Snowflake IDs (Twitter-like, 64-bit, timestamp-embedded). For bot mockups and library tests.


  

Discord IDs: Snowflakes with a 2015 epoch

Discord is the chat-and-voice platform launched in May 2015 by Hammer & Chisel (now Discord Inc.). Every entity inside Discord — users, servers (guilds), channels, messages, roles, emojis, threads — receives a 64-bit Snowflake ID, the same shape Twitter introduced in 2010 but with a different epoch and a different field split. In string form a Discord Snowflake is typically 17 to 19 digits long, which already cannot fit in a 32-bit integer and must be carried as a string in JavaScript to avoid silent precision loss.

Bit layout of a Discord Snowflake

 42 bits          | 5 bits     | 5 bits      | 12 bits
 timestamp ms     | worker id  | process id  | increment
 since Discord    | (0-31)     | (0-31)      | (0-4095)
 epoch (Jan 1 '15)

The Discord epoch is 1420070400000 (1 January 2015, 00:00 UTC). To recover the creation time of any object, right-shift the ID by 22 bits and add the epoch:

const id = 175928847299117063n;
const ts = Number((id >> 22n)) + 1420070400000;
new Date(ts).toISOString();
// → 2016-04-30T11:18:25.796Z

Usernames, discriminators and the 2023 migration

From 2015 to 2023, Discord used the Username#1234 scheme: a chosen name plus a four-digit discriminator that disambiguated duplicates. In 2023 the platform migrated to unique global @handles, leaving every legacy account with the placeholder discriminator #0. The Snowflake ID never moved during this migration — it remains the single source of truth, which is exactly why it is the right primary key for any integration.

API, gateway and bots

  • RESThttps://discord.com/api/v10/ for create/read/update on guilds, channels and messages.
  • Gateway — a WebSocket connection that streams real-time events (typing, presence, message create). Bots must declare intents; GUILD_MEMBERS and MESSAGE_CONTENT are privileged and require approval.
  • Tokens — bot tokens are sent as Authorization: Bot <token>; user tokens (selfbots) are forbidden by ToS.
  • Librariesdiscord.js (Node), discord.py (revived after the 2021 hiatus), serenity-rs (Rust), JDA (Java).
  • Famous bots — MEE6, Dyno and Carl-bot all key their internal records by Snowflake.

FAQ

Can I decode a Discord ID? Yes — the upper 42 bits are a millisecond timestamp from the Discord epoch, so any tool can recover the exact creation time of a user, server or message.

Does the ID change if I rename or migrate to a global handle? No. The Snowflake is assigned at creation and is immutable, including across the 2023 username migration.

Are Discord IDs globally unique? Yes, across the entire Discord platform — users, guilds, channels and messages share the same Snowflake namespace and never collide.

Why do my IDs lose digits in JSON? Because JavaScript numbers are IEEE-754 doubles with only 53 bits of integer precision. Always treat Snowflakes as strings on the wire, or parse them with BigInt.

Related Tools