UUID Generator
Private: generated on your device, never sent anywhere
Generate one UUID or a thousand, as random v4 or time ordered v7, in whichever format your code wants. There is also a checker: paste an ID and find out whether it is valid and which version it is.
About UUIDs
A UUID is a 128 bit identifier written as 32 hex characters in five groups. The point of it is that anything can mint one at any time, with no central counter and no coordination, and still be safe in the assumption that nobody else will ever produce the same value. That is what makes them useful for database keys, file names, request IDs and anything generated offline or on several machines at once.
Version 4 is 122 random bits, which is the version almost everyone means when they say UUID. Version 7 is newer: it starts with a millisecond timestamp and fills the rest with randomness, so the IDs sort by the time they were created. That single property makes a real difference to database write performance, because inserts land at the end of the index instead of scattering across it.
The format is cosmetic; the storage is not. Uppercase, lowercase, braces and the hyphens all carry the same 128 bits, and the standard asks for lowercase on the way out while requiring that comparison ignore case, which is why the other forms are offered here without pretending they are different IDs. Storage is where the choice costs something: written as text a UUID is 36 characters, against the 16 bytes it actually is, so a table keyed on a text column carries more than twice the key in its primary index and in every foreign key pointing at it. Postgres has a native uuid type and MySQL has BINARY(16), and picking one is much cheaper before the table is large than after.
One thing a UUID is often asked to do and should not. A v4 from this page carries 122 bits out of your browser's cryptographic generator, which is ample entropy for a bearer token, but an identifier and a secret want opposite things: an ID gets logged, put in URLs and quoted in support tickets. If you need a secret, the password generator gives you the same quality of randomness in a shorter string that nobody will mistake for a record ID.
How to generate a UUID
- Pick the Version: v4 for a plain random ID, v7 if the order matters.
- Pick a Format: lowercase is standard, but some systems want uppercase, no hyphens or braces.
- Set How many, up to a thousand, for seeding test data.
- Press Copy to take the whole list, one per line.
- Paste any ID into Check a UUID to confirm it is valid and see which version it is.
Common questions about UUIDs
Are these generated on a server?
Can two UUIDs ever collide?
Math.random.
Should I use v4 or v7?
Why does my UUID have a 4 in the middle?
What is the nil UUID?
Next