← Back to tool

UUID v4 · Random · RFC 4122

Generate UUID v4 Online

Updated: May 2026

UUID v4 is the most widely used version of universally unique identifiers. Fully random, with no dependency on a clock or host, it is used in APIs, databases, sessions and distributed systems worldwide.

Generate UUID v4 →

Free · No upload · Generated in the browser

UUID v4 structure

A UUID appears as 32 hexadecimal characters grouped in 5 segments:

xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx

The digit 4 at position 13 indicates version 4. The character y is 8, 9, a or b to mark the RFC 4122 variant. The remaining 122 bits are fully random.

example: f47ac10b-58cc-4372-a567-0e02b2c3d479

When to use UUID v4

  • Resource identifiers in a REST API (GET /users/{uuid}).
  • Primary keys in distributed databases where auto-increment sequences are not possible.
  • Session, password reset or email confirmation tokens.
  • Unique filenames to avoid collisions during file uploads.
  • Correlation IDs for logs across multi-service systems (trace ID, request ID).

UUID v4 vs v7: which to choose

UUID v4 is the right default when creation order does not matter. If you use UUIDs as primary keys in a relational database and index performance matters, UUID v7 is preferred because it is chronologically sortable.

For tokens, sessions, filenames and API identifiers, v4 remains the standard.

Frequently asked questions

What is a UUID v4?

A UUID v4 is a 128-bit randomly generated identifier per RFC 4122. It contains 122 random bits and 6 fixed bits to encode the version (4) and variant.

Is UUID v4 truly unique?

Practically yes. The probability of a collision between two randomly drawn UUID v4s is around 10⁻²⁷. For 1 billion UUIDs generated, the probability of a duplicate is still below 10⁻⁹.

Does the tool use a real random generator?

Yes. Generation uses crypto.getRandomValues(), the browser's native cryptographic API, which relies on OS entropy sources.

Can I store UUID v4 in a database?

Yes. In PostgreSQL, the native UUID type is recommended. In MySQL, use CHAR(36) or BINARY(16) to save space. In SQLite, TEXT or BLOB(16) work.