Skip to content
OddsockLocal
Local
Source text
UUID version4
How many1
ReadyRuns in this browser. Nothing is uploaded.

How to use

  1. Choose UUID version 4 or 7.
  2. Set How many. 1 is the start.
  3. Copy the lines. Each id is new.
  4. For version 4, check that the first character of the third group is 4.

What is UUID generator?

A UUID is 128 bits written as 8-4-4-4-12 hex digits. Version 4 is random. One draw is db58e856-ecd0-466f-bc66-404d841e763a. The third group starts with 4, which is the version, and the fourth group starts with b, which is the RFC variant (the top two bits are 10). Those two nibbles are fixed by the spec. The rest is random, so the next click is a different id.

Read more

Version 7 is time-ordered. The first 48 bits are a Unix timestamp in milliseconds, the version nibble is 7, and the variant bits are still 10. Ids created a moment apart sort roughly in time order, which is kinder to database indexes than pure random v4 keys. The page does not let you set the timestamp. It uses the clock.

How many prints one id per line. This is not a Nano ID: the hyphens and the version nibble are required. Nothing is stored. Generating a batch does not check whether a value already exists in your database.

Use cases

  • A fixture needs a version 4 UUID and you want to see the 4 in the third group before you paste it into a test.
  • A new table should use version 7 so inserts land near each other in the index.
  • You need twenty ids, one per line, without writing a loop.
  • Someone sent db58e856-ecd0-466f-bc66-404d841e763a and you want to confirm it is version 4, not version 1 or 7.

One version 4 UUID

UUID version 4, how many 1.

db58e856-ecd0-466f-bc66-404d841e763a. The third group starts with 4, so the version is 4. The fourth group starts with b, so the variant is RFC 4122.

Why use Oddsock

The version nibble is the part worth looking at. A string with hyphens is not automatically a version 4 UUID.

Related tools

Using this tool

Look at the first character of the third group. db58e856-ecd0-466f-bc66-404d841e763a has 4 there, so it is version 4. A version 7 id has 7 there, and the front of the id is a timestamp.