Skip to the content

UUID Generator

Random UUIDs (v4) and time-ordered ones (v7), one or a thousand at a time.

Kind

Random from start to end. The usual choice.

 
Share this tool:TwitterFacebookLinkedInWhatsAppEmail

Which version to pick

A UUID is a 128-bit number, written as 32 hexadecimal digits in five groups. Anybody can make one without asking a central registry and still be confident that nobody else has the same one. The 13th digit is the version: the recipe it was made with.

Version 4 is random. 122 of the 128 bits come straight from a random generator; the other six mark the version and the layout. It says nothing about where or when it was made, which makes it the safe default for identifiers that end up in URLs or are shared with other parties.

Version 7 starts with the current time in milliseconds (48 bits) and fills the rest with random bits, so UUIDs made later sort after the ones made earlier. That matters in a database: new rows land at the end of the index instead of at random places all over it, which keeps inserts quick and related rows close together. For a primary key, version 7 is usually the better choice.

The price is that a version 7 UUID gives away when it was made. Paste one into the inspector to see the timestamp, and do not use it where the creation time should stay private.

Nil is 00000000-0000-0000-0000-000000000000, a placeholder that means "no UUID here".

Can two of them collide?

In theory, yes. In practice you can ignore it. A version 4 UUID has 2122 possible values, about 5.3 undecillion (a 5 followed by 36 digits). If you made a billion of them every second, it would take about 86 years before a single duplicate became more likely than not.

This only holds when the random source is good. The UUIDs here come from your browser's cryptographic generator, the one that also makes encryption keys, and they are made on your device.

Several version 7 UUIDs in one millisecond

A computer makes many UUIDs within the same millisecond. They would all carry the same timestamp and come out in random order. To keep a batch sorted, the 12 bits after the version digit are random for the first UUID of a millisecond and count up by one for each that follows. The last 62 bits are random every time. The standard lists this as one of the accepted methods.

UUID or GUID?

The same thing. GUID, "globally unique identifier", is the name Microsoft uses. Windows tools tend to write them in uppercase and in braces, as in {3F2504E0-4F89-41D3-9A0C-0305E82C3301}; nearly everything else uses lowercase without braces. Upper and lower case mean the same value.

The other versions

VersionMade from
1The time and an identifier of the computer, originally its network card address
2A variant of version 1 for the DCE security system. Rarely seen
3A name, hashed with MD5. The same name always gives the same UUID
5A name, like version 3, but hashed with SHA-1
6The same contents as version 1, rearranged so that it sorts by time
8Whatever the application wants: a free-form layout

Versions 1, 6 and 7 contain a timestamp, which the inspector shows. The formats are defined in RFC 9562, which replaced RFC 4122 in 2024 and added versions 6, 7 and 8.

See all 9