Understanding UUIDs and How to Generate Them
What this generator does
A UUID (Universally Unique Identifier) is a 128-bit value written as 32 hexadecimal digits in the familiar 8-4-4-4-12 pattern, such as 550e8400-e29b-41d4-a716-446655440000. This generator produces RFC 4122 identifiers on demand: pick version 4 or version 1, and create up to 100 in a single batch.
You can switch hyphens on or off and choose lowercase or uppercase output, so the result matches whatever your database column, API contract, or codebase already expects.
When to reach for a UUID
UUIDs are useful whenever an identifier has to be created independently, with no central authority handing out sequential numbers. Typical uses include primary keys in distributed databases, correlation IDs for tracing a request across services, idempotency keys on API calls, filenames that must never collide, and object or session references minted on the client.
Because two machines can generate IDs at the same moment without coordinating, UUIDs fit microservices, offline-first apps, and event pipelines particularly well.
Version 4 versus version 1
Version 4 fills almost all of its bits with cryptographically strong random values from the browser's crypto.randomUUID and the Web Crypto API, so the IDs are unpredictable and reveal nothing about when or where they were made. This is the right default for most work.
Version 1 instead builds the value from the current timestamp plus a node identifier and a clock sequence, which makes a batch roughly sortable by creation time but exposes that timing. Choose v4 when unpredictability matters, and v1 when loose chronological ordering is the more useful property.
Format and collision odds
Both versions keep the standard 8-4-4-4-12 layout, and the version digit sits at the start of the third group, a 4 or a 1. The strength of v4 comes from its 122 random bits: the pool holds more than 5×10^36 possible values, so even after generating billions of IDs the chance that any two match stays effectively negligible.
Turning hyphens off yields a compact 32-character string that is handy in URLs or keys, while uppercase output lines up with systems that store identifiers that way.