UUID generator
- Canonical form
-
017f22e2-79b0-7cc3-98c4-dc0c0c07398f - Version
- 7 (Unix time)
- Variant
- RFC 9562 (standard)
- Timestamp
- 02/22/2022, 19:22:22.000 (time zone UTC)
Everything runs in your browser; nothing is sent or stored.
- Choose version 4 (random) or version 7 (time-ordered).
- Choose how many UUIDs to generate, from 1 to 50. New UUIDs are generated whenever you change the version or the number, and when you click "Regenerate".
- Tick "Uppercase letters" or "Without hyphens" to change how the UUIDs are displayed.
- Copy a single UUID with the "Copy" button next to it, or copy all the UUIDs, one per line, with "Copy all".
- In the "Check a UUID" section, paste a UUID, with or without hyphens, in braces or with the urn:uuid: prefix, and click "Check".
What is a UUID
A UUID (Universally Unique Identifier) is a 128-bit number, written as 32 hexadecimal digits in five groups, in the 8-4-4-4-12 pattern. A UUID is created without coordinating with a server or a central registry, so it suits database keys, file names, and request and order IDs. The name GUID, common in Microsoft environments, describes the same structure. The first digit of the third group shows the version, and the first digit of the fourth group shows the variant. In a UUID that follows the RFC 9562 standard, the variant digit is 8, 9, a, or b.
Version 4 or version 7
In version 4, all the bits are chosen at random, except for the 6 version and variant bits. A version 7 UUID starts with a 48-bit Unix timestamp in milliseconds, so sorting the UUIDs puts them in order of creation. For UUIDs created in the same millisecond, the generator adds an incrementing counter, so the creation order is kept within the same millisecond too. A sorted primary key keeps the database index in order, because new records are added at the end of the index and not at random points. Version 4 suits cases where the creation time must not be revealed, because a version 7 UUID reveals its timestamp.
Other versions and special UUIDs
Version 1 is based on the time and on the MAC address of the computer that created the UUID, and version 6 reorders the time fields of version 1, so the UUIDs sort by time. Versions 3 and 5 are created from a hash of a namespace and a name, with MD5 and SHA-1 respectively, so the same name in the same namespace always produces the same UUID. Version 8 is reserved for a custom layout. The Nil UUID, with all bits set to 0, usually marks a value that has not been set, and the Max UUID, with all bits set to 1, marks an upper bound.
Examples
550e8400-e29b-41d4-a716-446655440000a version 4 UUID: the third group starts with the digit 4, and the fourth group starts with the variant digit a.550E8400E29B41D4A716446655440000the same UUID, in uppercase and without hyphens.{550e8400-e29b-41d4-a716-446655440000}the same UUID in braces, the usual way to write a GUID.urn:uuid:550e8400-e29b-41d4-a716-446655440000the same UUID in URN form.017f22e2-79b0-7cc3-98c4-dc0c0c07398fa version 7 UUID from the examples in the standard, with the timestamp February 22, 2022, 19:22:22 (UTC).c232ab00-9414-11ec-b3c8-9f6bdeced846a version 1 UUID from the examples in the standard, with the same timestamp.00000000-0000-0000-0000-000000000000the Nil UUID.ffffffff-ffff-ffff-ffff-ffffffffffffthe Max UUID.
UUID generator FAQ
Can two UUIDs ever be the same?
The chance that two version 4 UUIDs are the same is negligible, because every UUID contains 122 random bits. To reach a 50% chance of two identical UUIDs, you would need about 2.7 billion billion UUIDs. The generator picks the random bits from a cryptographic source of randomness, so the next UUIDs cannot be predicted.
Is there a difference between an uppercase and a lowercase UUID?
The value of a UUID is the same in both forms, and removing the hyphens does not change the value either. The canonical form of a UUID is written in lowercase. In systems that compare UUIDs as text, it is best to keep one consistent form, so that two spellings of the same UUID are not treated as two different UUIDs.
Can I tell when a UUID was created?
The creation time is known only for version 1, 6, and 7 UUIDs, which include a timestamp. The UUID check shows the timestamp down to the millisecond, in the time zone of your device. A version 4 UUID has no timestamp, so it holds no information about when it was created.
Why does the check say the UUID is not valid?
The message appears when the UUID does not contain exactly 32 hexadecimal digits, that is, only digits and the letters a to f, for example when a digit is missing, when an extra character was added, or when a letter such as g appears. The hyphens must appear in all four positions of the 8-4-4-4-12 pattern, or not at all.
Why does the check show no version for a valid UUID?
A version is defined only in the standard RFC 9562 variant. For UUIDs of other variants, reserved for backward compatibility or for future use, the check shows the canonical form and the variant, without a version. For the Nil UUID and the Max UUID, the check shows the canonical form without a version or a variant.
Can I use a UUID as a password or an access token?
A UUID is not suitable as a password, because it is meant to identify a record, not to serve as a secret, and it usually appears in URLs and log files. For a password or an access token, use a long random value created for that purpose, for example with a password generator.