Developer Tools for Random Data Generation // v2.13.1
root@generate-random:~/uuids$ _

Random UUID Generator

Generate universally unique identifiers (UUIDs) in multiple versions and formats

Our random UUID generator creates standardized 128-bit universally unique identifiers that are globally unique across space and time. Generate random UUIDs in multiple versions including v4 (random), v7 (time-ordered), v5 (name-based SHA-1), v3 (name-based MD5), and v1 (time-based). Perfect for database primary keys, distributed systems, API development, session identifiers, and any application requiring unique identifiers without central coordination. All UUIDs are generated using cryptographically secure random number generation and comply with RFC 4122 and RFC 9562 standards. Export your generated UUIDs as text, CSV, or JSON for easy integration into your projects.

What is a UUID Generator?

A UUID (Universally Unique Identifier) generator creates standardized 128-bit identifiers that are globally unique across space and time. UUIDs are defined by RFC 4122 and RFC 9562, providing a standardized way to generate unique identifiers without requiring a central coordinating authority.

UUIDs are widely used in distributed systems, databases, API design, and software development to ensure uniqueness across different systems, databases, and applications without collision risks. Our random UUID generator API supports all major UUID versions for different use cases.

UUID Version Configuration Options

UUID Version 1 (Time-based)

Generates UUIDs based on the current timestamp and MAC address. Provides temporal ordering but may expose hardware information. Contains 60-bit timestamp (100-nanosecond intervals since 1582) and 48-bit node identifier (typically MAC address). Use our dedicated UUID v1 generator for this format.
  • Uniqueness: Guaranteed unique per MAC address + timestamp combination
  • Ordering: Sortable by generation time (with caveats)
  • Privacy: May expose MAC address (hardware identifier)
  • Use Cases: Legacy systems, transaction logs, audit trails
  • Format: {time_low}-{time_mid}-{time_hi_version}-{clk_seq}-{node}

UUID Version 3 (Name-based MD5)

Creates deterministic UUIDs by hashing a namespace UUID and a name using MD5. The same namespace and name combination will always produce the same UUID. Useful when you need reproducible identifiers based on existing data. Try our UUID v3 generator or Minecraft UUID generator which uses v3 for offline mode.
  • Deterministic: Same input always produces same UUID
  • Hash Algorithm: MD5 (128-bit output)
  • Namespace Required: Predefined (DNS, URL, OID, X500) or custom UUID
  • Use Cases: Content-addressable storage, deduplication, idempotent operations
  • Security Note: MD5 collisions possible; use v5 for better security

UUID Version 4 (Random)

The most commonly used UUID version. Generates completely random 122-bit UUIDs using cryptographically secure random number generation (CSPRNG). Provides excellent uniqueness with negligible collision probability while maintaining simplicity and privacy. Our UUID v4 generator is optimized for this format.
  • Randomness: 122 random bits (6 bits reserved for version/variant)
  • Collision Probability: ~1 in 2.7 quintillion for 1 billion UUIDs
  • Privacy: No embedded timestamps or hardware identifiers
  • Use Cases: General purpose identifiers, session IDs, object IDs, API keys
  • Performance: Fast generation, no coordination required

UUID Version 5 (Name-based SHA-1)

Similar to version 3 but uses SHA-1 hashing instead of MD5, providing better cryptographic properties and collision resistance. Recommended over v3 for all new applications requiring deterministic UUIDs. The 160-bit SHA-1 output is truncated to 128 bits. Use our UUID v5 generator for this format.
  • Deterministic: Same input always produces same UUID (reproducible)
  • Hash Algorithm: SHA-1 (more secure than MD5)
  • Namespace Required: DNS, URL, OID, X500, or custom namespace UUID
  • Use Cases: Content addressing, cache keys, data deduplication, migration IDs
  • Preferred: Use v5 over v3 for better security and collision resistance

UUID Version 7 (Time-ordered)

The newest UUID version (RFC 9562, 2024), combining the benefits of time-based ordering with cryptographic randomness. Contains Unix epoch timestamp in milliseconds plus random bits, making it ideal for database primary keys with better locality and index performance than v4. Our UUID v7 generator is recommended for database applications.
  • Timestamp: 48-bit Unix epoch milliseconds (sortable until year 10889)
  • Randomness: 74 random bits for uniqueness within same millisecond
  • Database Optimized: Better B-tree index locality than v4
  • Use Cases: Database primary keys, event IDs, distributed tracing, logs
  • Recommended: Preferred over v1 for time-ordered UUIDs (no MAC address leak)

Format Options

