UUID Generator
Generate UUID v4, UUID v7, ULID, and Nano ID. Bulk generation, format options, and UUID parsing. All client-side.
UUID vs ULID vs Nano ID -- Comparison
| Feature | UUID v4 | UUID v7 | ULID | Nano ID |
|---|---|---|---|---|
| Length | 36 chars | 36 chars | 26 chars | 21 chars (default) |
| Bits | 128-bit | 128-bit | 128-bit | 126-bit (21 chars) |
| Sortable | No | Yes | Yes | No |
| Timestamp | No | Unix ms (48-bit) | Unix ms (48-bit) | No |
| Encoding | Hex + hyphens | Hex + hyphens | Crockford Base32 | URL-safe Base64 |
| Standard | RFC 9562 | RFC 9562 | Community spec | Community spec |
| DB Friendly | Good | Excellent | Excellent | Good |
When to Use Which ID Format
UUID v4
Best for general-purpose unique identifiers. Universally supported across databases, APIs, and languages. Use when you do not need time-ordering or sortability. The de facto standard for distributed systems.
UUID v7
Best for database primary keys. Embeds a Unix timestamp for natural chronological sorting. Reduces B-tree index fragmentation compared to UUID v4. Part of the new RFC 9562 standard (2024).
ULID
Best when you need a shorter, sortable ID. 26 characters using Crockford Base32 encoding. Lexicographically sortable and contains a millisecond timestamp. Ideal for event logs, time-series data, and distributed systems.
Nano ID
Best for URL-friendly short IDs. Configurable length and alphabet. Compact (21 chars default) yet collision-resistant. Perfect for short URLs, session tokens, file names, and user-facing identifiers.
Frequently Asked Questions
Is this tool secure? Is my data sent to a server?
All ID generation happens entirely in your browser using the Web Crypto API and JavaScript libraries. No data is sent to any server. The generated IDs are created locally using cryptographically secure random number generators.
What is the difference between UUID v4 and UUID v7?
UUID v4 is purely random (122 random bits), making it unpredictable but unsortable. UUID v7 embeds a Unix timestamp in the first 48 bits, making it chronologically sortable while still being unique. UUID v7 is better for database primary keys because it reduces index fragmentation.
Can UUID v4 values collide?
The probability is astronomically low. With 122 random bits, you would need to generate about 2.71 quintillion UUIDs to have a 50% chance of a single collision. In practice, UUID v4 collisions are considered impossible for all real-world applications.
Why should I use UUID v7 over UUID v4 for databases?
UUID v4 values are random, causing B-tree indexes to fragment as new records scatter across the tree. UUID v7 values are time-ordered, so new records are appended near the end of the index, improving write performance and reducing page splits.
What is ULID and how does it compare to UUID?
ULID (Universally Unique Lexicographically Sortable Identifier) is a 128-bit identifier encoded as 26 Crockford Base32 characters. It is shorter than UUID (26 vs 36 chars), lexicographically sortable, and contains a millisecond timestamp. It is not an IETF standard but is widely used in modern applications.
Related Tools
Format, validate, and beautify JSON with tree view and TypeScript type generation.
Test regular expressions with real-time matching, capture groups, and code snippets.
Encode and decode text, images, and files to Base64 with real-time conversion.
Decode, inspect, and verify JWT tokens with claim explanations and expiration check.