System Designexplorer

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.

UUID version 7

Its timestamp reads 2022-02-22 19:22:22.000 UTC.

Bits1285 fields
TypeUUID version 7128 bits · 017f22e2-79b0-7cc3-98c4-dc0c0c07398f
Timestamp (UTC)2022-02-22T19:22:22.000Z1,645,557,742,000 ms since 1 January 1970
Each row is 64 bits, most significant bit on the left. The numbers match the table below.

Your ID

Hyphens, braces and the urn:uuid: prefix are fine. A number of up to 20 digits is read as a Snowflake.

Generate an example

Used only for numeric IDs. A Snowflake stores milliseconds since an epoch the service picks.

Fields

Fields of the decoded ID, most significant first
#FieldKindBitsValueMeaning
1unix_ts_msTime48017f22e279b0Unix time in milliseconds
2verVersion47Version 7
3rand_aRandom12cc3Random, or a counter for ordering within a millisecond
4varVariant210RFC 9562 (10xx)
5rand_bRandom6218c4dc0c0c07398fRandom, 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

Your first senior-level
lesson is free.

Choose a course, open a free lesson, and explore an idea you’ve wanted to understand.