discord-is.fun
ReferenceFormatting & media

Snowflakes

How Discord ids are built, with a decoder for timestamps.

9 entries Snowflakes
9 / 9

Bit layout 4

FieldBitsSizeExtractNotes
Timestamp63 to 2242 bits(snowflake >> 22) + 1420070400000Milliseconds since Discord Epoch, the first second of 2015 or 1420070400000.
Internal worker ID21 to 175 bits(snowflake & 0x3E0000) >> 17
Internal process ID16 to 125 bits(snowflake & 0x1F000) >> 12
Increment11 to 012 bitssnowflake & 0xFFFFor every ID that is generated on that process, this number is incremented

Handy values 5

WhatValueNotes
Discord epoch1420070400000First second of 2015 in Unix milliseconds.
Timestamp from id(id >> 22) + 1420070400000Milliseconds since Unix epoch. Use BigInt, ids exceed 2^53.
Id from timestamp(ms - 1420070400000) << 22Lowest possible id for a moment; handy for before/after pagination.
SerializationstringIds are always sent as strings in JSON to avoid precision loss.
Default avatar index(user_id >> 22) % 6For migrated usernames. Legacy discriminator users use discriminator % 5.
↑ ↓ navigate↵ open> commands/ focus filter

Appearance

Theme

Accent colour

Font

Density

Corners

Motion

Sidebar

Keyboard shortcuts

CtrlK
Search everything
>
In search: run a command (theme, density, copy URL…)
/
Filter the current list
W
Watch the current page
JK
Older, newer build (Shift: with notes)
[
Collapse or expand the sidebar
,
Appearance
?
Keyboard shortcuts
Esc
Close

Press G and then a letter to jump straight to a page

Overview

D
Dashboard
A
Activity
J
This week
Z
Daily digests
N
News
W
Watchlist
U
Status

Client

B
Builds
X
Compare builds
S
Strings
L
Client flags
M
Mobile builds
I
Release stats

Experiments & rollouts

E
Experiments
R
Rollouts

Developer API

C
API changelog
H
OpenAPI changes
Y
Endpoints
Q
Upcoming
P
API routes

Platform

V
Versions
K
Stickers
G
Games

Data & tools

T
Tools
F
Reference
O
Feeds & data

Keyboard shortcuts

CtrlK
Search everything
>
In search: run a command (theme, density, copy URL…)
/
Filter the current list
W
Watch the current page
JK
Older, newer build (Shift: with notes)
[
Collapse or expand the sidebar
,
Appearance
?
Keyboard shortcuts
Esc
Close

Press G and then a letter to jump straight to a page

Overview

D
Dashboard
A
Activity
J
This week
Z
Daily digests
N
News
W
Watchlist
U
Status

Client

B
Builds
X
Compare builds
S
Strings
L
Client flags
M
Mobile builds
I
Release stats

Experiments & rollouts

E
Experiments
R
Rollouts

Developer API

C
API changelog
H
OpenAPI changes
Y
Endpoints
Q
Upcoming
P
API routes

Platform

V
Versions
K
Stickers
G
Games

Data & tools

T
Tools
F
Reference
O
Feeds & data