HandyBench

UUID Generator

Generate UUID v4, v7 and NanoIDs in bulk.

How to use the UUID Generator

  1. 1 Pick a format: UUID v4, UUID v7 or NanoID.
  2. 2 Choose how many IDs you need (and the NanoID length).
  3. 3 Toggle uppercase or remove dashes if desired, then generate and copy.

The three formats and their layouts

A UUID is 128 bits, written as 32 hex digits in five groups: 8-4-4-4-12. The version number sits in the first digit of the third group, and the variant is the first digit of the fourth, always 8, 9, a or b.

  • v4 comes from the browser's crypto.randomUUID(). Six bits are fixed for version and variant, so 122 bits are random. Because that function needs a secure context, it works on HTTPS pages and localhost only.
  • v7 (RFC 9562, published in 2024) is assembled here by hand. The first 48 bits are the current Unix time in milliseconds, followed by the version, then 74 random bits from crypto.getRandomValues.
  • NanoID draws characters from a 64-symbol URL-safe alphabet, using the low six bits of each random byte. Every character therefore carries exactly 6 bits, so the default 21 characters hold 126 bits, comparable to a v4 UUID in a shorter string.

Worked example: reading the v7 timestamp

The millisecond clock reading 1700000000000, which is 14 November 2023, 22:13:20 UTC, is 018bcfe56800 in hex. Any v7 UUID made at that instant therefore starts with 018bcfe5-6800-7. Ids made a second later start with a slightly larger prefix, so sorting them as text sorts them by creation time. A v4 id has no such structure.

FormatLengthSorts by timeBest for
UUID v436 charsNoGeneral identifiers, tokens you never index in order
UUID v736 charsYes, to the millisecondDatabase primary keys
NanoID2 to 64 chars (21 default)NoShort public ids in URLs

Details and limits

  • You can create 1 to 500 ids at once. Values outside that range are clamped, and "Copy all" copies the list one per line.
  • The Uppercase and No dashes options affect UUIDs only. NanoID ignores them and has its own length setting.
  • Two v7 ids made within the same millisecond share a timestamp and differ only in their random bits, so their relative order is not guaranteed. A batch of 500 will mostly share a few prefixes.
  • Random v4 keys scatter inserts across a database index, which is the reason v7 exists. Time-ordered keys append near the end of the index instead.
  • A UUID is an identifier, not a secret. For passwords or API keys, use the password generator, and for placeholder records see the mock data generator.

Examples

  • ▸ A v4 id such as 3b241101-e2bb-4255-8caf-4136c566a962 for a database row or a test fixture.
  • ▸ A v7 id from 14 Nov 2023, 22:13:20 UTC starts with 018bcfe5-6800-7, so newer ids sort after it.
  • ▸ A 21-character NanoID for a short public link, instead of a 36-character UUID.

Frequently asked questions

Are these UUIDs unique?

They are generated from your browser’s cryptographically strong randomness, making accidental collisions effectively impossible.

What is the difference between UUID v4 and v7?

v4 is fully random. v7 embeds a millisecond timestamp at the start so IDs sort chronologically — useful as database keys because they keep inserts roughly sequential.

When should I use a NanoID instead?

NanoID is shorter than a UUID and URL-safe, making it ideal for public-facing IDs in links and slugs while keeping a very low collision risk. The default 21 characters carry about 126 bits of randomness, and you can set any length from 2 to 64.

Is a GUID the same as a UUID?

Yes. GUID is the name Microsoft uses for the same 128-bit format. A v4 UUID from this tool works wherever a GUID is expected, for example in SQL Server or .NET.

Can two v7 UUIDs from the same millisecond be sorted?

Only by their random bits, so their relative order is not guaranteed. The 48-bit timestamp orders ids across different milliseconds, but this generator adds no counter for ids created within the same one.