onetooltorule.it

Back to tools

UUID Generator

Generate Universally Unique Identifiers (UUIDs) for your applications, databases, and more.

Options

150100

Preview

xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx

Where X is a hex digit (0-9, a-f) and Y is one of (8, 9, a, b)

Generated UUIDs

No UUIDs generated yet. Click the Generate button to create some!

What is a UUID?

A UUID (Universally Unique Identifier) is a 128-bit identifier that is unique across both space and time, with minimal effort to avoid generating duplicates. They are used in distributed systems as identifiers for information that needs to be unique within a system or network.

UUIDs are standardized by the Open Software Foundation (OSF) as part of the Distributed Computing Environment (DCE). The standard defines five versions of UUIDs, each with different generation algorithms and properties.

UUID Versions Explained

Version 1: Time-based

Generated using the current timestamp and the MAC address of the computer. This ensures uniqueness across space and time but may expose the MAC address, raising privacy concerns.

Example: 2f8d7b90-7a0e-11ed-a1eb-0242ac120002

Version 4: Random

Generated using random or pseudo-random numbers. This is the most common version used today because it provides good uniqueness without exposing system information.

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

Other Versions

Version 2 (DCE Security), Version 3 (Name-based using MD5), and Version 5 (Name-based using SHA-1) are less commonly used but serve specific purposes in certain applications.

Common UUID Use Cases

Database Records

UUIDs are perfect for database primary keys, especially in distributed databases where multiple servers might be generating IDs simultaneously.

Distributed Systems

In microservices architectures, UUIDs help track requests across multiple services without coordination.

Session IDs

Web applications use UUIDs for session identifiers to ensure each user's session is unique and secure.

Configuration

UUIDs can identify configuration versions or instances, making it easier to track changes over time.

Idempotency Keys

APIs use UUIDs as idempotency keys to ensure that the same operation isn't processed multiple times.

Content Addressing

UUIDs can serve as content identifiers in content-addressable storage systems and file repositories.

UUID Fun Facts

Astronomical Uniqueness

With 2^128 possible values (about 3.4 × 10^38), if every person on Earth generated 1 billion UUIDs per second, it would take over 100 years to have a 50% chance of a single collision.

UUID Structure

A standard UUID is represented as 32 hexadecimal digits, displayed in 5 groups separated by hyphens: 8-4-4-4-12 for a total of 36 characters (including hyphens).

Version and Variant

The version of a UUID is indicated by the 13th digit, and the variant is indicated by the 17th digit. For example, in a v4 UUID, the 13th digit is always "4".

UUID in Different Languages

UUIDs are supported natively in many programming languages: Java's UUID class, Python's uuid module, C#'s System.Guid, and JavaScript's crypto.randomUUID() function.