A UUID (Universally Unique Identifier) is a 128-bit code used to uniquely identify a piece of data or a resource in a system, without needing a central authority to assign it. It is written with 36 characters: 32 hexadecimal characters in five groups (8-4-4-4-12) separated by hyphens.
UUIDs (Universally Unique Identifiers) are codes designed to be unique across computer systems, like a universal “serial number”.
It is extremely unlikely for two UUIDs to be the same, even if they are generated on different systems at the same time.
You may have seen them somewhere before; they follow a format similar to this:
550e8400-e29b-41d4-a716-446655440000
(32 hexadecimal characters grouped as 8-4-4-4-12 and separated by hyphens)
UUID versions
The first character of the third group indicates the version. In the example above, 550e8400-e29b-41d4-a716-446655440000, it is a version 4 UUID.
| Version | How it is generated | When it is used |
|---|---|---|
| v1 | Date and time + device identifier (MAC address) | Older systems; it may expose device information |
| v3 | MD5 hash of a name + a namespace | When the same name must always produce the same UUID |
| v4 | Random | The most widely used in APIs and applications |
| v5 | SHA-1 hash of a name + a namespace | Same as v3, but with a more secure hash |
| v6 | Like v1, but with the date reordered | When you need to sort by creation date |
| v7 | Unix timestamp + random part | Modern databases: they are unique and sortable |
| v8 | Custom format | Special cases defined by each system |
In this video, I talk about a requirement that included this format and how to test it.
Frequently asked questions
What is a UUID?
A universally unique identifier: a code designed to be unique across computer systems, like a universal serial number.
What format does a UUID have?
32 hexadecimal characters in groups of 8-4-4-4-12 separated by hyphens, for example 550e8400-e29b-41d4-a716-446655440000.
How do I know which version a UUID is?
Look at the first character of the third group: that number is the version. For example, in 550e8400-e29b-41d4-a716-446655440000 it is a 4.
How do I validate a UUID in my tests?
Check that it has 36 characters, hyphens in the right positions, only hexadecimal characters (0-9 and a-f), the expected version, and that it is not repeated. A regular expression that works is: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$
Can two UUIDs be the same?
In theory yes, but the probability is so low that in practice they are considered unique. It is still worth testing how the system behaves if a duplicate UUID arrives.
Keep reading: Postman free plan update and What do software version numbers mean?. If you want to go deeper, I recommend the course API Testing with Postman.