ID

UUID Generator

Generate cryptographically random UUID v4 values — instantly, in your browser.

uuid-generator · v4
141b1c927-4220-4cb1-afb1-b940a5616328

About UUID Generator

A UUID (Universally Unique Identifier) is a 128-bit identifier formatted as 32 hexadecimal characters in the pattern xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx. UUID v4, the most commonly used variant, is generated from random numbers — making collisions statistically impossible even across distributed systems. This generator uses the Web Crypto API's crypto.randomUUID() function, which is cryptographically secure and built into every modern browser and Node.js 15+. No server required, no tracking, no stored history. UUIDs are used as primary keys in databases (avoiding sequential ID guessing attacks), unique filenames for uploaded assets, session and correlation IDs in distributed systems, idempotency keys in payment APIs, and identifiers in REST APIs where the client generates the ID before the server confirms it. Generate a single UUID or bulk-generate up to 20 at once for seeding databases or test fixtures. Each click generates fresh, fully random values. Copy individual UUIDs or copy all at once.

Frequently Asked Questions

What is a UUID v4?
UUID v4 is a 128-bit random identifier following the format xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx. The "4" indicates version 4 (random). The y position is either 8, 9, a, or b to indicate the variant. All other characters are cryptographically random hex digits.
Are UUIDs truly unique? Can they collide?
Collisions are theoretically possible but practically impossible. UUID v4 has 2^122 possible values (~5.3 × 10^36). If you generated 1 billion UUIDs per second for 100 years, the probability of a single collision would be about 50%. For real-world use, treat them as unique.
Should I use UUID as a database primary key?
It depends. UUIDs are globally unique and safe to generate client-side, but they're larger than integers (16 bytes vs 4–8 bytes), random UUIDs fragment indexes in MySQL/PostgreSQL, and they're harder to read in logs. UUID v7 (time-ordered) solves the index fragmentation issue. For most apps, UUIDs are fine.
What's the difference between UUID v1, v4, and v7?
UUID v1 encodes the MAC address and timestamp — sortable but exposes hardware info. UUID v4 is fully random — the most common choice. UUID v7 (newer) encodes a millisecond timestamp prefix, making it sortable like v1 but without hardware exposure — ideal for database primary keys.
Is crypto.randomUUID() safe to use in production?
Yes. crypto.randomUUID() uses the operating system's cryptographically secure random number generator (CSPRNG) — the same source used for TLS keys and password hashing. It's available in all modern browsers, Node.js 15+, and Deno.