UUID Studio · Free Developer Toolkit

UUID Generator & Analyzer

Generate, validate, decode, analyze, compare, and understand UUIDs instantly. Full support for v1, v3, v4, v5, v6, v7, v8 plus ULID, NanoID, KSUID, Snowflake and CUID2 — with a built-in database ID advisor, performance benchmarks and language-specific code (Java, Spring Boot, JPA, Kotlin, JS/TS, Python, Go, Rust, C#, PHP).

RFC 9562 compliant Crypto-secure 100% Free Runs in your browser
550e8400-e29b-41d4-a716-446655440000
Quick definition. A UUID (Universally Unique Identifier) is a 128-bit value standardised by RFC 9562 that can be generated on any machine without coordination, with a collision probability so low it is treated as zero in practice. UUID v4 is fully random; UUID v7 prepends a Unix-millisecond timestamp so values sort chronologically and index efficiently in B-tree databases. For new systems, prefer UUID v7 as a primary key, UUID v4 for opaque public identifiers, and v3 / v5 when an ID must be deterministically derived from a name.

UUID Generator

Bulk UUID Generator

Click Generate to produce a batch.

Validator, Decoder & Timestamp Extractor

Valid Version 7 Variant RFC 9562

Decoded fields

Bit layout

Format converter

UUID Comparator

Collision Probability

Entropy Analyzer

Distribution

Performance Analyzer

Insert performance, index locality and storage cost for the most common 128-bit identifier choices. Lower latency and tighter indexes win.

IdentifierSizeSortableB-tree localityInsert speed (relative)Notes
UUID v4128-bitNoPoor (random)1.0×Index fragmentation under write load
UUID v7128-bitYes (ms)Excellent2.8–4.2×Drop-in replacement for v4 in PostgreSQL/MySQL
ULID128-bit / 26 charYes (ms)Excellent2.6–3.8×Crockford Base32, URL-safe
KSUID160-bit / 27 charYes (s)Excellent2.5×Larger, second-resolution timestamp
Snowflake64-bitYes (ms)Excellent4.5×Requires worker-id coordination
NanoID (21)~126-bit / 21 charNoPoor1.1×Smallest URL-safe random ID
CUID2~24 charNoPoor0.9×Designed to resist enumeration
Runs 100,000 generations of each format.

Format & Case Converter

Batch Processor & Search

Database ID Advisor

Pick a database and workload to get a recommendation.

Distributed ID Comparison

FeatureUUID v4UUID v7ULIDKSUIDSnowflakeNanoIDCUID2
Bits12812812816064~126~144
String length36362627≤192124
Time-orderedNoYes (ms)Yes (ms)Yes (s)Yes (ms)NoNo
SortableNoYesYesYesYesNoNo
URL-safeYesYesYesYesYesYesYes
CoordinationNoneNoneNoneNoneWorker-idNoneNone
RFC / SpecRFC 9562RFC 9562ulid/specsegmentioTwitterai/nanoidparalleldrive/cuid2
Recommended forPublic opaque IDsDB primary keyDB primary keyEvent logsDistributed servicesShort URLsAnti-enumeration

ULID, NanoID, KSUID, Snowflake, CUID2

01JYABCD123XYZ...

Code for every stack

Saved History

Saved UUIDs appear here. Use the ★ Save button after generating.

UUID Internals — How It Works

Structure of a UUID

A UUID is 128 bits, conventionally formatted as xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx where M identifies the version (1–8) and the top bits of N identify the variant (RFC 9562 uses binary 10).

time_low · 32 bits time_mid · 16 bits version + time_hi · 16 bits variant + clock_seq · 16 bits node / random · 48 bits

UUID v1

60-bit 100-ns timestamp since 1582-10-15 + 14-bit clock sequence + 48-bit node ID (often MAC). Leaks host and time.

UUID v3

MD5 of (namespace UUID || name). Deterministic — same inputs always give the same UUID.

UUID v4

122 bits of cryptographic randomness. Fully unordered. The default opaque identifier.

UUID v5

SHA-1 of (namespace UUID || name). Same deterministic behaviour as v3 but stronger hash.

UUID v6

Reorders v1 so the timestamp is in big-endian order, making the UUID sortable.

UUID v7

48-bit Unix ms timestamp + 74 bits random. Time-ordered, RFC 9562 native, ideal for primary keys.

UUID v8

122 bits of user-defined data. Use when you need a custom layout that still claims a UUID slot.


Best practices

  • Use v7 for primary keys — chronological order avoids index page splits.
  • Use v4 for public IDs — no information leakage.
  • Store as native UUID / BINARY(16), never as VARCHAR(36).
  • Always use a cryptographically secure RNG (crypto.getRandomValues, SecureRandom).
  • Pair UUIDs with a monotonically increasing sequence only if you need strict ordering.

Common mistakes

  • Using UUID v1 in public APIs — it leaks the host MAC address.
  • Storing UUIDs as VARCHAR(36) instead of uuid / BINARY(16) — 2.25× the storage.
  • Picking UUID v4 as a clustered primary key — destroys B-tree locality.
  • Generating UUIDs with Math.random() — not cryptographically secure.
  • Exposing v1 / v6 / v7 IDs externally without considering the embedded timestamp.

Key takeaways

  • UUID v7 is the modern default for database primary keys (RFC 9562, 2024).
  • UUID v4 remains correct for opaque external identifiers.
  • ULID and v7 are functionally equivalent in ordering guarantees; choose ULID for shorter string form, v7 for native DB UUID type.
  • Snowflake wins on raw size (64-bit) but requires worker-id coordination.
  • NanoID and CUID2 are for URLs and anti-enumeration, not for high-throughput databases.
  • Collision probability for UUID v4 reaches 50% around 2.71 × 10¹⁸ generated IDs — effectively never in practice.

FAQ

Distributed ID Hub