UUID Generator

Generate UUID v4, UUID v7, ULID, and Nano ID. Bulk generation, format options, and UUID parsing. All client-side.

Ctrl+Enter to generate
Options
Generated UUID v4
0 IDs
Click "Generate" to create IDs.

UUID vs ULID vs Nano ID -- Comparison

FeatureUUID v4UUID v7ULIDNano ID
Length36 chars36 chars26 chars21 chars (default)
Bits128-bit128-bit128-bit126-bit (21 chars)
SortableNoYesYesNo
TimestampNoUnix ms (48-bit)Unix ms (48-bit)No
EncodingHex + hyphensHex + hyphensCrockford Base32URL-safe Base64
StandardRFC 9562RFC 9562Community specCommunity spec
DB FriendlyGoodExcellentExcellentGood

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.