UUID Generator
Generate random UUID (Universally Unique Identifier) v4 values. Single or bulk generation.
What Is a UUID?
A UUID (Universally Unique Identifier), also called GUID (Globally Unique Identifier), is a 128-bit number used to identify information in computer systems. UUID v4 is randomly generated โ the chance of a collision is astronomically small (1 in 2^122).
Common Uses
- Database primary keys
- Session tokens and API keys (use a secure token generator for secrets)
- Distributed system identifiers
- File naming to avoid conflicts
UUID Versions Explained
A UUID (Universally Unique Identifier) is a 128-bit value written as 32 hexadecimal digits in five hyphen-separated groups, like 550e8400-e29b-41d4-a716-446655440000. The standard defines several versions, and they are not interchangeable:
- v1 (time-based): built from the current timestamp and the machine's MAC address. Sortable by creation time, but it leaks hardware information and is predictable.
- v3 / v5 (name-based): deterministic hashes of a namespace plus a name, so the same input always produces the same UUID.
- v4 (random): 122 random bits. This is what the tool above generates and the most common choice for database keys and general identifiers.
- v7 (time-ordered): a newer version that places a Unix timestamp first, giving the uniqueness of v4 with the database-friendly ordering of v1.
When Should You Use a UUID?
UUIDs shine when you need identifiers without a central authority: primary keys in distributed databases, idempotency keys for API requests, upload and file names that must never collide, and correlation IDs in logging. Because any client can generate one offline, you avoid the round-trips and locking that auto-increment integer keys require.
One caveat: a UUID is an identifier, not a secret. Seeing one v4 UUID doesn't let anyone guess another, but you should still use a dedicated secure token generator for session tokens, password-reset links, or API secrets.