Customize the output format of generated UUIDs to match your application requirements and coding standards. All formats maintain the same underlying 128-bit value.
  • With Hyphens (Standard): 8-4-4-4-12 format (e.g., 550e8400-e29b-41d4-a716-446655440000)
  • Without Hyphens: 32-character hex string (e.g., 550e8400e29b41d4a716446655440000)
  • Uppercase: UPPERCASE hex characters (A-F)
  • Lowercase (Default): lowercase hex characters (a-f)

Bulk Generation (1-100 UUIDs)

Generate multiple UUIDs simultaneously for database seeding, testing, or batch operations. Each UUID is independently generated with proper randomness and timing for v1/v7 versions.
  • Quantity Range: Generate 1-100 UUIDs in a single operation
  • Independent Generation: Each UUID properly generated per specification
  • Batch Export: Download as TXT, CSV, or JSON
  • Use Cases: Database migrations, test data, bulk provisioning

How to Generate UUIDs

[STEP 1] Select UUID Version

Choose v4 for general use, v7 for databases, v5 for deterministic generation, or v1 for legacy support. Each version serves different use cases with specific characteristics and trade-offs.

[STEP 1] Configure Format

Choose whether to include hyphens and select uppercase or lowercase formatting. Standard format includes hyphens for readability, while compact format omits them for storage efficiency.

[STEP 1] Generate & Copy

Click generate, then copy UUIDs to clipboard or export to file. Use bulk generation for database seeding or testing scenarios requiring multiple unique identifiers.

UUID Best Practices

  • _ Use UUID v4 for general purpose unique identifiers - Perfect for session IDs, object identifiers, and distributed systems where ordering is not required.
  • _ Use UUID v7 for database primary keys - Better index performance and locality than v4 due to time-ordered structure, reducing database fragmentation.
  • _ Use UUID v5 when you need deterministic/reproducible identifiers - Same input always produces the same UUID, useful for content-addressable storage and caching.
  • _ Never use UUIDs as security tokens or secret keys - UUIDs are identifiers, not cryptographic secrets. Use dedicated token generation for authentication.
  • _ Store UUIDs as binary (16 bytes) in databases, not strings (36 bytes) - Binary storage saves space and improves index performance. Most modern databases support native UUID types.

Technical Implementation

Our UUID generator implements RFC 4122 and RFC 9562 standards using cryptographically secure random number generation for random-based versions (v4, v7) and standard hashing algorithms for name-based versions (v3, v5). Time-based versions (v1, v7) use high-precision timestamps with proper entropy.

Algorithm: UUID Generation (RFC 4122/9562)

UUID v4 Structure (122 random bits):
xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx
  where 4 = version, y = variant (8,9,A,B)

UUID v7 Structure (timestamp + random):
tttttttt-tttt-7xxx-yxxx-xxxxxxxxxxxx
  t = Unix epoch ms, 7 = version

Version bits: 4 bits (identifies UUID version)
Variant bits: 2 bits (RFC 4122 compliance)

Randomness Source: CSPRNG
Timestamp Precision: Milliseconds (v7) or 100ns (v1)
Hash Functions: MD5 (v3), SHA-1 (v5)

API Access for Developers

GET https://generate-random.org/api/v1/generate/uuids?version=4&count=10&hyphens=true
VIEW FULL API DOCUMENTATION

Frequently Asked Questions

Which UUID version should I use?
Use UUID v4 for general purpose identifiers (random). Use UUID v7 for database primary keys (time-ordered, better index performance). Use UUID v5 for deterministic generation (same input = same UUID). Use UUID v1 only for legacy compatibility.
Are UUIDs truly unique?
UUID v4 has a collision probability of approximately 1 in 2.7 quintillion when generating 1 billion UUIDs. For practical purposes, collisions are so unlikely that they can be ignored. UUID v1 and v7 guarantee uniqueness through timestamps and additional entropy.
Can I use UUIDs as security tokens?
No. While UUID v4 uses cryptographic randomness, it only provides 122 bits of entropy. Use dedicated token generation methods with at least 128-256 bits of entropy for security tokens, API keys, or session identifiers.
What is the difference between UUID v1 and v7?
Both are time-based, but v7 is newer (RFC 9562, 2024) and preferred. v7 uses Unix timestamp in milliseconds instead of v1's 100-nanosecond intervals, avoids exposing MAC addresses, and provides better database index locality. Use v7 for all new time-ordered UUID needs.
Should I store UUIDs as strings in my database?
No. Store UUIDs as binary/BINARY(16) or native UUID types. String storage (36-37 bytes) wastes 2-3x more space than binary (16 bytes) and reduces index performance. Most modern databases have native UUID support.