UUID / ULID Generator
Generate UUID v4, v7, v5 and v1, plus ULIDs and NanoIDs instantly. Bulk generation up to 100 IDs, uppercase, no-hyphens, quote wrapping. Free, 100% client-side.
UUID / ULID Generator Tool
UUID v5 is deterministic — the same namespace + name always produces the same UUID (SHA-1 based). Quantity is ignored.
crypto.getRandomValues(). Nothing is sent to any server.
How to Use the UUID / ULID Generator
Choose your ID format
Select UUID v4 for most applications, UUID v7 or ULID when you need IDs that sort by creation time, UUID v5 for deterministic namespace-based IDs, or NanoID for compact URLs and short references.
Set the quantity
Generate 1 to 100 IDs at once for bulk database seeding, test data generation, or API payload construction. The generator runs instantly regardless of count.
Apply format options
Enable uppercase, remove hyphens, or wrap each ID in quotes or braces for direct use in SQL INSERT statements, JSON arrays, or CSV seed files.
Copy or download
Hover over any line and click its Copy button to grab a single ID. Use Copy All to send the full list to your clipboard, or Download .txt to save it as a file for import into your database tooling.
UUIDs, ULIDs and Unique Identifiers in Modern Software
UUID vs ULID vs NanoID: Which Should You Use in 2026?
Choosing the right unique identifier format has a real impact on database performance, URL readability, and system scalability. Each format was designed to solve a specific problem, and understanding the trade-offs helps you make the right call from the start.
UUID v4 is the universal standard. At 36 characters (32 hex + 4 hyphens),
it is supported by every major database, framework, and programming language. RFC 9562 §5.4
lets an implementation either fill all 128 bits and overwrite the version and variant
afterwards, or generate the exact required number of bits for random_a, random_b, and
random_c (122 bits total)
. This page calls crypto.randomUUID() where the
browser has it and otherwise fills sixteen bytes from crypto.getRandomValues()
and sets those two fields by hand — both routes draw on the platform CSPRNG that RFC 9562
§6.9 asks for, and neither derives anything from Math.random().
Use UUID v4 when compatibility with existing tooling matters or when you are
building an API that external consumers will work with.
UUID v7 — standardised in RFC 9562 in 2024 — is the time-ordered format
to reach for today. Its layout is a 48-bit big-endian Unix timestamp in milliseconds,
then the 4-bit version and 2-bit variant fields, then random data for the remainder.
Because the timestamp sits in the most significant bits, v7 values sort by creation time
under a plain byte-by-byte comparison — no MAC address, no node field of any kind.
Implementations that need ordering to hold within a single millisecond may
replace part of the random block with a monotonic counter, described in RFC 9562 §6.2.
This page does not: it writes the 48-bit millisecond stamp and fills the remaining 74 bits
from crypto.getRandomValues(), so two v7 values minted in the same millisecond
sort in an arbitrary order relative to each other. Across milliseconds the ordering is exact.
UUID v1 is time-based but not time-sortable, and the
difference matters. Its leading field is time_low — the low 32 bits of a
60-bit counter of 100-nanosecond intervals — so the first eight characters wrap roughly
every 429.5 seconds and v1 values do not sort in creation order. RFC 9562 §2.1 makes the
point directly: ordering v1 by time requires introspection, "as opposed to being able to
perform a simple byte-by-byte comparison". Classic v1 also embeds the generating
machine's MAC address in its node field, which lets anyone holding a UUID work out which
host produced it. RFC 9562 §5.6 defines UUID v6 purely to reorder v1's fields for
database locality, and §5.7 is explicit for new work: "Implementations SHOULD utilize
UUIDv7 instead of UUIDv1 and UUIDv6 if possible." This generator emits the v1 layout with
a random, multicast-flagged node in place of a MAC address, so it leaks no hardware
identity — but choose v7 when you actually want sortable IDs.
ULID (Universally Unique Lexicographically Sortable Identifier) uses 26
Crockford Base32 characters — time-sortable, URL-safe, case-insensitive. The first 10
characters encode 48-bit millisecond precision; the remaining 16 characters are 80-bit
random. Like UUID v7, ULIDs sort naturally by creation time without a separate timestamp
column, so a store whose write performance depends on keys arriving in order gets that
property with no coordinating sequence. Note that ULID is not an IETF standard and carries
no version or variant field: a ULID is not a UUID, and a column typed uuid
will not take one.
UUID v5 is the odd one out here because it contains no randomness at all.
RFC 9562 §5.5 defines it as the SHA-1 hash of a namespace UUID concatenated with a name,
truncated to 128 bits, with the version and variant fields then overwritten — so the same
namespace and the same name always yield the same UUID, on any machine, for ever. That is
the point of it: a stable identifier for something that already has a natural key. The RFC
also draws the boundary — where SHA-1 is unavailable or considered unsafe, a name-based
UUID built on SHA-256 MUST NOT utilize UUIDv5 and MUST be within the UUIDv8 space
.
This page emits v5 only, using the browser's
crypto.subtle.digest('SHA-1', …).
NanoID produces 21 URL-safe characters using a 64-character alphabet (A-Za-z0-9_-), achieving comparable collision resistance to UUID v4 with 41.7% fewer characters (21 against a UUID string's 36). The compact format is ideal for URL slugs, short-link systems, and API resource identifiers where brevity matters.
"Generate one billion UUID v4s every second for 100 years and you reach roughly 3.16 × 10¹⁸ of them — about a 61% chance that two are identical. The 50/50 point arrives earlier, at 2.71 × 10¹⁸ UUIDs, or just over 86 years at that rate."
Why UUIDs Beat Auto-Increment IDs in Distributed Systems
Auto-increment integer IDs require a centralised counter — a single point of failure and a write bottleneck. In a single-database, single-server architecture this is fine, but as soon as you add a read replica, a second application server, or begin sharding your data, the centralised counter becomes a coordination problem. Every INSERT must contact the master database to obtain the next ID, creating latency and limiting write throughput.
UUIDs and ULIDs can be generated independently on any server, any microservice, or even in the browser itself — with zero coordination required. An order ID can be assigned by the client application before the record is written to any database. This is especially important for event-sourced systems, CQRS architectures, and multi-region deployments where network round trips are expensive.
The trade-off is database index locality. Random UUIDs (v4) scatter insertions across a
B-tree instead of appending at its right edge: leaf pages fill, then split, and the index
fragments — the page-fill-and-split behaviour PostgreSQL's fillfactor
documentation describes for random insertion patterns. RFC 9562 §2.1 lists
"poor database index locality" among the problems with random UUIDs and notes that the
effects on B-tree indexes and their variants can be dramatic. The fix is a time-ordered
identifier — UUID v7 or ULID — whose values append in time order, preserving the
sequential-insert behaviour of auto-increment keys while keeping fully decentralised
generation.
MySQL has no UUID column type at all — CREATE TABLE t (id UUID) is a syntax
error. You pick the representation yourself: CHAR(36) or
VARCHAR(36) to keep the readable hyphenated text, or BINARY(16)
to store the 128 bits directly, converting with UUID_TO_BIN() and
BIN_TO_UUID() (MySQL 8.0 and later). PostgreSQL does have a native
uuid type, stored as 128 bits internally and declared simply as
UUID in a CREATE TABLE statement.
How UUID v4 Randomness Actually Works
UUID v4 derives its 122 bits of randomness from the platform's cryptographically secure
pseudorandom number generator. RFC 9562 §6.9 is the requirement: implementations
SHOULD utilize a cryptographically secure pseudorandom number generator (CSPRNG) to
provide values that are both difficult to predict ("unguessable") and have a low likelihood
of collision ("unique")
. In a browser that generator is reached through the Web
Cryptography API, whose note on random-value generation says implementations
should generate cryptographically strong random values using well-established
cryptographic pseudo-random number generators seeded with high-quality entropy, such as
from an operating-system entropy source
. Math.random() carries no such requirement: ECMA-262 asks
only for values chosen randomly or pseudo randomly with approximately uniform
distribution over that range, using an implementation-defined algorithm or strategy
,
and promises nothing about unpredictability. A UUID built from it is not a v4 in any sense
that matters.
The version (4) and variant (0b10) bits consume 6 of the 128 available bits, leaving 122 bits of effective randomness — 2¹²² ≈ 5.32 × 10³⁶ distinct values. Collision probability follows the birthday bound, P ≈ 1 − e−n² / (2 × 2¹²²), where n is the number of IDs generated. One billion IDs per second for one hundred years gives n ≈ 3.16 × 10¹⁸, which puts P at about 61% — so the even-odds point arrives a little earlier, at n ≈ 2.71 × 10¹⁸, or just over 86 years at that rate. Both figures describe a machine nobody is building; for any realistic application, UUID v4 collisions are not a practical concern.
The Crockford Base32 alphabet used in ULIDs was deliberately designed to eliminate visually ambiguous characters: no I (which looks like 1), no L (which looks like 1), no O (which looks like 0), and no U (which looks like V in some fonts). This makes ULIDs safer to read aloud, transcribe by hand, or display in error messages — a real ergonomic consideration for support teams and audit logs.
Collision odds, version bits, and what the RFCs changed
A UUID v4 contains 122 bits of randomness — 4 of the other bits are the version field (0b0100) and 2 are the variant field (0b10), which RFC 9562 §4.1 now labels simply the variant specified in this document
after retiring RFC 4122's name for it.
Two given v4s match with probability 1 in 2¹²² ≈ 5.3×10³⁶. The figure that governs a real system is different and far smaller: by the birthday bound, a set of v4s reaches even odds of containing a duplicate at about 2.7×10¹⁸ values.
UUID stands for Universally Unique Identifier — first standardised in RFC 4122 in 2005, and re-standardised in RFC 9562 in 2024, which added versions 6, 7 and 8.
ULID stores the timestamp in the first 10 characters — making ULIDs naturally sortable by creation time without a separate timestamp column.
MySQL has no UUID column type — you choose the representation yourself: CHAR(36)/VARCHAR(36) text, or BINARY(16) via UUID_TO_BIN() and BIN_TO_UUID().
Classic UUID v1 embeds the generating machine's MAC address in its node field; RFC 9562 §8 holds that MAC addresses pose inherent security risks around privacy and SHOULD NOT be used within a UUID
. This page follows §6.10 instead — a random 48-bit node with the multicast bit forced to 1, a bit that will never be set in IEEE 802 addresses obtained from network cards
.
NanoID reaches collision resistance comparable to UUID v4 in only 21 characters — 41.7% fewer than a UUID string's 36.
Crockford Base32 excludes visually ambiguous characters: no I, L, O, or U — eliminating confusion when IDs are read aloud or transcribed manually.
Two UUIDs are reserved as sentinels: the Nil UUID (all 128 bits zero, 00000000-0000-0000-0000-000000000000) and the Max UUID (all bits one, ffffffff-ffff-ffff-ffff-ffffffffffff) — the Max form was only formally defined in RFC 9562 §5.10 in 2024.
The lineage is in RFC 9562's own abstract: UUIDs were originally used in the Apollo Network Computing System (NCS), later in the Open Software Foundation's (OSF's) Distributed Computing Environment (DCE), and then in Microsoft Windows platforms
— which is why GUID and UUID name the same 128 bits.
Frequently Asked Questions
-
A UUID (Universally Unique Identifier) is a 128-bit label used to uniquely identify information in computer systems. UUIDs are used as primary keys in databases, resource identifiers in APIs, session tokens, transaction IDs, and anywhere a unique identifier needs to be generated without central coordination. UUID v4 is the most common form — it uses 122 bits of cryptographic randomness to ensure uniqueness across all systems without any coordination between generators.
-
UUID v1 is time-based — it embeds a 60-bit timestamp plus the generating machine's MAC address — but it is not time-sortable. Its leading field is
time_low, the low 32 bits of the timestamp, which wraps roughly every 429.5 seconds, so sorting v1 values as strings or bytes does not give creation order. RFC 9562 §2.1 puts it in terms of needing introspection "as opposed to being able to perform a simple byte-by-byte comparison". The embedded MAC address also exposes which host generated each UUID — this page emits none, using the random multicast-flagged node of RFC 9562 §6.10 instead. UUID v4 is pure cryptographic randomness with no timestamp or machine information, making it privacy-safe but equally unsortable. For new applications RFC 9562 §5.7 recommends UUID v7 — a 48-bit Unix millisecond timestamp in the most significant bits, so it genuinely sorts by creation time — or ULID. -
A ULID (Universally Unique Lexicographically Sortable Identifier) is a 26-character Crockford Base32 string that encodes a 48-bit millisecond timestamp in the first 10 characters and 80-bit random data in the remaining 16. Use ULID when you need IDs that sort chronologically by creation time without a separate timestamp column. ULIDs are also URL-safe and case-insensitive. ULID is not an IETF standard and has no version or variant field, so a ULID is not a UUID: its 26-character text form has to be converted before a column typed
uuidwill accept it. -
Theoretically yes, but the probability is astronomically low. UUID v4 has 122 bits of randomness — the collision probability formula gives approximately 50% chance of collision only after generating 2.71 × 10¹⁸ UUIDs. At one billion UUIDs per second, that would take just over 86 years. No real application will ever generate enough UUIDs to make collision a practical concern. For truly collision-critical systems, you can add a unique database constraint as a safety net, but it will never trigger in practice.
-
NanoID is a 21-character URL-safe random identifier using a 64-character alphabet (A-Za-z0-9_-). Twenty-one characters from a 64-symbol alphabet carry 126 bits, so it is marginally more random than UUID v4's 122 while using 41.7% fewer characters — 21 against a UUID string's 36 — making it ideal for URLs, API slugs, and short-link systems where compactness matters. Unlike UUID v4, NanoID has no hyphens, no fixed version/variant bits, and is safe to use directly in URLs without encoding. The trade-off is that NanoID is not an established standard — some systems require UUID format specifically.
-
MySQL has no UUID column type, so the choice is yours. The compact option is
BINARY(16)— the raw 128 bits — rather than the 36-characterCHAR(36)/VARCHAR(36)text form. Convert with MySQL's built-inUUID_TO_BIN()on the way in andBIN_TO_UUID()on the way out (both MySQL 8.0 and later). The optional second argument,UUID_TO_BIN(uuid, 1), swaps the time-low and time-high fields to improve index locality for v1 UUIDs; MySQL's manual notes that this swapping provides no benefit for values that are not time-based v1 UUIDs, so leave it off for v4 and v7. -
Yes, with one deployment caveat.
crypto.randomUUID()is a Web Cryptography API method; it returns a version 4 UUID as defined by RFC 9562 §5.4, drawn from the same CSPRNG that backsgetRandomValues(). The caveat is that its IDL declaration is marked[SecureContext], so it exists only on an HTTPS page or localhost — so on a plain-HTTP origin the method is absent rather than broken. This page uses it where it exists and otherwise fills sixteen bytes fromcrypto.getRandomValues()and writes the version and variant fields itself, which produces the same thing. What neither route gives you is unpredictability you can lean on for authorisation: RFC 9562 §8 states that implementationsSHOULD NOT assume that UUIDs are hard to guess
and that theyMUST NOT be used as security capabilities (identifiers whose mere possession grants access)
. -
Crockford Base32 was chosen for ULIDs because it is URL-safe, case-insensitive, and deliberately excludes visually ambiguous characters. The standard Base32 alphabet includes I (looks like 1), L (looks like 1), O (looks like 0), and U (looks like V) — Crockford removes all four. This makes ULIDs safer to display in error messages, logs, and user interfaces, and easier to transcribe correctly over the phone or in support tickets — an ergonomic advantage over hex-based formats.
-
Most languages have built-in UUID support. In PHP:
Str::uuid()(Laravel) orramsey/uuidlibrary. In Python:import uuid; uuid.uuid4(). In JavaScript/Node.js:crypto.randomUUID()(built-in since Node 15.6) or theuuidnpm package. In Go:github.com/google/uuid. In Java:UUID.randomUUID()(built-in). In PostgreSQL:gen_random_uuid()(built-in since v13) oruuid_generate_v4()from the uuid-ossp extension. -
PostgreSQL 13 and later ships
gen_random_uuid()in core — it generates a UUID v4 and needs no extension. Before 13 the same function came from thepgcryptoextension, and theuuid-osspextension'suuid_generate_v4()was the other common route. PostgreSQL stores UUIDs in a native 128-bit type declared simply asUUIDin CREATE TABLE — unlike MySQL, which has no UUID type and leaves the representation to you.
Method & sources
How it computes
Generates UUID v4, v1, v7 and v5 to the field layouts of RFC 9562 (May 2024, which obsoletes RFC 4122), plus 26-character Crockford Base32 ULIDs and 21-character NanoIDs. Every random field comes from the Web Cryptography API — crypto.randomUUID() for v4 where the browser exposes it, otherwise crypto.getRandomValues(); v5 is the SHA-1 of namespace+name via crypto.subtle. Nothing is generated on a server.
What this tool implements
- UUID v4 (RFC 9562 §5.4): 122 random bits with the 4-bit version 0b0100 and the 2-bit variant 0b10 written over them. The page takes the spec's first route — crypto.randomUUID() where present, otherwise sixteen bytes from crypto.getRandomValues() with the two fields overwritten by hand — and says which, because 'UUID v4' on a page that used Math.random() would be a lie the reader cannot detect.
- crypto.randomUUID() is declared [SecureContext] in the Web Cryptography API IDL, so it is absent on a plain-HTTP origin rather than broken. The fallback path exists for that case, not for 'older browsers' generally.
- UUID v7 (RFC 9562 §5.2/§5.7): a 48-bit big-endian Unix millisecond timestamp in the most significant bits, then ver=0b0111, then rand_a and rand_b. This page writes NO monotonic counter (§6.2 optional), so ordering is exact across milliseconds and arbitrary within one — stated on the page rather than implied away.
- UUID v1 (RFC 9562 §5.1) is emitted in its documented layout but MAC-free: the node is 48 random bits with the least-significant bit of the first octet forced to 1, the §6.10 construction, because that bit 'will never be set in IEEE 802 addresses obtained from network cards'. The page explains that v1 is time-BASED but not time-SORTABLE — its leading field is time_low, which wraps about every 429.5 seconds.
- UUID v5 (RFC 9562 §5.5): SHA-1 over the namespace UUID's 16 octets concatenated with the name, truncated to 128 bits, version and variant overwritten. Deterministic, so the quantity control is ignored. The four namespace IDs offered (DNS, URL, OID, X.500) are the §6.6 registered values.
- ULID: 10 Crockford Base32 characters of 48-bit Unix millisecond time followed by 16 characters of 80 random bits. The page states that ULID is not an IETF standard and has no version or variant field, so it is not a UUID and will not go in a uuid-typed column.
Sources
- RFC 9562, Universally Unique IDentifiers (UUIDs), IETF, May 2024 — obsoletes RFC 4122. §4.1 variant, §4.2 version, §5.1 v1, §5.4 v4, §5.5 v5, §5.7 v7, §6.2 monotonicity, §6.9 unguessability, §6.10 MAC-free node, §8 security considerations: https://www.rfc-editor.org/rfc/rfc9562
- W3C Web Cryptography API, W3C Recommendation — Crypto.getRandomValues() and the [SecureContext] randomUUID(); the note that implementations 'should generate cryptographically strong random values using well-established cryptographic pseudo-random number generators seeded with high-quality entropy': https://www.w3.org/TR/WebCryptoAPI/
- ECMA-262, ECMAScript Language Specification, §21.3.2.28 Math.random — 'chosen randomly or pseudo randomly with approximately uniform distribution over that range, using an implementation-defined algorithm or strategy', i.e. no unpredictability guarantee: https://tc39.es/ecma262/
- FIPS PUB 180-4, Secure Hash Standard (SHA-1), NIST, August 2015 — the hash RFC 9562 §5.5 specifies for UUIDv5: https://doi.org/10.6028/NIST.FIPS.180-4
- ULID specification, ulid/spec — 48-bit time component, 80-bit randomness, Crockford's Base32 alphabet: https://github.com/ulid/spec
- MySQL 8.4 Reference Manual, Miscellaneous Functions — UUID_TO_BIN(), BIN_TO_UUID() and the swap_flag argument: https://dev.mysql.com/doc/refman/8.4/en/miscellaneous-functions.html
- PostgreSQL 17 documentation, UUID Type and UUID Functions — the native uuid type and gen_random_uuid() in core since PostgreSQL 13: https://www.postgresql.org/docs/current/datatype-uuid.html
What can make this go out of date
- None at runtime. Every identifier is computed in the browser from the platform CSPRNG and the system clock; nothing is requested from or sent to a server.
- The time-based formats (v1, v7, ULID) read the client clock, so a machine with a wrong clock produces IDs that sort wrongly. No network time source is consulted.
Abridged — the full review record for this tool runs longer than the list above.
Pick up where you left off
Stored only in this browser — never sent to our servers.