Reading a UUID

A UUID is written as 32 hexadecimal digits in five groups: 8-4-4-4-12. The first digit of the third group is the version. In 550e8400-e29b-41d4-a716-446655440000 it is 4. The first digit of the fourth group indicates the variant (8, 9, a or b for standard UUIDs).

Version 4: random

Version 4 UUIDs are 122 random bits plus the version and variant markers. They reveal nothing about when or where they were made, which is good for public identifiers. Their randomness has a cost in databases, though: new rows are inserted at random positions in the index, which can slow down large tables.

Version 7: time-ordered

Version 7, standardised in RFC 9562 in 2024, starts with a 48-bit Unix timestamp in milliseconds followed by random bits. UUIDs created later sort after earlier ones, so database indexes stay compact and inserts are faster — similar to an auto-increment number, but still unique across servers.

The trade-off: anyone can read the creation time from a v7 UUID.

Which to choose

UseRecommended
Database primary keysv7
Event or log IDs that should sort by timev7
Public IDs where creation time should stay privatev4
Test data, file names, general usev4

Generate and inspect UUIDs

  1. In the UUID Generator, choose version 4 or version 7.
  2. Enter how many you need — up to 1,000 — and pick a format, such as upper case, without hyphens or with braces.
  3. Select Generate UUIDs, then copy them or download a text file with one per line.
  4. To check an existing ID, paste it into Inspect a UUID to see whether it is valid, its version and variant, and the timestamp encoded in versions 1, 6 and 7.

Random values come from your browser’s cryptographically secure random number generator.

Frequently asked questions

Can two UUIDs ever be the same?

In theory, yes; in practice, the probability for properly generated v4 or v7 UUIDs is so small that it can be ignored.

Is a GUID the same as a UUID?

Yes. GUID is the name Microsoft uses for the same 128-bit format.