UUID Generator
Generate UUID v1/v3/v4/v5/v6/v7/v8, ULID, and NanoID — parser, bulk, and deep-link sharing. 100% private.
No options for this type.
What is a UUID?
A UUID (Universally Unique Identifier) is a 128-bit number used to uniquely identify information in distributed systems without central coordination. UUIDs are defined by RFC 9562 (2024), which supersedes RFC 4122 (2005).
A UUID is written as 32 hexadecimal characters in the 8-4-4-4-12 format like 01902e8c-5fa3-7b3f-b5de-8c5b8a2e7f1d. The 13th character encodes the version (1-8), and the 17th encodes the variant (the high bits of that hex digit). The remaining bits carry timestamp, namespace hash, random data, or custom fields depending on the version.
UUID Examples
Click any example to load it into the Parser tab and see the decomposition.
| Type | Description | Sample | Try |
|---|---|---|---|
| NIL UUID | Special all-zero UUID | 00000000-0000-... | |
| MAX UUID | Special all-one UUID | ffffffff-ffff-... | |
| v1 | Time-based (Gregorian 100ns) | c232ab00-9414-... | |
| v4 | Random (most common) | a1b2c3d4-e5f6-... | |
| v7 | Sortable (Unix ms + random) | 01902e8c-5fa3-... | |
| v5 (DNS) | SHA-1 namespace (DNS) | 2ed6657d-e927-... | |
| ULID | Crockford Base32, 26 chars | 01HNQ8K9XM... | |
| NanoID | URL-safe, compact (21 chars) | V1StGXR8_Z5jdHi... | |
| PostgreSQL | gen_random_uuid() output | 9f4eab3c-... | |
| Firestore | Firebase Firestore document ID | dBc8xQq2jK... |
UUID Versions Compared
This tool supports all modern identifier formats. Each has distinct properties:
| Type | Bits | Sortable? | Deterministic? | Time Exposed | Best For |
|---|---|---|---|---|---|
| v1 | 128 | No (byte-order) | No | Yes | Legacy systems |
| v2 | 128 | No | No | Yes | DCE Security (legacy) |
| v3 | 128 | No | Yes (MD5) | No | Stable IDs from names |
| v4 | 128 | No | No | No | Session/API tokens |
| v5 | 128 | No | Yes (SHA-1) | No | Stable IDs from names |
| v6 | 128 | Yes | No | Yes | v1 migration |
| v7 | 128 | Yes | No | Yes | DB primary keys |
| v8 | 128 | Custom | Custom | Custom | Experimental |
| ULID | 128 | Yes | No | Yes | Compact sortable IDs |
| NanoID | Variable | No | No | No | URL slugs, short IDs |
Common Use Cases
- Database primary keys — UUID v7 is ideal because time-ordered inserts align with B-tree index locality (2-10x faster vs v4).
- Session tokens / API keys — UUID v4 is the right choice; pure randomness means no timestamp leakage.
- URL slugs / short codes — NanoID with a custom length/alphabet produces compact URL-safe IDs.
- Distributed tracing IDs — UUID v7 or ULID provide both uniqueness and chronological ordering.
- Namespace-based IDs — v3 (MD5) or v5 (SHA-1) generate the same UUID for the same input, useful for deduplication.
- Event IDs — v7 or ULID let you sort events by creation time without separate timestamp columns.
Common UUID Errors and How to Fix Them
Invalid UUID format
Cause: The string is not 8-4-4-4-12 hex characters. Extra whitespace, missing dashes, or non-hex characters break parsers.
Fix: Trim the input and check for exactly 32 hex chars with dashes at positions 8, 12, 16, 20. This tool's Parser auto-strips whitespace and curly braces {} for .NET GUID compatibility.
Unknown UUID version
Cause: The 13th hex character is not in 1-8, so the version field is out of spec.
Fix: Verify the source UUID was generated correctly. Non-standard or corrupted UUIDs may have garbage in the version bits.
Invalid variant bits
Cause: The high 2 bits of the 17th hex char are not 10 (RFC 9562) — e.g., an Apple NSUUID with variant 110 (Microsoft).
Fix: Check the UUID's origin. RFC 9562 variants start with 8, 9, a, or b at that position.
Namespace UUID required
Cause: v3 or v5 selected without a namespace UUID and name.
Fix: Choose a standard namespace (DNS, URL, OID, X.500) or provide a valid custom UUID, then enter a name string.
Alphabet contains duplicates (NanoID)
Cause: Custom NanoID alphabet has repeated characters, which skews distribution.
Fix: Provide an alphabet with all unique characters. The tool rejects duplicates before generation.
UUID in Your Language
Every major language has UUID support either built-in or via a well-maintained library:
| Language | Package | v4 Example | v7 Note |
|---|---|---|---|
| Node.js | crypto (built-in) | crypto.randomUUID() | npm install uuid → v7() |
| Python | uuid (built-in) | uuid.uuid4() | Python 3.14+: uuid.uuid7() |
| Java | java.util.UUID | UUID.randomUUID() | com.github.f4b6a3:uuid-creator |
| Go | github.com/google/uuid | uuid.NewString() | uuid.NewV7() |
| .NET/C# | System | Guid.NewGuid() | UUIDNext NuGet package |
| PHP | ramsey/uuid | Uuid::uuid4() | Uuid::uuid7() |
| Ruby | SecureRandom (built-in) | SecureRandom.uuid | uuid7 gem |
How to Use This Tool
- Select a Type (v4, v7, v1, v3, v5, v6, v8, ULID, NanoID) in the Generator tab.
- Configure options if applicable (namespace + name for v3/v5, custom hex for v8, length + alphabet for NanoID).
- Set the Count (1-1,000) and click Generate.
- Use Copy All or download as CSV/JSON/TXT.
- Switch to the Parser tab to analyze any existing UUID or ULID — it shows version, variant, timestamp, and bit decomposition.
- For v1/v6/v7 results, click Open in Timestamp Decoder to convert the extracted timestamp across time zones.
UUID v4 vs UUID v7 vs ULID
| Aspect | UUID v4 | UUID v7 | ULID |
|---|---|---|---|
| Sortable by time | ❌ | ✅ | ✅ |
| DB insert performance | Poor (random scatter) | Excellent (sequential) | Excellent (sequential) |
| Random bits | 122 | 74 | 80 |
| Use case | Session tokens, API keys | DB primary keys (modern) | Compact sortable IDs |
| Browser/Node support | Native (crypto.randomUUID) | Library (uuid npm) | Library (ulid npm) |
Technical Reference
RFC 9562 bit layout for each UUID version (128 bits total):
| Version | Timestamp | Version | Variant | Random/Data | Other |
|---|---|---|---|---|---|
| v1 | 60-bit Gregorian 100ns | 4 | 2 | 14 clock_seq | 48 node |
| v3 | — | 4 | 2 | 122 MD5 hash | — |
| v4 | — | 4 | 2 | 122 random | — |
| v5 | — | 4 | 2 | 122 SHA-1 hash | — |
| v6 | 60-bit (reordered) | 4 | 2 | 14 clock_seq | 48 node |
| v7 | 48-bit Unix ms | 4 | 2 | 12 rand_a + 62 rand_b | — |
| v8 | Custom | 4 | 2 | 122 custom | — |
| ULID | 48-bit Unix ms | — | — | 80 random | Crockford Base32 (26 chars) |
| NanoID | — | — | — | Variable random | Custom alphabet + length |
Frequently Asked Questions
Is UUID v7 secure enough for session tokens?
No. UUID v7 embeds a Unix millisecond timestamp in the first 48 bits, which is predictable. For session tokens, API keys, or anything requiring unpredictability, use UUID v4 (fully random) or a dedicated CSPRNG-backed token.
What happened to UUID v2?
UUID v2 (DCE Security) is defined in the original spec but rarely used. Most modern libraries (Python uuid, Java UUID, Go google/uuid) do not implement it. This tool recognizes v2 in the Parser for debugging but does not generate v2 — it is essentially legacy.
Why did PostgreSQL 18 add uuidv7()?
UUID v7 is time-ordered, making it a much better primary key than v4. PostgreSQL 18 (released September 2025) added a native uuidv7() function because benchmarks consistently show 2-10x better INSERT performance with v7 due to sequential index writes.
Can I sort UUID v4 by creation time?
No. UUID v4 is fully random and has no time component. If you need time-ordered identifiers, use UUID v7, UUID v6, or ULID. These all embed a timestamp that makes them lexicographically sortable by creation time.
Is ULID better than UUID v7?
They solve the same problem (time-ordered IDs) but differ in format. ULID is 26 characters in Crockford Base32, more compact than UUID's 36 characters with dashes. UUID v7 is the RFC-standardized option with broader tooling support. Choose ULID for compactness, v7 for standards alignment.
How unique is NanoID compared to UUID?
Default NanoID (21 chars from a 64-char alphabet) has collision probability equivalent to UUID v4 — you would need ~149 quadrillion IDs to hit a 1% collision rate. Shorter NanoIDs are less unique; an 8-char ID from a 36-char alphabet hits 1% collision at ~370K IDs.
Can UUIDs collide?
In theory yes, but for UUID v4 the probability is astronomically small — about 1 in 2^122 for any two specific UUIDs. You would need to generate about 2.7 quintillion UUIDs to reach a 50% chance of collision. In practice, treat them as globally unique.
Are UUIDs really universally unique?
The "universally unique" guarantee comes from the 128-bit length and cryptographically strong randomness (v4) or timestamp + randomness (v7). As long as you use a proper CSPRNG, collision across the entire universe of generated UUIDs is negligibly small.
Is it safe to paste UUIDs here?
Yes. All processing happens entirely in your browser using JavaScript. Your data is never sent to any server. You can verify this by opening the Network tab in your browser's developer tools — no network requests are made after the page loads.
Why does Node.js crypto.randomUUID() only support v4?
crypto.randomUUID() is a standardized Web Crypto API method that specifically returns a v4 (random) UUID. For v7 and other versions, you need an external library like uuid on npm. Python's uuid module similarly defaults to v4 and added uuid7() only in Python 3.14.
Features
🆔 Multi-Version Generator
Generate v1, v3, v4, v5, v6, v7, v8, ULID, and NanoID from a single unified interface.
🔍 Parser & Visualizer
Paste any UUID to see the bit decomposition — version, variant, timestamp, and random segments color-coded.
📦 Bulk Generation
Generate up to 1,000 IDs at once and download as CSV, JSON, or TXT for test data or migrations.
💻 Code Snippets
Copy ready-to-use UUID generation code for Node.js, Python, Java, Go, .NET, PHP, and Ruby.
🔗 URL Deep-links
Share tool state via URL: ?type=v7&count=100 or ?action=parse&uuid=....
🔒 100% Private
All generation happens in your browser. No data is ever sent to any server. Safe for production.
Privacy & Security
This tool processes everything locally using the Web Crypto API (crypto.randomUUID, crypto.getRandomValues, crypto.subtle.digest). Nothing is sent to any server. You can verify via the Network tab in developer tools. For security-sensitive use cases like session tokens or API keys, prefer UUID v4 (fully random); avoid v1/v6/v7 which expose creation time.