UUID Generator
UUID (Universally Unique Identifier) v4 is generated using random numbers. The format is xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx where:
- x is any hexadecimal digit (0-9, a-f)
- 4 indicates UUID version 4
- y is one of 8, 9, a, or b (variant indicator)
The probability of generating duplicate UUIDs is astronomically low (approximately 1 in 5.3 x 10^36 for two random UUIDs to match).
About the UUID Generator
The UUID Generator produces Universally Unique Identifiers (also called GUIDs) in the version 4 format, which are built almost entirely from random data. A UUID is a 128-bit value rendered as 36 characters — 32 hexadecimal digits split into five groups by hyphens, like 550e8400-e29b-41d4-a716-446655440000. Version 4 specifically reserves a few bits to mark the version and variant, leaving 122 bits of randomness, which is what makes accidental collisions astronomically unlikely.
Because UUID v4 relies on randomness rather than a central authority, you can generate identifiers independently across many machines, services, or offline clients without any coordination and still trust they will not clash. This is the core advantage over auto-incrementing integer IDs from a database: there is no single counter to bottleneck, and IDs can be created before a record is ever persisted. The probability of a collision is so small that it is treated as effectively zero for practical purposes.
Common use cases include primary keys for distributed databases, correlation IDs for tracing a request across microservices, idempotency keys for safely retrying API calls, file and object names that must not collide, and session or device identifiers. Front-end code often generates a UUID to optimistically create a record before the server confirms it. It pairs well with a Hash Generator when you need deterministic IDs and a Password Generator when you need human-usable secrets rather than machine identifiers.
A practical tip: UUID v4 values are random, so they do not sort chronologically and can fragment database indexes that expect sequential inserts. If insertion order or index locality matters, consider time-ordered variants like UUID v7 or ULID, which embed a timestamp prefix. Also note UUIDs are identifiers, not secrets — never use them in place of a cryptographically secure token for authentication.
Frequently asked questions
- What does the version 4 in UUID v4 mean?
- Version 4 indicates the UUID is generated from random or pseudo-random numbers, as opposed to version 1 (time and MAC based) or version 5 (name-based hashing). It provides 122 bits of randomness.
- How likely are two UUIDs to collide?
- Extraordinarily unlikely. With 122 random bits you would need to generate billions of UUIDs per second for many years before a collision became probable, so collisions are treated as negligible in practice.
- Can I use a UUID as a primary key in my database?
- Yes, and it is common in distributed systems. Be aware random UUID v4 values do not sort by creation time and can reduce index locality; time-ordered variants like UUID v7 or ULID address this.
- Are UUIDs secure enough to use as secret tokens?
- No. A UUID is an identifier, not a secret. Use a cryptographically secure random token for authentication, password reset links, or API keys.
- What is the difference between a UUID and a GUID?
- They are the same thing. GUID (Globally Unique Identifier) is Microsoft's name for the same 128-bit identifier standard that the rest of the industry calls a UUID.
Generate MD5, SHA1, SHA256, SHA512 hashes
Generate secure random passwords
Generate random numbers within a range
Encode and decode Base64
Encode and decode URL-encoded strings
Parse URL into components