UUID Generator & Decoder
Create UUIDs (v4, v7, v1, v6, v5, v3), ULIDs, KSUIDs and TypeIDs in bulk, or paste any ID to read its version and timestamp.
Generate
Click any ID to copy.
Decode
Formats compared
| Format | Length | Embedded time | Sorts by time | Typical use |
|---|---|---|---|---|
| UUID v4 | 36 | None | No | General random IDs |
| UUID v7 | 36 | Unix ms | Yes | Database primary keys |
| UUID v1 | 36 | 100 ns since 1582 | No | Older systems, Cassandra timeuuid |
| UUID v6 | 36 | 100 ns since 1582 | Yes | Upgrading from v1 |
| UUID v5, v3 | 36 | None | No | Stable IDs derived from names |
| ULID | 26 | Unix ms | Yes | Short sortable IDs |
| KSUID | 27 | Seconds since 2014 | Yes | Events and logs |
| TypeID | Prefix + 27 | Unix ms | Yes, per prefix | API IDs naming their type |
About UUIDs, ULIDs, KSUIDs and TypeIDs
A UUID (universally unique identifier), called a GUID in Microsoft software, is a 128-bit number written as
32 hexadecimal digits in five groups, such as 017f22e2-79b0-7cc3-98c4-dc0c0c07398f. Any system
creates UUIDs on its own, without asking a central server for the next number, and the odds of two matching
values are small enough to ignore. RFC 9562, published in 2024, defines the current versions and replaces
RFC 4122. The 13th hex digit holds the version and the 17th digit holds the variant, which is how the
decoder above tells the versions apart.
UUID versions
Version 4 fills 122 bits with random data and is the most common choice. Version 7 starts with a 48-bit Unix timestamp in milliseconds followed by random bits, so newer IDs sort after older ones. Version 1 combines a 60-bit timestamp, counted in 100-nanosecond steps since 15 October 1582, with a clock sequence and a node ID, originally the MAC address of the machine. Version 6 stores the same fields as version 1 in a different order, so the values sort by time. Versions 3 and 5 hash a namespace UUID and a name with MD5 or SHA-1, and the same input always gives the same UUID. Version 2 belongs to DCE Security and rarely shows up, and version 8 leaves the layout to the application. The nil UUID (all zeros) and the max UUID (all ones) are special values for "no ID" and "upper bound".
Version 4 or version 7 for database keys
A B-tree index, the default in PostgreSQL, MySQL and SQL Server, keeps keys in sorted order. Random version 4 keys land anywhere in the index, so each insert touches a different page, the cache holds less of the working set and pages split often. Version 7 keys arrive in roughly increasing order and get appended at the end of the index, much like an auto-increment integer, which keeps writes fast and the index compact. Version 7 also reveals the creation time to anyone who sees the ID. For public identifiers where the creation time is private, version 4 is the safer option.
ULID, KSUID and TypeID
A ULID holds the same kind of data as a UUIDv7, a 48-bit millisecond timestamp and 80 random bits, and
writes the value as 26 characters of Crockford base32. The alphabet leaves out I, L, O and U, so ULIDs are
case-insensitive and easy to read aloud. A KSUID, designed at Segment, is 160 bits long: a 32-bit timestamp
in seconds since 13 May 2014 followed by 128 random bits, written as 27 base62 characters. KSUIDs sort by
time to the second. A TypeID, from Jetify, puts a type prefix in front of a UUIDv7 encoded in lowercase
base32, as in user_01h455vb4pex5vsknk084sn02q, so a log line or URL shows what kind of object
an ID points to. Every TypeID converts back to a standard UUID for storage.
How likely is a collision?
A version 4 UUID has 122 random bits, or about 5.3 × 1036 possible values. By the birthday problem, a 50% chance of a single duplicate takes about 2.7 × 1018 UUIDs, the output of one billion UUIDs per second for 86 years. Time-based formats only compete for uniqueness within the same millisecond or second. In each millisecond a version 7 UUID from this page carries a 12-bit counter and 62 random bits, a ULID carries 80 random bits, and a KSUID carries 128 random bits per second. Real collisions trace back to faulty random number generators or cloned virtual machines rather than to the odds.
Privacy
Every ID on this page is generated and decoded in the browser with the Web Crypto API. Names, namespaces and pasted IDs stay on the device and never reach a server.