← All tools
// Generator

UUID Generator online

Generate v4 UUIDs — cryptographically random, instant copy

UUID Generator logo
by
CHUNKY
MUNSTER
// UUIDs

How to Use uuid-generator

  1. Click Generate to produce a new UUID v4.
  2. Use the Bulk mode to generate 10, 50, or 100 UUIDs at once.
  3. Click any UUID to copy it to the clipboard.
  4. Toggle uppercase/lowercase and hyphen format options.

UUID v4 (Universally Unique Identifier, version 4) is a 128-bit identifier generated from random bits with specific version and variant markers. The format is eight-four-four-four-twelve hex digits: xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx. They are used as primary keys in distributed databases, session identifiers, file names for uploaded assets, and anywhere a globally unique identifier is needed without a central authority.

Why UUID v4 for Primary Keys

Sequential integer IDs (1, 2, 3…) expose row counts and require a central counter. UUID v4 is generated independently by each service or process without coordination. The collision probability is astronomically low — you would need to generate approximately 2.7 × 10¹⁸ UUIDs to have a 50% chance of a single collision. Trade-offs: UUID v4 is larger (36 characters) than integers, slightly reduces B-tree index efficiency due to random ordering, and is not human-memorable. UUID v7 (time-sortable) solves the ordering problem.

Frequently Asked Questions

What is the probability of a UUID collision?

UUID v4 has 122 random bits (6 are version/variant markers). For a 50% collision probability among a set of UUIDs, you would need approximately 2.7 × 10¹⁸ UUIDs — generating 1 billion per second for 86 years. In practice, the probability is negligible.

What is the difference between UUID v1, v4, and v7?

v1: based on timestamp + MAC address — sortable but reveals machine and time info. v4: fully random — the most common choice. v7: timestamp-ordered random (RFC 9562) — combines the sortability of v1 with the privacy of v4. Ideal for database primary keys.

Is UUID the same as GUID?

GUID (Globally Unique Identifier) is Microsoft's implementation of UUID. The format is identical; the terms are interchangeable. Windows/COM use "GUID"; web and cross-platform standards use "UUID".

Should I store UUIDs as strings or binary in a database?

Storing as binary (16 bytes) is more efficient than the 36-character string. MySQL/MariaDB have a BINARY(16) type for this. PostgreSQL has a native UUID type. Postgres is more storage-efficient than VARCHAR(36). Most ORMs handle both representations transparently.

See also the UUID v4 Generator (dedicated tool), the Random Number Generator, and Password Generator.

📖 Reference: RFC 4122 — A Universally Unique IDentifier (UUID) URN Namespace