EN FR

UUID / ULID Generator

Generate UUID v1, v4, v5 and ULID in bulk. Validate, decode, and compare formats. Code snippets in JS, Python, Go and SQL. 100% client‑side.
UUID or ULID to validate
Supported formats
  • UUID v1–v8 with hyphens: xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx
  • UUID without hyphens (32 hex chars)
  • ULID (26 chars, Crockford Base32): 01ARZ3NDEKTSV4RRFFQ69G5FAV
  • Nil UUID: 00000000-0000-0000-0000-000000000000
UUID v1 or ULID to decode
Only UUID v1 and ULID embed a timestamp. UUID v4 is fully random and contains no decodable metadata. UUID v5 embeds a deterministic SHA-1 hash, not a timestamp.
UUID v4 vs UUID v1 vs ULID
Feature UUID v4 UUID v1 UUID v5 ULID
SortableNoYes (temporal)NoYes (lexicographic)
Entropy122 bits~60 bitsDeterministic80 bits random
Length36 chars36 chars36 chars26 chars
EncodingHexHexHexCrockford Base32
Deterministic?NoNoYes (name + ns)No
RFC standardRFC 9562RFC 9562RFC 9562ULID spec
Embeds timestampNoYesNoYes (ms precision)
Typical useGeneral-purpose keysLogs, temporal sortReproducible IDsDatabase primary keys
Privacy concernNoneMAC address embeddedNoneNone
Code snippets

UUID and ULID: complete developer guide

A UUID (Universally Unique Identifier) is a 128-bit identifier standardized in RFC 9562. It is represented as 32 hexadecimal digits in groups of 8-4-4-4-12, separated by hyphens. UUIDs are designed to be generated independently without a central authority, making them ideal for distributed systems.

A ULID (Universally Unique Lexicographically Sortable Identifier) is a 128-bit identifier encoded in 26 Crockford Base32 characters. The first 48 bits encode the timestamp in milliseconds; the remaining 80 bits are random. ULIDs sort correctly as strings, which gives a significant advantage for indexed database columns.

Which UUID version should I use?

  • UUID v4 — use for almost everything. Fully random, 122 bits of entropy, no privacy concerns.
  • UUID v1 — use when temporal ordering matters and you can tolerate embedding the MAC address. Be aware of the privacy implications.
  • UUID v5 — use when you need a reproducible UUID from a name (e.g. namespace + email always produces the same UUID). Useful for idempotent operations.
  • ULID — use as database primary keys when you need natural sort order without a separate created_at column.

Frequently Asked Questions

What is the difference between UUID v4 and UUID v5?

UUID v4 is randomly generated and different every time. UUID v5 is deterministic: it computes a SHA-1 hash over a namespace UUID and a name string, always producing the same UUID for the same inputs. Use v4 for unique keys, v5 for reproducible identifiers (e.g. converting a domain name to a UUID).

Why choose ULID over UUID v4?

ULID is shorter (26 vs 36 characters), lexicographically sortable by creation time, and uses the Crockford Base32 alphabet (no ambiguous characters like 0/O or 1/I). It is ideal for database primary keys where insertion order matters, as it avoids B-tree index fragmentation caused by random UUIDs.

What is a nil UUID?

The nil UUID is 00000000-0000-0000-0000-000000000000. All 128 bits are zero. It is used as a sentinel value to indicate the absence of a UUID — similar to null but in UUID format. RFC 9562 also defines a max UUID: ffffffff-ffff-ffff-ffff-ffffffffffff.

Is UUID v1 a privacy risk?

Yes, in its original form. UUID v1 embeds the MAC address of the generating machine in its last 12 hex characters (the "node" field). This allows an observer to identify which machine generated a UUID. Modern implementations often substitute a random node to avoid this. This tool uses a random node for privacy.

How do I generate a UUID in JavaScript?

Modern browsers and Node.js provide crypto.randomUUID(), which generates a UUID v4. For older environments: ([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g, c => (c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16)). Never use Math.random() for UUID generation.

How do I generate a UUID in Python?

Python's standard library includes the uuid module: import uuid; uuid.uuid4() for v4, uuid.uuid5(uuid.NAMESPACE_DNS, 'example.com') for v5. For ULID, use the python-ulid package: pip install python-ulid.

Can two machines generate the same UUID v4?

Theoretically yes, but the probability is astronomically small. With 122 bits of randomness, there are 2^122 ≈ 5.3 × 10^36 possible UUIDs. Generating 1 billion UUIDs per second for the lifetime of the universe would still leave a collision probability far below 1 in a trillion.

What is the difference between UUID and GUID?

GUID (Globally Unique Identifier) is Microsoft's implementation of the UUID standard. They are functionally identical — a GUID is a UUID. The terms are interchangeable. Microsoft's Windows API uses GUID; the RFC uses UUID.

How large is a UUID in bytes?

A UUID is 128 bits = 16 bytes when stored as binary (e.g. in a MySQL BINARY(16) column). As a string with hyphens it is 36 bytes (ASCII). As a string without hyphens it is 32 bytes. ULID as a string is 26 bytes; as binary it is also 16 bytes.

Is my data sent to a server?

No. All UUID and ULID generation, validation, and decoding happens entirely in your browser using the crypto.getRandomValues() API and SubtleCrypto. Nothing is transmitted to any server.

Other useful tools