How to generate a UUID

You need a unique identifier — for a database row, a request, a file — and you want one that won't collide. This guide shows how to generate a UUID, what the versions mean, and when a ULID is the smarter pick.

The fastest way

Open the UUID Generator and it produces a fresh v4 UUID instantly — generate one or a batch, then copy. Read on for which kind you actually want.

What a UUID looks like

550e8400-e29b-41d4-a716-446655440000

That's 128 bits as 32 hex digits in five hyphen-separated groups. The odds of two independently generated v4 UUIDs colliding are so small they're safely ignored in practice.

v4 vs. v1

v4 is random and is the usual default — it reveals nothing and needs no coordination. v1 embeds a timestamp and the generating machine's MAC address, which makes it roughly time-ordered but can leak when and where it was made. Unless you have a specific reason, reach for v4.

When a ULID is better

A random v4 UUID scatters across an index, which hurts insert performance and makes IDs un-sortable. A ULID is also 128 bits but is lexicographically sortable by time, so recent records cluster together and sort chronologically. For database primary keys and log IDs, a ULID is often the better choice — generate one with the ULID Generator.

A note on privacy

The UUID Generator uses your browser's own cryptographic randomness, so every ID is generated locally and never sent to a server.

Open the UUID Generator →

Common questions

What is a UUID?

A UUID (Universally Unique Identifier) is a 128-bit value, usually written as 32 hex digits in five groups — e.g. 550e8400-e29b-41d4-a716-446655440000. It is designed so that IDs generated independently are effectively never going to collide.

What is the difference between UUID v4 and v1?

v4 is random — the most common choice because it reveals nothing and needs no coordination. v1 is time- and MAC-address-based, which makes it roughly time-ordered but can leak when and where it was generated. For most applications, v4 is the right default.

When should I use a ULID instead?

A ULID is 128 bits like a UUID but is lexicographically sortable by creation time, so IDs sort in roughly chronological order. That is valuable for database keys and logs where you want recent records to cluster. If you need sortable IDs, prefer a ULID.

Are generated UUIDs sent to a server?

No. UUIDs are generated with your browser's cryptographic randomness locally, so the values never touch a network and are yours alone.