Convert4Me – Convert4Me home

What Is a UUID? Versions, Uniqueness and When to Use Them

Updated October 22, 2026

A UUID is an ID that you can create anywhere, at any time, without asking a central server, and still be almost certain that it is unique. This guide explains how they work.

What a UUID looks like

A UUID is 128 bits written as 32 hexadecimal digits in five groups: 8-4-4-4-12, for example 018f3c2e-7b1a-7c4d-9a2b-3f5e6d7c8b9a. One digit shows the version and another the variant, so a program can tell what kind it is.

The versions in short

VersionBased onBest for
1Time and the computer's network addressLegacy systems
4Random numbersGeneral purpose IDs
5A SHA-1 hash of a nameThe same ID for the same input
7Unix time plus random numbersDatabase keys that sort by creation time

Can two UUIDs be the same?

A version 4 UUID has 122 random bits, which is about 5.3 × 10^36 possibilities. If you generated a billion UUIDs every second, it would take around 85 years before a collision had a 50% chance. In practice you can treat them as unique.

UUIDs or numbers as database IDs?

Auto-increment numberUUID
Size4 or 8 bytes16 bytes
Create without the databaseNoYes
Safe to show in a web addressGuessable (/orders/1001)Hard to guess
Merging data from several systemsIDs can clashNo clashes
Index speedFast, in orderv4 is scattered; v7 is in order

Which version should you pick?

  • Version 4 when you need a simple, unpredictable ID.
  • Version 7 for new database primary keys, because it keeps new rows in order and the index compact.
  • Do not use a UUID as a secret or a password. It is made to be unique, not unguessable by design.

Frequently asked questions

What is the difference between a UUID and a GUID?

None in practice. GUID is the name used in Microsoft products for the same 128-bit identifier.

Your privacy comes first. Your text and numbers stay in your browser and we never see them. If you allow it, we save what you type on this device and use Google Analytics to count visits. We never sell your data. Privacy Policy