UUID & Token Generator
Generate secure UUIDs (v4) and random API tokens.
What is a UUID?
A Universally Unique Identifier (UUID) is a 128-bit number used to identify information in computer systems. UUID v4 is particularly common as it is generated purely from random numbers.
How to use the UUID generator
- Choose what to generate: UUID v4, a 32-character token or a 64-character token.
- Set the quantity (up to 50 at a time).
- Press Generate and copy any value with its copy button.
What is a UUID v4?
A UUID (Universally Unique Identifier) is a 128-bit value written as 32 hexadecimal digits in five groups, for example 3f2b8c1e-7a4d-4f6b-9c0e-2d5a8b7e1f34. Version 4 UUIDs are random: 122 of the 128 bits come from a random source, and the rest mark the version (the 4 at the start of the third group) and variant. They are defined in RFC 9562 (which replaced RFC 4122).
With 2122 possible values, the chance of two randomly generated UUIDs colliding is negligible. You would need to generate around a billion UUIDs per second for about 85 years to reach a 50% chance of one duplicate. That is why systems can create IDs independently without asking a central database.
UUIDs vs random tokens
| UUID v4 | 32/64-char token | |
|---|---|---|
| Characters | 0–9, a–f and hyphens | A–Z, a–z, 0–9 |
| Randomness | 122 bits | ≈ 190 bits (32 chars) / ≈ 381 bits (64 chars) |
| Best for | Database keys, request and file IDs | API keys, session secrets, password-reset links, invite codes |
Use a UUID when you need a standard identifier that other software understands. Use a token when the value is a secret that must be hard to guess.
Developer notes
- Values are generated with
crypto.getRandomValues, a cryptographically secure source. - Random UUIDs scatter inserts across a B-tree index. If insert performance matters, consider time-ordered UUID v7 for primary keys.
- Treat tokens like passwords: store a hash of API keys server-side, not the key itself.