G
Great Online Apps
UUID Generator: Create and Validate UUID v4 Online

UUID Generator: Create and Validate UUID v4 Online

Generate up to 50 random UUID v4 values at once and validate any UUID. Learn the RFC 9562 format, the versions, and which one to use for database keys.

A UUID (universally unique identifier) is a 128-bit value written as 32 hexadecimal digits in five hyphen-separated groups, such as d0c19251-c545-4364-b0a9-0552dad84956. Version 4 UUIDs are generated from random numbers, so any computer can create one without checking a central registry and still be confident it is unique.

Our free UUID generator creates up to 50 version 4 UUIDs at once and includes a validator that checks whether a string is in UUID format. This guide explains how to read a UUID, which version to choose, and how to use UUIDs safely in code and databases.

UUID format explained (RFC 9562)

UUIDs are specified in RFC 9562, which replaced the older RFC 4122. The text form always has 36 characters: 32 hex digits plus 4 hyphens, in groups of 8-4-4-4-12.

xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx
  • M is the version: the first digit of the third group.
  • N is the variant: for standard UUIDs, the first digit of the fourth group is 8, 9, a or b.

Example: reading a UUID

d0c19251-c545-4364-b0a9-0552dad84956
              ^    ^
              |    variant digit: b (standard RFC variant)
              version digit: 4 (random)

The third group starts with 4, so this is a version 4 UUID. The fourth group starts with b, which marks the standard variant. Version and variant use 6 bits; the remaining 122 bits are random.

UUID versions compared

Version How it is built Typical use
v1 Timestamp, clock sequence and node ID (often a MAC address) Legacy systems
v3 MD5 hash of a namespace and a name Repeatable IDs from names (prefer v5)
v4 122 random bits General-purpose IDs
v5 SHA-1 hash of a namespace and a name The same input always gives the same UUID
v6 v1 fields reordered so they sort by time Upgrading v1 systems
v7 Unix timestamp in milliseconds plus random bits Database keys that sort by creation time
v8 Custom, vendor-defined layout Experimental or special-purpose formats

RFC 9562 also defines two special values: the Nil UUID (all zeros, 00000000-0000-0000-0000-000000000000) and the Max UUID (all f). For new systems that need time ordering, the RFC recommends version 7 over versions 1 and 6.

How unique is a UUID v4?

With 122 random bits, there are 2122, about 5.3 × 1036, possible version 4 UUIDs. By the birthday problem, you would need to generate about 2.71 × 1018 UUIDs before the chance of a single duplicate reached 50%. In practice, collisions come from broken random number generators, not from the format, so always generate UUIDs with a cryptographically secure source.

How to use the UUID Generator & Validator

  1. Open the UUID generator and enter how many UUIDs you need in How many?, from 1 to 50.
  2. Click Generate. The tool creates version 4 UUIDs on our server with PHP's cryptographically secure random_bytes() function and lists them one per line in lowercase.
  3. Click Copy to copy the whole list, ready to paste into a seeder, test fixture or spreadsheet.
  4. To check an existing value, paste it into UUID to validate. The status shows "Valid UUID" or "Invalid UUID format".

The validator checks the 8-4-4-4-12 hexadecimal pattern in either upper or lower case. It does not check the version or variant digits, so read those yourself using the layout above. Leading and trailing spaces and line breaks are ignored, but braces ({...}), a urn:uuid: prefix and the 32-digit form without hyphens are all reported as invalid, so remove those before validating.

Using UUIDs in code and databases

Most languages and databases can generate UUIDs natively:

  • JavaScript: crypto.randomUUID() in modern browsers (secure contexts) and Node.js returns a v4 UUID.
  • Python: uuid.uuid4() from the standard library.
  • PHP (Laravel): Str::uuid() returns v4 and Str::uuid7() returns v7.
  • PostgreSQL: gen_random_uuid() returns v4, stored in the native uuid type.
  • MySQL: UUID() returns a version 1 UUID, and UUID_TO_BIN() packs it into BINARY(16).

A few practical rules:

  • Store UUIDs as 16 bytes where possible. A native uuid column or BINARY(16) is less than half the size of a 36-character string.
  • Prefer v7 for primary keys on large tables. Random v4 values insert at random positions in a B-tree index, while time-ordered v7 values append near the end. The timestamp in a v7 UUID is Unix time in milliseconds, which you can inspect with the timestamp converter.
  • Write UUIDs in lowercase. RFC 9562 says UUIDs should be output in lowercase and treated as case-insensitive on input.
  • Do not use UUIDs as secrets. RFC 9562 warns that UUIDs should not be assumed hard to guess or used as access tokens. For API keys, reset links and passwords, use a dedicated generator such as our password generator, and read how to create strong passwords.
  • Mind public URLs. UUIDs hide record counts in URLs but are not readable. For pages people share, a slug generator creates friendlier paths, as our guide to SEO-friendly slugs explains.

Frequently asked questions

What is a UUID?

A UUID is a 128-bit identifier, written as 32 hexadecimal digits in the pattern 8-4-4-4-12, that can be generated independently by any system with a negligible chance of duplicates. The format is standardized in RFC 9562.

Are UUIDs really unique?

Not guaranteed, but close enough for practical use. A version 4 UUID has 122 random bits, so you would need about 2.71 × 1018 of them for a 50% chance of one collision.

What is the difference between a UUID and a GUID?

GUID (globally unique identifier) is Microsoft's name for the same 128-bit format. A GUID and a UUID are interchangeable, though Windows tools often display GUIDs in uppercase inside braces.

Which UUID version should I use?

Use version 4 for general-purpose random IDs and version 7 when you need IDs that sort by creation time, such as database primary keys. Use version 5 when the same input must always produce the same UUID.

How can I tell which version a UUID is?

Look at the first digit of the third group. In d0c19251-c545-4364-b0a9-0552dad84956, the third group is 4364, so it is a version 4 UUID.

Should UUIDs be uppercase or lowercase?

RFC 9562 says to output UUIDs in lowercase and to accept either case on input. Both forms represent the same value.

Ready to use this tool?

Try the UUID Generator & Validator now and simplify your workflow immediately.

G
Great Online Apps
Toggle sidebar