UUID Generator

// generate v1, v4, v5 uuids · bulk generation · copy all · nothing leaves your browser

generated uuids

What is a UUID?

A UUID (Universally Unique Identifier) is a 128-bit label used to uniquely identify objects in computer systems. They're written as 32 hexadecimal digits in the format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. The probability of generating two identical UUIDs is astronomically small.

Which version should I use?

  • v4 — random, most common, use for most cases
  • v1 — time-based, includes timestamp and MAC address
  • v5 — name-based using SHA-1, deterministic (same input = same UUID)

UUID versions explained

There are several UUID versions, each generated differently and suited for different use cases. Version 4 (v4) is the most common — it's randomly generated with 122 bits of entropy, making the probability of collision essentially zero for any practical application. Generate UUIDs for database primary keys, session IDs, file names, or any other identifier where uniqueness matters.

Version 1 (v1) combines the current timestamp with the MAC address of the generating machine. This makes v1 UUIDs sortable by generation time — useful when you need to retrieve records in insertion order without a separate timestamp column. However, the MAC address component raised privacy concerns, as it could identify the machine that generated the UUID.

UUID v7 (a newer standard) is gaining popularity because it combines a timestamp prefix with random data — giving the sortability of v1 without exposing MAC addresses. Many modern databases and frameworks are adopting v7 as the default. The format is always the same: 32 hexadecimal characters in the pattern 8-4-4-4-12.

UUIDs as database primary keys

Using UUIDs as primary keys has significant advantages in distributed systems. Auto-incrementing integer IDs require a central authority to assign the next number — in a distributed system with multiple database nodes, this creates a bottleneck. UUIDs can be generated independently on any node with essentially zero collision probability.

UUIDs also improve security — sequential integer IDs expose the total count of records and allow enumeration attacks. A UUID-based URL like /users/550e8400-e29b-41d4-a716-446655440000 reveals nothing about the user count and cannot be guessed. The trade-off is larger storage (16 bytes vs 4 bytes for an int) and slightly slower index performance on some databases.

Frequently Asked Questions

Are these UUIDs truly unique?+
v4 UUIDs use cryptographically secure random numbers via the browser's crypto.randomUUID() API. The chance of a collision is 1 in 5.3×10³⁶ — effectively impossible in practice.
What's the difference between UUID and GUID?+
Nothing meaningful — GUID (Globally Unique Identifier) is Microsoft's name for the same standard. They're interchangeable in practice and follow the same format.
When should I use v5 over v4?+
Use v5 when you need the same input to always produce the same UUID — for example, generating a consistent ID for a URL or username across different systems. Use v4 when you just need a random unique ID.