UUID Generator

UUIDs (Universally Unique Identifiers) are 128-bit values used to identify information in computer systems. Version 4 UUIDs are randomly generated.

What Is a UUID?

A UUID (Universally Unique Identifier), also known as a GUID (Globally Unique Identifier), is a 128-bit number used to identify information in computer systems. The term GUID typically refers to Microsoft's implementation of UUIDs.

UUIDs are designed to be unique across both space and time. The probability of generating duplicate UUIDs is so low that it can be safely ignored for most practical purposes — roughly 1 in 2.71 quintillion.

Version 4 UUIDs — the most common type — are generated using random numbers. They have the format: xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx, where 4 indicates the version and y is one of 8, 9, A, or B.

UUID Structure

f47ac10b-58cc-4372-a567-0e02b2c3d479

│└──────┘│└──┘│└──┘│└──────────┘│

│ time │ ver │var │ node/id │

│ low │ │ │ │

  • Positions 13-16: Version number (4 for random UUIDs)
  • Position 17: Variant (8, 9, A, or B for RFC 4122)
  • Remaining: Randomly generated bits

Common Uses for UUIDs

  • Database primary keys: Universally unique identifiers that work across distributed systems.
  • Session IDs: Tracking user sessions in web applications.
  • Transaction IDs: Uniquely identifying financial or business transactions.
  • File names: Preventing filename collisions when uploading files.
  • API keys: Generating unique access tokens for APIs.
  • Message IDs: Identifying messages in messaging systems.

How to Use This UUID Generator

  1. Select quantity: Choose how many UUIDs you want to generate (1–100).
  2. Choose format: Select standard format, uppercase, with braces, or with quotes.
  3. Generate: Click the generate button to create your UUIDs.
  4. Copy: Click the copy button to copy individual UUIDs or all at once.

UUID Format Examples

Standard (lowercase)

f47ac10b-58cc-4372-a567-0e02b2c3d479

Uppercase

F47AC10B-58CC-4372-A567-0E02B2C3D479

With braces (common in Windows)

{f47ac10b-58cc-4372-a567-0e02b2c3d479}

With quotes

"f47ac10b-58cc-4372-a567-0e02b2c3d479"

UUID Versions

VersionDescription
Version 1Time-based using MAC address and timestamp
Version 3Name-based using MD5 hashing
Version 4Randomly generated (most common)
Version 5Name-based using SHA-1 hashing
Version 6-8Newer standards for specific use cases

UUID Collision Probability

The probability of generating duplicate Version 4 UUIDs is astronomically low. To put it in perspective:

  • Generating 1 billion UUIDs per second for 100 years would create approximately 3.15 quadrillion UUIDs
  • The chance of a collision in this scenario is roughly 0.0000000000000001%
  • You are more likely to be struck by lightning while winning the lottery

This makes UUIDs safe to use without checking for duplicates in almost all practical applications.

Tips for Working with UUIDs

Database indexes: UUIDs are random, which can cause index fragmentation. Consider using sequential UUIDs (Version 1 or 6) for database primary keys if insertion performance is critical.

Storage size: UUIDs are 128 bits (16 bytes). Storing as binary rather than strings can save space and improve performance.

Readability: For user-facing IDs, consider shorter alternatives like nanoids or hashed IDs. UUIDs are long and hard to type.

Security: While UUIDs are unique, they are not secret. Version 1 UUIDs contain MAC addresses and timestamps—avoid them if privacy is a concern.

Frequently Asked Questions

What is a UUID?

A UUID (Universally Unique Identifier) is a 128-bit number used to identify information in computer systems. Version 4 UUIDs are randomly generated and have extremely low collision probability.

How unique are UUIDs?

Version 4 UUIDs have 2^122 possible values. The chance of collision is astronomically low — roughly 1 in 2.71 quintillion.

When should I use UUIDs?

Use UUIDs for database primary keys, session IDs, API keys, transaction IDs, or anywhere you need guaranteed unique identifiers without central coordination.

Related Tools