UUID Generator
How many
Your UUID
Generating a UUID…
You may also need
More Utilities tools- Developer
Password Generator
Strong random passwords generated on your device.
- Developer
Base64 Encoder / Decoder
Encode and decode Base64 text, UTF-8 safe.
- Developer
JSON Formatter
Format, validate and minify JSON with exact error lines.
- Developer
URL Encoder / Decoder
Percent-encode and decode URLs and query strings.
- Text
Text Diff Checker
Compare two texts privately in-browser with side-by-side diffs.
How to generate Version 4 UUIDs online
- A new UUID appears as soon as the page opens. Choose how many you need: 1, 5, 10, 25, 50 or 100.
- Switch to uppercase or remove the hyphens if the system you're pasting into expects that.
- Copy the result, select Generate for a fresh set, or Clear to empty the result.
Examples
- A primary key or record ID for a database row created outside the application, such as a fixture or a migration.
- Test data: 50 unique IDs for a spreadsheet or a JSON file. Check the file afterwards with the JSON Formatter.
- An idempotency key or correlation ID for an API request you are testing by hand.
What a version 4 UUID is
A UUID (universally unique identifier, also called a GUID) is a 128-bit value written as 32 hexadecimal digits in five groups, for example 3f0c2b7e-9a41-4c7d-8e2f-5b6a1d9c0e44. Version 4 UUIDs are random: 122 of the 128 bits are random, the rest mark the version (the 4 at the start of the third group) and the variant (8, 9, a or b at the start of the fourth group).
How unique are they?
With 122 random bits there are about 5.3 × 1036 possible values. You would need to generate around 2.7 × 1018 UUIDs before a single duplicate became even 50% likely, so in practice every UUID is unique.
How they are generated here
The tool uses the browser’s crypto.randomUUID(), which draws from the operating system’s secure random generator. Where that function isn’t available, the same format is built from crypto.getRandomValues(). Nothing is generated on a server.
Need to compare generated UUID lists or find duplicate IDs? Use our Text Diff Checker. You can also format JSON payloads containing UUID primary keys with our JSON Formatter, or encode identifiers into Base64 tokens using Base64 Encode / Decode.
RFC 4122 UUID Version Comparison Reference
| UUID Version | Generation Mechanism | Predictability | Primary Application |
|---|---|---|---|
| Version 1 | Timestamp + Host MAC Address | Predictable (leaks time and MAC) | Legacy distributed systems |
| Version 4 (This Tool) | Cryptographically Secure Pseudo-Random (CSPRNG) | Completely Unpredictable (122 random bits) | Modern database primary keys, session tokens, API request IDs |
| Version 5 | Namespace + Name (SHA-1 Hash) | Deterministic (same name yields same UUID) | Consistent resource addressing without central state |
| Version 7 | Unix Epoch Timestamp + Random Bits | Time-ordered random | High-throughput database B-tree clustering |
Database Performance: Storing UUIDs as Primary Keys
When using Version 4 UUIDs as relational database primary keys (PostgreSQL, MySQL, SQLite):
- Binary vs. String Storage: Store UUIDs as native 16-byte binary types (e.g., PostgreSQL’s native
uuidtype, orBINARY(16)in MySQL) rather than 36-character text strings. This halves index size and significantly speeds up join performance. - B-Tree Fragmentation Considerations: Because Version 4 UUIDs are uniformly distributed and non-sequential, high-volume inserts into clustered primary key indexes can cause B-tree page splits. For write-heavy telemetry workloads with millions of rows per hour, consider UUIDv7 or combine a sequential auto-incrementing ID for internal clustering with a public-facing UUIDv4.
Frequently asked questions
Is a UUID the same as a GUID?
Yes. GUID (Globally Unique Identifier) is Microsoft’s nomenclature for the same 128-bit RFC 4122 format. A version 4 UUID is a valid GUID.
Are UUIDs case-sensitive?
No. The standard canonical representation defined in RFC 4122 uses lowercase hexadecimal digits. However, uppercase is mathematically equivalent and commonly preferred in legacy Microsoft Windows enterprise systems.
What is the collision probability of Version 4 UUIDs?
Version 4 UUIDs contain 122 bits of true entropy ($2^122 \approx 5.3 \times 10^36$ values). To achieve a 1 in a billion chance of a collision, you would need to generate over 103 trillion UUIDs.
Can I use these UUIDs as secret authentication keys?
While completely unpredictable, UUIDs are intended as public resource identifiers and often appear in server URLs, database logs, and request headers. For cryptographic secrets or passwords, use our Password Generator.
Newsletter
Get new tools by email
Occasional emails when we add useful tools or improve existing ones. Optional: every tool stays free without it.
Last updated