UUID Generator (v4)

Generate random UUID v4 identifiers online. Create unique 128-bit identifiers for databases, APIs, and software development.

Format Examples
FormatExampleLength
Standard550e8400-e29b-41d4-a716-44665544000036
No dashes550e8400e29b41d4a71644665544000032
Uppercase550E8400-E29B-41D4-A716-44665544000036
Braces{550e8400-e29b-41d4-a716-446655440000}38
URNurn:uuid:550e8400-e29b-41d4-a716-44665544000045
UUID Version Reference
VersionMethodRandom BitsSortableBest For
v1Time + MAC~60YesAuditable records
v3MD5 hashN/ANoDeterministic IDs
v4Random122NoGeneral purpose
v5SHA-1 hashN/ANoNamespace IDs
v7Unix ms + rand~74YesDatabase PKs
Planning notes, formulas, and examples

About the UUID Generator (v4)

A UUID (Universally Unique Identifier) is a 128-bit label used to uniquely identify information in computer systems without requiring a central registration authority. The version 4 UUID is generated using random or pseudo-random numbers, making it the most widely used variant in modern software development.

This UUID generator creates valid v4 UUIDs in the standard 8-4-4-4-12 hexadecimal format. Whether you need identifiers for database primary keys, API request tracing, session tokens, or distributed-system message IDs, it produces cryptographically random UUIDs ready to copy and paste.

UUIDs are essential in microservices architectures, event-driven systems, and any application that must produce unique identifiers without database round-trips. With approximately 5.3 × 10³⁶ possible v4 UUIDs, the probability of a collision is astronomically low, making them safe for virtually every use case.

When This Page Helps

Generating UUIDs by hand or looking up online services interrupts your development flow. This generator produces valid v4 UUIDs in one click, directly in your browser, with no server requests and no data stored anywhere. Use it whenever you need a quick unique ID for testing, prototyping, or configuration files.

How to Use the Inputs

  1. Click the "Generate UUID" button.
  2. A random v4 UUID appears in standard format (e.g., 550e8400-e29b-41d4-a716-446655440000).
  3. Copy the UUID and use it in your code, database, or configuration.
  4. Click again to generate a new UUID as many times as needed.
  5. Each UUID is generated entirely in your browser using cryptographic randomness when available.
Formula used
A v4 UUID follows the pattern: xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx, where x is any hexadecimal digit and y is one of 8, 9, a, or b. The "4" in the third group indicates version 4 (random). The variant bits in the fourth group restrict y to {8, 9, a, b}.

Example Calculation

Result: 550e8400-e29b-41d4-a716-446655440000

The generator produces a 128-bit identifier formatted as five groups of hexadecimal digits separated by hyphens. The third group always starts with 4 (version), and the fourth group's first digit is 8, 9, a, or b (variant). Every generation yields a new unique value.

Tips & Best Practices

  • Use v4 UUIDs for primary keys in distributed databases where auto-increment is impractical.
  • Store UUIDs as 16-byte binary values in databases for better performance than 36-character strings.
  • Never assume UUIDs are sequential—they are random and not suitable for ordering.
  • For extremely high-volume systems, consider UUID v7 (time-sortable) if ordering matters.
  • Always validate UUID format when accepting user-supplied IDs in your API.
  • In PostgreSQL, use the native uuid column type for efficient storage and indexing.

Understanding UUID Versions

The UUID specification (RFC 4122 and its successor RFC 9562) defines several versions. Version 1 concatenates a timestamp with the generating machine's MAC address, offering rough time ordering but leaking hardware identity. Versions 3 and 5 hash a namespace and name with MD5 and SHA-1, producing deterministic identifiers.

Version 4 replaces all fields (except version and variant markers) with random bits, making it the simplest and most privacy-friendly variant. The newer version 7 (RFC 9562) embeds a Unix millisecond timestamp while keeping random trailing bits, combining time-sortability with uniqueness.

Practical Usage Tips

When storing UUIDs in relational databases, convert them to binary(16) to save storage and improve index performance. Many databases—PostgreSQL, MySQL 8+, SQL Server—offer native UUID column types.

In API design, UUIDs make excellent resource identifiers because they expose no information about creation order or volume. This prevents enumeration attacks and simplifies merging data from multiple sources.

Sources & Methodology

Last updated:

Frequently Asked Questions

  • A version 4 UUID is a 128-bit identifier generated from random or pseudo-random numbers. It follows the format xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx and is defined by RFC 4122. The "4" marks the version, and the variant bits restrict certain positions.