How to generate UUIDs
- Enter how many you need from 1 to 1000.
- Pick v4 for random IDs or v7 for database keys.
- Choose a format such as standard, uppercase or quoted.
- Press Generate to create the list.
- Copy them all or download a text file.
What this UUID generator gives you
- Version 4 UUIDs with the correct version and variant bits.
- Version 7 IDs with a timestamp up front so they sort by time.
- The nil UUID for an explicit empty value.
- Five formats including a quoted list ready for code.
- Secure randomness from the browser and never Math.random.
- Up to a thousand IDs with one press.
What is a UUID?
A UUID is a 128 bit number. People write it as 32 hex digits in five groups. Any program can make one at any time. It needs no central server to hand out numbers. The chance of two matching is small enough to ignore.
How small is it? A version 4 UUID has 122 random bits. You would need about 2.7 quintillion of them for a 50 percent chance of one match. Make a billion every second and that takes about 85 years. In practice collisions do not happen.
Version 4 or version 7?
| Version | How it works | Best for |
|---|---|---|
| v4 | Fully random | Session IDs, tokens and public links |
| v7 | Timestamp first then random bits | Database primary keys |
| Nil | All zeros | An explicit empty value |
Version 4 is fully random. That is perfect for anything people should not guess. It causes trouble in databases though. Each random key lands in a random spot in the index. Writes scatter across the whole structure. On a big table inserts slow down and the index swells.
Version 7 fixes this. It puts a millisecond timestamp in the first bits. New IDs always sort after old ones. They append to the end of the index like a counting number. They stay unique across the world. Do you need a primary key type today? Version 7 is usually the better pick. Check that your database supports it first.
Why the random source matters
This point matters more than most people think. IDs made with Math.random are predictable. That function is not cryptographic. An attacker who sees enough output can work out its state. Then they can predict the next values. For session tokens that is a total breach.
This UUID generator uses the browser crypto API. It draws on the random pool of your operating system. A status line shows which source the tool used. It warns you if the tool had to use a fallback.
Which format should you pick?
- Standard lowercase: the normal form that almost every system expects.
- Uppercase: needed by some Microsoft tools and older Windows APIs.
- No hyphens: saves four characters where space is tight.
- Braces: the Windows registry and COM style.
- Quoted with commas: ready to paste into an array or a SQL IN clause.
Each format holds the same 128 bit value. A system that stores UUIDs as binary treats them all the same.
How to read a UUID
Look at a sample such as 550e8400-e29b-41d4-a716-446655440000. The first digit of the third group shows the version. Here it reads 4.
The first digit of the fourth group shows the variant. Standard UUIDs show 8 or 9 there. They may also show a or b. Every other digit in a version 4 ID is random. In a version 7 ID the first twelve digits hold the time.
Common UUID generator questions
Can I sort version 4 UUIDs by date?
No. They hold no time data. Use version 7 if order matters.
Can a UUID reveal personal data?
Version 4 holds only random bits. Version 7 reveals the time someone created it. Keep that in mind for public IDs.
Tips for using UUIDs well
- Store UUIDs in a native UUID column when your database has one.
- Use version 7 for new tables with heavy inserts.
- Keep one format across your whole project.
- Never build your own random IDs from Math.random.
Who uses a UUID generator?
Developers seed test data. Database admins create keys. QA testers build fixtures. Game makers tag items. Students learn how unique IDs work.
Your IDs stay private
Your browser creates every ID. No server sees or stores them. Need a strong secret instead? Use the password generator. Want plain random numbers? Try the random number generator. Want to read the time inside a v7 ID? The timestamp converter helps.