What it does
A UUID is a 128-bit identifier, usually written as 36 characters with hyphens. A ULID is a 128-bit identifier written as 26 Crockford base32 characters that sorts by time. Both are designed to be unique without coordination; neither is secret.
How it works
UUID v4 is 122 random bits plus version and variant markers. The chance of a collision is negligible for practical volumes. Generation should use a cryptographic random source, not Math.random, which is predictable.
ULID is 48 bits of millisecond timestamp followed by 80 random bits, encoded in base32. Lexicographic order matches creation order, which is useful for database keys and log correlation. Monotonic variants exist to avoid collisions within the same millisecond.
A UUID is not a secret. It is often exposed in URLs and logs. Do not use one as a password reset token or an API key; use a random token with enough entropy and store only its hash.
Version matters. v1 embeds a timestamp and MAC address and can leak hardware information. v4 is random. v7, increasingly common, embeds a Unix timestamp for sortability, similar to ULID.
Formatting is not validation. A string can look like a UUID and still be malformed. Check the version and variant nibbles, and normalise to lowercase for comparison.
When to use it
- Generate an idempotency key for an API request.
- Create sortable database identifiers with ULID.
- Produce test fixtures that will not collide.
- Understand why a v1 UUID may leak a MAC address.
Glossary
- UUID
- Universally Unique Identifier, a 128-bit value in a standard text form.
- ULID
- A 128-bit, time-sortable identifier encoded in Crockford base32.
- v4
- The random UUID version with 122 random bits.
- Crockford base32
- An encoding that avoids ambiguous characters such as I and L.
- Monotonic
- Guaranteed to increase, even within the same millisecond.
Frequently asked questions
Can a UUID be used as a secret?+
No. It is an identifier, often public. Use a random token with sufficient entropy for secrets, and store only a hash.
UUID or ULID for a primary key?+
ULID or UUID v7 sort by time and index better than random v4. Choose based on your database and whether you need to avoid leaking creation time.
Are these generated on a server?+
No. They use the browser's crypto.getRandomValues and never leave the device.
Why does a v1 UUID contain a MAC address?+
The original design used the node identifier for uniqueness. That can leak hardware information, so v1 is rarely appropriate today.
Can two generated values collide?+
With a proper random source, the probability is negligible at practical volumes. Do not rely on uniqueness guarantees if you generate with Math.random.
API & MCP
No API endpoint
This tool runs entirely in your browser. It is not available over the REST API or MCP.
Shareable result
https://100www.dev/tools/uuid-generator?v=v4

100www engineering
EditorialReviewed by Steve · · Report an error
Tested from the 100www probe network; results vary by location and network.


