Unique ID decoder
Most IDs are more than a label. A UUID version 7, a ULID and a Snowflake ID all start with a timestamp, so they sort roughly by creation time and you can read when they were made. A UUID version 4 is almost all random bits and tells you nothing.
Its timestamp reads 2022-02-22 19:22:22.000 UTC.
Your ID
Hyphens, braces and the urn:uuid: prefix are fine. A number of up to 20 digits is read as a Snowflake.
Used only for numeric IDs. A Snowflake stores milliseconds since an epoch the service picks.
Fields
| # | Field | Kind | Bits | Value | Meaning |
|---|---|---|---|---|---|
| 1 | unix_ts_ms | Time | 48 | 017f22e279b0 | Unix time in milliseconds |
| 2 | ver | Version | 4 | 7 | Version 7 |
| 3 | rand_a | Random | 12 | cc3 | Random, or a counter for ordering within a millisecond |
| 4 | var | Variant | 2 | 10 | RFC 9562 (10xx) |
| 5 | rand_b | Random | 62 | 18c4dc0c0c07398f | Random, or part of a counter |
- Version
- 7
- Variant
- RFC 9562 (10xx)
- Timestamp (48 bits)
- 1645557742000 ms since 1970-01-01T00:00:00Z
- Random bits
- 74 (rand_a 12 + rand_b 62)
What it shows
UUID version 7, ULID and Snowflake IDs start with a timestamp, so you can read when they were made. A UUID version 4 is almost all random bits.
Paste an ID to see its type, its fields and a bit-layout diagram. A Snowflake stores milliseconds since an epoch the service chooses, so presets cover Twitter and Discord, and you can set your own.
How to read it
- Type and timestamp come first. Times are ISO 8601 in UTC, read from the ID, so they are the clock of the machine that made it.
- The diagram draws every bit in rows of 64. Each box has a number matching a row in the table. Dashed edges continue a field from the row above.
- The table lists each field’s width in bits, its value (hex for binary fields, decimal for counters) and its meaning.
- A Snowflake’s top 42 bits are read as time. Twitter’s layout leaves the very top bit unused, so for real IDs it is always 0.
- The example buttons make a fresh ID of each kind in your browser.
Questions
Can I tell when a UUID version 4 was created?
No. Version 4 uses 122 random bits and 6 fixed bits for the version and variant. There is no timestamp to read.
Why do version 6 and 7 UUIDs sort by time but version 1 does not?
Version 1 stores the low 32 bits of its timestamp first, so IDs made a moment apart can sort far apart. Version 6 holds the same timestamp with the high bits first, and version 7 uses a plain Unix millisecond count at the front, so both sort by creation time.
How do I know which epoch a Snowflake uses?
You can’t tell from the number. The epoch belongs to the service that issued it, so you need its documentation. If the decoded year looks wrong, such as 1970 or 2090, try a different epoch.
Can I trust the timestamp inside an ID?
Only as far as you trust the clock that wrote it. The time comes from the generating machine, which may have been skewed, and anyone who can choose an ID can put any time in it. Treat it as a hint, not a record.
Learn it properly
Sources
Last updated
More tools
All tools- estimatorBack-of-envelope estimatorTurn daily users into requests per second, storage and bandwidth, with the working shown.Open tool
- simulatorConsistent hashing simulatorA hash ring with virtual nodes: key spread per node, and how many keys move when the cluster changes.Open tool
- estimatorQueue latency estimatorWhy latency explodes as servers get busy: utilisation, waiting time and Little’s law.Open tool