UUID Generator

UUID Generator

Generate UUID v4 (random) or v7 (time-ordered) in bulk, then copy or export as JSON.

🔧

Configuration

Randomly generated UUID. Most common choice.

1 5k 10k
🎲

Collision Probability

< 1e-15%

Global risk (1B IDs)

Time to 1% Risk

Millions of years

at 1,000 IDs/second

Features

  • Generate UUID v4 (random, 122-bit entropy) and v7 (Unix timestamp-ordered)
  • Generate 1 to 10,000 UUIDs in a single operation with chunked rendering
  • Toggle uppercase/lowercase output and hyphens on/off
  • Collision probability calculator using Birthday Problem math
  • Export results as .txt or .json
  • Copy all generated UUIDs to clipboard with one click
  • Timestamp decoding for UUID v7 entries

Common Use Cases

  • Generate primary keys for databases (PostgreSQL, MySQL, MongoDB)
  • Create unique identifiers for distributed system messages or events
  • Seed test data with realistic-looking IDs for development and staging
  • Generate correlation IDs for request tracing and logging
  • Produce stable unique IDs for content addressable storage

What is a UUID?

A UUID (Universally Unique Identifier) is a 128-bit label standardized by RFC 4122. It is written as 32 hexadecimal digits in 5 groups separated by hyphens: xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx, where M indicates the version and N indicates the variant.

UUID v4 uses 122 bits of cryptographically secure randomness. The probability of generating two identical v4 UUIDs is astronomically small, making collisions practically impossible at any realistic scale.

UUID v7 embeds a 48-bit Unix millisecond timestamp in the first 12 hexadecimal characters, making UUIDs naturally sortable by creation time. This is ideal for database indexes, where timestamp-ordered IDs dramatically improve write performance (no index fragmentation) and allow extraction of creation time from the ID itself.

Examples

Valid - UUID v4 (random)
550e8400-e29b-41d4-a716-446655440000
Valid - UUID v7 (time-ordered)
018e5c4c-8b3a-7000-8000-000000000001
Valid - UUID uppercase, no hyphens
550E8400E29B41D4A716446655440000

Frequently Asked Questions

Should I use UUID v4 or v7?

Use UUID v4 when you need fully random, unpredictable IDs with no embedded metadata — for example, session tokens or public-facing identifiers. Use UUID v7 when sortability matters, especially for database primary keys. v7 UUIDs are monotonically increasing, which avoids B-tree index fragmentation in SQL databases and generally yields better INSERT performance at scale.

Are UUIDs truly unique?

In practice, yes. A UUID v4 has 122 random bits (≈5.3 × 1036 possibilities). To have a 1% chance of a collision, you would need to generate roughly 2.6 × 1018 UUIDs — far beyond any real-world application. However, do not use UUIDs as cryptographic secrets; they are not secrets, just unique labels.

Can I store UUIDs without hyphens?

Yes. The hyphenless format (32 hex characters) is semantically identical and often used in storage-constrained environments. Toggle "With hyphens" off in this tool to generate the compact format. Ensure your validation code handles both forms.

What is the UUID format exactly?

The standard format is 8-4-4-4-12 hex characters: xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx. The 13th character (M) is the version (4 or 7). The 17th character (N) is 8, 9, a, or b (indicating the RFC 4122 variant).

Is it safe to generate UUIDs in the browser?

Yes. This tool uses the Web Crypto API (crypto.getRandomValues) via the uuid npm package, which provides cryptographically secure randomness — the same source used by the operating system's random number generator. No data is sent to any server.

Can I extract the timestamp from a UUID v7?

Yes. The first 12 hex characters of a UUID v7 encode a 48-bit Unix millisecond timestamp. This tool decodes and displays that timestamp next to each v7 UUID in the results list. In code: parseInt(uuid.replace(/-/g, '').substring(0, 12), 16) gives you the milliseconds since the Unix epoch.

💡 Tips

  • For new projects using PostgreSQL, consider UUID v7 as your primary key type — it performs significantly better than v4 due to sequential ordering.
  • Never expose UUIDs as security tokens. They are unique identifiers, not secrets.
  • If you need a shorter ID for display in URLs, consider NanoID instead — same entropy in far fewer characters.
  • Use the export as JSON feature when seeding a database or test fixture file that imports IDs programmatically.
  • For high-throughput systems generating thousands of IDs per second, UUID v7 avoids clock-sequence collisions through monotonic increment.