UUID Generator

Generate different versions of UUID (Universally Unique Identifier).

UUID Generator
Generate UUID in different versions

Results will appear here...

What is UUID?

UUID (Universally Unique Identifier) is a 128-bit identifier that is unique across both space and time. It's used to identify information in computer systems without requiring a central registration authority. UUIDs are standardized by the Open Software Foundation (OSF) as part of the Distributed Computing Environment (DCE).

UUID Versions

Version 4 (Random)

Generated using random or pseudo-random numbers.

Pros: No identifying information, highly unpredictable.

Cons: Extremely small possibility of collision, not sortable chronologically.

Use cases: Most common for general purposes where privacy and unpredictability are important.

Version 7 (Time-ordered)

Generated using Unix timestamp with random data

Pros: Time-ordered, sortable, and includes timestamp information. Better for database indexing than v4.

Cons: Still in draft status, not all systems support it yet.

Use cases: When you need time-ordered UUIDs for database indexing and sorting.

Version 1 (Time-based)

Generated based on the current timestamp and MAC address of the computer.

Pros: Sequential, sortable, and includes origin information.

Cons: Potentially reveals MAC address, predictable, and can have collision if system clock goes backward.

Use cases: When you need sequential IDs or trace origin.

Version 5 (Name-based with SHA-1)

Generated by hashing a namespace identifier and name using SHA-1 algorithm.

Pros: Deterministic (same inputs produce same UUID), no need for coordination between systems.

Cons: Not random, could potentially reveal information if inputs are known.

Use cases: When you need to generate the same UUID from the same inputs consistently.

Nil UUID

A special UUID consisting of all zeros: 00000000-0000-0000-0000-000000000000.

Use cases: Default values, representing uninitialized state, or special placeholder.

UUID Format

A UUID is represented as a 32-digit hexadecimal number displayed in 5 groups separated by hyphens in the form 8-4-4-4-12 for a total of 36 characters (including hyphens).

The sections have different meanings depending on the UUID version, but generally include time information, version bits, variant bits, and random or node identifiers.

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

Common Uses of UUID

  • Database Keys: As primary keys that don't require centralized coordination.
  • Distributed Systems: For uniquely identifying entities across disconnected systems.
  • URLs and URIs: To create unique resource identifiers.
  • Cookies and Sessions: For identifying user sessions securely.
  • File Names: To ensure files have unique names in storage systems.