What is a UUID?
A UUID (Universally Unique Identifier) is a 128-bit identifier that is unique across space and time. UUID v4 uses random generation, v7 uses a timestamp prefix for sortability, and ULID is a Universally Unique Lexicographically Sortable Identifier. All generation happens in your browser using the Web Crypto API.
What a UUID is and why it is useful
A UUID (universally unique identifier) is a 128-bit value written as 32 hexadecimal digits in five groups, such as 550e8400-e29b-41d4-a716-446655440000. Its purpose is to let independent systems generate identifiers that will not collide, without asking a central database for the next number. That makes UUIDs ideal for primary keys, distributed systems, and offline clients that create records before syncing.
The chance of two randomly generated version-4 UUIDs colliding is so small it can be treated as zero in practice, which is why they are trusted to be unique across servers, databases, and time.
Versions: v4, v7, and ULID
Version 4 UUIDs are fully random and are the common default. Version 7 UUIDs embed a timestamp in their leading bits, so they sort in the order they were created — a real advantage for database indexes, where random v4 keys can hurt insert performance. ULIDs are a related, sortable, timestamp-based identifier written in a more compact alphabet.
UUIDs versus auto-increment IDs
Sequential database IDs are compact but reveal how many records exist and require a central authority to hand out the next value. UUIDs trade a little size for the ability to generate an identifier anywhere — on a client, offline, or across many servers — with no coordination and no risk of collision.
How to generate a UUID
- 1Choose a version. Pick v4 for random identifiers or v7 for time-sortable ones.
- 2Click Generate. A fresh identifier appears instantly. Use Bulk to produce ten at once.
- 3Copy the result. Copy the UUID into your database, code, or configuration.
Examples
A version-4 UUID
Fully random.
Input
Generate (v4)
Output
3f2504e0-4f89-41d3-9a0c-0305e82c3301
A version-7 UUID
Time-ordered — sorts by creation.
Input
Generate (v7)
Output
018f5b2e-9c7a-7c3e-b1a2-4e5f6a7b8c9d
UUID format
The shape of a UUID string.
| Part | Detail |
|---|---|
| Length | 36 characters (32 hex digits + 4 hyphens) |
| Groups | 8-4-4-4-12 |
| Version digit | 1st digit of group 3 (4 or 7) |
| Bits | 128 |
| Example | 550e8400-e29b-41d4-a716-446655440000 |
Frequently asked questions
Are these UUIDs really unique?+
For practical purposes, yes. A version-4 UUID has 122 random bits, so the odds of a collision are astronomically small and safe to ignore in real systems.
What is the difference between v4 and v7?+
v4 is fully random. v7 puts a timestamp in the high bits so the identifiers sort by creation time, which is friendlier to database indexes.
Should I use a UUID as a database primary key?+
Yes, especially in distributed systems. If insert ordering matters for your index, prefer v7 or ULID over random v4.
What is a ULID?+
A 128-bit identifier like a UUID but encoded in a compact, sortable alphabet with a leading timestamp, so ULIDs are both unique and naturally ordered.
Are the UUIDs generated privately?+
Yes. They are created in your browser and never sent anywhere, so each one is yours alone.
Is it free?+
Yes — generate as many as you like, free.
Are UUIDs safe to expose in URLs?+
A random v4 UUID does not reveal record counts or creation order, so it is safe to expose, unlike a sequential integer ID which leaks how many records exist.