What is a UUID
UUID and GUID explained
A UUID (Universally Unique Identifier) is a 128-bit value written as 32 hexadecimal characters in five groups, for example 550e8400-e29b-41d4-a716-446655440000. A GUID (Globally Unique Identifier) is Microsoft's name for exactly the same thing, so this tool works as a GUID generator too. Tick Braces and UPPERCASE to get the classic Windows registry style {550E8400-E29B-41D4-A716-446655440000}.
UUIDs let different systems create identifiers independently without asking a central database for the next number. That is why they are used as primary keys, file names, message IDs, API request IDs and device identifiers. The format is defined in RFC 9562, which replaced the older RFC 4122 in 2024 and added versions 6, 7 and 8.
The 13th hex digit tells you the version and the 17th digit tells you the variant. In 550e8400-e29b-41d4-a716-..., the 4 means version 4 and the a means the standard RFC variant.
UUID versions
Which UUID version should you use?
| Version | How it is made | Best for |
| v4 | 122 random bits | General purpose IDs, tokens, anything that does not need ordering. The safe default. |
| v7 | 48-bit Unix millisecond timestamp, then random bits | Database primary keys. New rows land at the end of the index, which keeps inserts fast in PostgreSQL, MySQL and SQL Server. |
| v1 | 100-nanosecond timestamp, clock sequence and node | Legacy systems that expect v1. This generator uses a random node instead of your MAC address. |
| v5 | SHA-1 hash of a namespace plus a name | Stable IDs derived from data, such as one UUID per domain or email address. |
| v3 | MD5 hash of a namespace plus a name | Compatibility with older systems. Prefer v5 for new work. |
| Nil / Max | All zeros / all F | Placeholders and sentinel values. |
Random UUID v4 and collision risk
A random UUID v4 has 122 random bits. You would need to generate about 2.7 quintillion of them to reach a 50% chance of a single duplicate. Every v4 and v7 value here comes from PHP's random_bytes(), a cryptographically secure random number generator, so the output is suitable for production use.
Advertisement
UUID from a string
Generate a UUID v5 from a string
Sometimes you want the same input to always produce the same UUID. That is what name-based UUIDs do. Choose v5, pick a namespace and enter one name per line. www.example.com in the DNS namespace always gives 2ed6657d-e927-568b-95e1-2665a8aea6a2, in any language, on any machine.
- DNS namespace for domain names and hostnames.
- URL namespace for full URLs.
- OID and X.500 for object identifiers and directory names.
- Custom: use your own UUID as the namespace to keep your IDs separate from everyone else's.
Name-based UUIDs are deterministic, not secret. Anyone who knows the namespace and the name can recreate the UUID, so never use them as passwords or access tokens.
Formats
Bulk UUIDs in the format you need
This bulk UUID generator can format the whole list for the place it is going:
- UUID without dashes: 32 hex characters, common in URLs and some databases.
- Short UUID: the same 128 bits encoded in Base62 or Base58, only 22 characters. Base58 drops look-alike characters such as 0, O, I and l, which makes IDs easier to read aloud or type.
- JSON array for fixtures and seed files, SQL IN list for queries, CSV for spreadsheets, and URN (
urn:uuid:...) for XML and identifiers that need a scheme.
Validate and decode UUIDs
The Validate tab accepts UUIDs with or without dashes, braces or a urn:uuid: prefix. For each one you get the version, the variant and, for v1, v6 and v7, the date and time it was created. That is handy when you need to know when a record was made from its ID alone. Related tools: hash any value with the hash generator, or build fixtures with the JSON formatter.
FAQ
UUID Generator: frequently asked questions
What is a UUID generator?
A UUID generator creates 128-bit universally unique identifiers such as 550e8400-e29b-41d4-a716-446655440000. This one creates up to 5,000 at once in versions 4, 7, 1, 5 and 3, and can also validate and decode existing UUIDs.
Is a GUID the same as a UUID?
Yes. GUID is Microsoft's name for a UUID. The format and the 128-bit value are the same. Tick Braces and UPPERCASE to get the Windows style {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}.
Which UUID version should I use?
Use v4 for general random IDs. Use v7 for database primary keys because it sorts by creation time and keeps indexes efficient. Use v5 when the same input must always give the same UUID.
Can two random UUIDs ever be the same?
In theory yes, in practice no. A v4 UUID has 122 random bits, so you would need billions of billions of UUIDs before a collision becomes likely.
How do I generate a UUID from a string?
Choose v5 (or v3), select a namespace such as DNS or URL, and enter one string per line. Each string always produces the same UUID.
How do I get a UUID without dashes?
Tick Without dashes. You will get 32 hexadecimal characters such as 550e8400e29b41d4a716446655440000.
What is a short UUID?
A short UUID is the same 128-bit value written in Base62 or Base58 instead of hexadecimal, which shortens it from 36 to 22 characters without losing any uniqueness.
Are these UUIDs safe to use in production?
Yes. Random parts come from PHP random_bytes(), a cryptographically secure source, and the layout follows RFC 9562. Nothing is stored after the page is generated.