UUID & ULID Generator
Generate UUID v4, v7, v5 or v3, ULIDs and NanoIDs, and validate any UUID or ULID with the time inside it.
Generates UUIDs of version 4 (random), 7 (time-ordered), 5 and 3 (from a name), ULIDs and NanoIDs, up to 1,000 at a time, and checks whether a string is a well-formed UUID of any version or a ULID, reading the time inside UUID versions 1, 6 and 7 and inside a ULID.
Generation and validation run in your browser; nothing you generate or paste is sent anywhere. Random parts come from the browser's cryptographically secure generator, crypto.getRandomValues (crypto.randomUUID for version 4).
How to use it
- Generate — pick the ID type and how many (1 to 1,000). Uppercase and Remove hyphens change a UUID's format only. Regenerate makes a new batch; Copy copies all of them, one per line.
- UUID v5 and v3 — choose a namespace (DNS, URL, OID, X.500, or any UUID of your own) and type names, one per line; each name's UUID appears on the same line, and a blank line stays blank. Names are used exactly as typed, spaces included, as UTF-8.
- ULID — a batch shares the current millisecond, so each ULID after the first adds one to the random part of the one before, as the ULID spec's monotonic mode does, and the batch sorts in the order made. Should the random part run out within one millisecond, generation stops with an error rather than wrap around.
- NanoID — an alphabet (URL-safe by default, or letters and digits, lowercase and digits, hex, digits, or your own characters) and a length from 2 to 256, 21 by default. Below the output, the tool says how many bits each ID holds and after how many IDs the chance of a repeat reaches 1%.
- Validate — paste one UUID or ULID. The result shows whether it is valid, with a UUID's version and variant, the time it was made for UUID versions 1, 6 and 7 and for a ULID, in UTC and as Unix milliseconds, a ULID's 128 bits written as a UUID, and the standard form when it is written another way; or the first problem found.
The validator accepts the hyphenated form or 32 digits without hyphens, in either case, optionally in braces or after urn:uuid:. The nil UUID (all zeros) and max UUID (all f) are valid and have no version. UUIDs of other variants, such as Microsoft's reserved one, are valid without a version; for the RFC 9562 variant, versions 0 and 9 to 15 are undefined and reported as invalid. A ULID is 26 characters of Crockford's Base32 in either case; I, L, O and U are not in its alphabet, and one starting above 7 would hold more than 128 bits, so both are refused.
Which ID to use
Version 4 is 122 random bits from your browser's cryptographically secure generator; the rest mark the version and variant.
Version 7, defined in RFC 9562, starts with the creation time in milliseconds, followed by a 12-bit counter that keeps UUIDs made in the same millisecond in order, then 62 random bits. Sorting version 7 UUIDs sorts them by creation time, which keeps database indexes compact.
Version 5 (SHA-1) and version 3 (MD5) hash a namespace and a name, so the same name in the same namespace gives the same UUID everywhere, with nothing stored. Use them to derive a stable ID from something that already names a thing, such as a domain or URL; prefer version 5. They are not secret: anyone with the name can compute the UUID.
ULID holds the same 128 bits as a UUID: 48 bits of Unix time in milliseconds, then 80 random bits, written as 26 characters that sort by time as text. NanoID is a short random string, with no time and no version bits; its length and alphabet set how unlikely a repeat is.
Use version 7 or a ULID for database keys and anything you sort; version 4 when an ID must not reveal when it was made; version 5 for an ID derived from a name; NanoID for short IDs in URLs.
Examples
Validating a UUID in braces
- UUID
- {550E8400-E29B-41D4-A716-446655440000}
- Version
- 4 (random)
- Variant
- RFC 9562
- Standard form
- 550e8400-e29b-41d4-a716-446655440000
A version 5 UUID from a domain name
- ID type
- UUID v5 (name, SHA-1)
- Namespace
- DNS
- Names
- www.example.com
- UUID
- 2ed6657d-e927-568b-95e1-2665a8aea6a2
This is RFC 9562's own example (Appendix A.4): any correct implementation gives the same UUID.
Reading the time inside a ULID
- ULID
- 01arz3ndektsv4rrffq69g5fav
- Created
- 30 July 2016, 23:54:10 UTC
- Unix time (ms)
- 1469922850259
- As a UUID
- 01563e3a-b5d3-d676-4c61-efb99302bd5b
- Standard form
- 01ARZ3NDEKTSV4RRFFQ69G5FAV
The first 10 characters are the time; ULIDs are written in capitals but read in either case.
How long a NanoID needs to be
With the URL-safe alphabet and a length of 10, each NanoID holds 60 bits, and a 1% chance of a repeat comes after about 150 million IDs. The default length of 21 gives 126 bits, the same chance coming after about 1.3 × 10¹⁸ IDs.
Uppercase without hyphens
- UUID
- 550e8400-e29b-41d4-a716-446655440000
- Formatted
- 550E8400E29B41D4A716446655440000
The same identifier, 32 characters instead of 36.
Layouts and examples
| Type | Layout | Sorts by time | Characters |
|---|---|---|---|
| UUID v4 | 122 random bits | No | 36 |
| UUID v7 | 48-bit Unix time in ms, 12-bit counter here, 62 random bits | Yes, by time | 36 |
| UUID v5 / v3 | SHA-1 / MD5 of namespace and name, cut to 122 bits | No | 36 |
| UUID v1 / v6 | 60-bit time in 100 ns steps from 1582, clock sequence, node | v6 only | 36 |
| ULID | 48-bit Unix time in ms, 80 random bits | Yes, by time | 26 |
| NanoID | Random characters from an alphabet; 21 of 64 by default | No | 21 |
| Example | Version | Kind | Created (UTC) |
|---|---|---|---|
c232ab00-9414-11ec-b3c8-9f6bdeced846 | 1 | time-based | 22 February 2022, 19:22:22 UTC |
5df41881-3aed-3515-88a7-2f4a814cf09e | 3 | name-based, MD5 | — |
919108f7-52d1-4320-9bac-f847db4148a8 | 4 | random | — |
2ed6657d-e927-568b-95e1-2665a8aea6a2 | 5 | name-based, SHA-1 | — |
1ec9414c-232a-6b00-b3c8-9f6bdeced846 | 6 | reordered time | 22 February 2022, 19:22:22 UTC |
017f22e2-79b0-7cc3-98c4-dc0c0c07398f | 7 | time-ordered | 22 February 2022, 19:22:22 UTC |
2489e9ad-2ee2-8e00-8ec9-32d5f69181c0 | 8 | custom | — |
Standards
UUIDs follow RFC 9562, which replaced RFC 4122 in 2024 and added versions 6, 7 and 8 and the max UUID. Versions 3 and 5 are checked against its Appendix A examples. ULIDs follow the ULID specification; NanoIDs draw characters as the NanoID library does, each equally likely.
Sources
- RFC 9562: Universally Unique IDentifiers (UUIDs) — IETF
- Universally Unique Lexicographically Sortable Identifier — ulid/spec
- Nano ID — ai/nanoid
Reviewed
Frequently asked questions
See also
- Password Generator — when you need a random secret rather than an identifier.
- Hash Generator — for an identifier derived from content, the same every time.