Random UUID Generator
Generate a random UUID v4 instantly. Cryptographically random, RFC 4122 compliant, generated entirely in your browser โ no server, no tracking.
Generate a Random UUID v4
Click once to get a fresh UUID v4. Each one is 122 bits of cryptographic randomness, formatted as xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx per RFC 4122.
- Cryptographically random: Uses
crypto.getRandomValues()โ not Math.random() - RFC 4122 compliant: Version 4 variant 1 โ the standard most systems expect
- One-click copy: Copy to clipboard instantly
- No server involved: Generated in your browser โ never transmitted anywhere
What Makes a UUID Random
- 122 random bits: UUID v4 uses 122 of its 128 bits for randomness โ 6 bits are fixed version/variant markers
- crypto.getRandomValues(): Browser API that draws from the OS entropy pool (hardware events, timing jitter) โ the same source used for TLS key generation
- Not Math.random(): JavaScript's Math.random() is a pseudorandom number generator (PRNG) unsuitable for security-sensitive IDs โ the UUID generator uses the cryptographic API instead
- Collision probability: With 2^122 possible values, generating a duplicate UUID is less likely than being struck by lightning twice in the same second
Common Uses for Random UUIDs
- Database primary keys: Globally unique row identifiers that work across distributed systems without a central auto-increment counter
- API keys and tokens: Opaque identifiers for authentication โ v4 reveals nothing about when or where they were created
- File and object names: Unique names for uploaded files, S3 objects, or cache keys that avoid collisions without coordination
- Idempotency keys: Include a UUID in API requests to safely retry operations without duplicate processing
- Test data: Seeding fixtures and databases with realistic-looking unique identifiers
Frequently Asked Questions
How do I generate a UUID in code?
Most languages have built-in or standard-library UUID generation: JavaScript/Node.js: crypto.randomUUID() (native) or the uuid npm package. Python: import uuid; uuid.uuid4(). Go: github.com/google/uuid package. Java: UUID.randomUUID(). PHP: Str::uuid() (Laravel) or ramsey/uuid. Ruby: SecureRandom.uuid. Use this web tool for quick one-off UUIDs; use the language library for programmatic generation.
Is a UUID the same as a GUID?
Yes โ GUID (Globally Unique Identifier) is Microsoft's name for the same concept. Both follow RFC 4122 and produce identical xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx format identifiers. GUIDs in Windows/.NET are UUIDs. The terms are interchangeable.
Should I store UUIDs with or without hyphens?
Either works, but be consistent. With hyphens (550e8400-e29b-41d4-a716-446655440000) is the canonical RFC 4122 format and most readable. Without hyphens (550e8400e29b41d4a716446655440000) saves 4 bytes per string and is convenient for URLs or file names. PostgreSQL's native uuid type stores as binary (16 bytes) regardless of input format. MySQL's VARCHAR(36) stores with hyphens by convention.