{*}SecureCodeHQ

UUID Generator

Generate universally unique identifiers using cryptographically secure randomness. UUID v4 for random IDs, v7 for timestamp-sortable IDs. 100% client-side.

122 random bits · collision-safe

DID YOU KNOW?

A UUID v4 has 122 random bits, giving 2^122 (about 5.3 × 10^36) possible values. If you generated 1 billion UUIDs per second, it would take about 100 years before you had a 50% chance of a single collision. The odds of generating two identical UUIDs are smaller than being hit by a meteorite.

Understanding UUIDs for developers

01

What is a UUID and when to use it

A UUID (Universally Unique Identifier) is a 128-bit value formatted as 32 hex digits in 5 groups (8-4-4-4-12). UUID v4 uses 122 random bits for IDs that don't reveal creation order. UUID v7 embeds a millisecond timestamp in the first 48 bits, making IDs sortable by creation time — ideal for database primary keys where index performance matters. Use UUIDs when you need globally unique IDs without coordination between systems.

02

UUID vs auto-increment IDs

Auto-increment IDs are sequential, predictable, and leak information (total record count, creation order). They also require a central coordinator. UUIDs can be generated independently by any system without collision risk. The tradeoff: UUIDs are larger (16 bytes vs 4-8), and random UUIDs (v4) cause index fragmentation in B-tree databases. UUID v7 solves this with timestamp-sorted IDs that maintain insertion order.

UUID generator FAQ

Practically yes. UUID v4 has 122 random bits, giving about 5.3 × 10^36 possible values. The probability of collision is astronomically low — you'd need to generate 2.71 quintillion UUIDs to have a 50% chance of one duplicate. For all practical purposes, treat them as unique.

Use UUIDs when you need IDs generated by multiple systems without coordination (distributed systems, client-side generation, offline-first apps). Use auto-increment when you need compact, sequential IDs and have a single database. UUID v7 is a good middle ground — sortable like auto-increment but globally unique like UUID v4.

UUID v4 uses cryptographically secure random bits and cannot be predicted. UUID v1 (timestamp + MAC address) is predictable and leaks information — avoid it for security-sensitive contexts. UUID v7 includes a timestamp (so creation time is visible) but the remaining bits are random. For security tokens, always use v4.

UUID v4 is fully random (122 random bits). UUID v7 embeds a millisecond Unix timestamp in the first 48 bits, followed by random bits. This makes v7 IDs chronologically sortable, which improves B-tree index performance in databases. Use v4 for general-purpose unique IDs, v7 for database primary keys.

This tool uses the Web Crypto API (crypto.getRandomValues) for all random bits. For UUID v4, it generates 128 random bits and sets the version (0100) and variant (10xx) bits per RFC 4122. For UUID v7, it uses the current timestamp for the first 48 bits and crypto-random for the rest. Everything runs in your browser — no server calls.

Need to store IDs and secrets together?

SecureCodeHQ organizes your secrets by project with tags. Access from Claude Code via MCP, your app via SDK, or the dashboard.