UUID Generator (v4, v7, ULID, NanoID)

Create one or up to 1,000 unique identifiers at once. Choose random UUID version 4, time-ordered UUID version 7 (RFC 9562), sortable ULIDs, or compact NanoIDs with your own length and alphabet. Format them in upper or lower case, with or without hyphens and braces, quoted, comma-separated or as a JSON array. IDs come from the browser's cryptographic random generator and are never sent anywhere. You can also paste a UUID to see its version, variant and embedded creation time.

Type

Output

0 IDs
 

Checks

  • Info UUID v4: 122 random bits from your browser's cryptographic random generator. The chance of two ever colliding is negligible.

Inspect a UUID

Runs entirely in your browser. Nothing you paste or open here is uploaded or stored.

How to use the UUID generator

  1. Choose a type: UUID v4, UUID v7, ULID or NanoID.
  2. Set how many you need (1–1,000).
  3. Format them: uppercase, hyphens and braces for UUIDs; separated by lines or commas, quoted, or as a JSON array.
  4. Copy or download the list. Generate new creates a fresh batch.
  5. Inspect a UUID by pasting it into the box at the bottom.

IDs are generated in your browser only after the page loads, never on a server, so nobody else receives the same values.

How the formats work

UUID v4 is 128 bits: 122 random, 4 for the version (4) and 2 for the variant, written as 32 hex digits in groups of 8-4-4-4-12, such as 9f1c2e4a-7b3d-4c5e-8f6a-1b2c3d4e5f60. The third group always starts with 4.

UUID v7 replaces the first 48 bits with the Unix time in milliseconds, then adds version, variant and 74 random bits. IDs created later sort later. When you generate a batch, each ID is one millisecond apart so the list is strictly ordered.

ULID also starts with a 48-bit timestamp, followed by 80 random bits, written in Crockford Base32 (no I, L, O or U to avoid confusion).

NanoID draws characters uniformly from an alphabet using rejection sampling, so no character is more likely than another, which is a common bug in home-made ID generators.

Worked examples

Example 1: primary keys for a new table

Generate 10 UUID v7 values and look at the beginnings: they share a prefix because they were created at almost the same time. Databases such as PostgreSQL store them in the uuid type and keep the index compact.

Example 2: test fixtures

Generate 50 UUID v4 values as a JSON array and paste them into seed data. Quoted and comma-separated output also drops straight into SQL IN (…) lists.

Choose NanoID with length 12 and an alphabet without look-alike characters, such as 23456789abcdefghjkmnpqrstuvwxyz. The check shows about 59 bits of randomness: fine for invite codes with rate limiting, too low for secret tokens.

Inspecting UUIDs

Paste any UUID to see its version and variant. For v7, and the older time-based v1 and v6, the creation time is decoded and shown in UTC. The nil UUID (all zeros) and the max UUID (all F) are recognised too.

Common mistakes

  • Using Math.random() for IDs. It isn’t cryptographically secure; this tool uses crypto.getRandomValues.
  • Storing UUIDs as text. A native uuid or 16-byte binary column is smaller and faster than 36 characters.
  • Treating UUIDs as secrets. They’re unique, not secret; use dedicated random tokens for password resets.
  • Mixing case inconsistently. UUIDs are case-insensitive, but string comparisons in code aren’t.

Frequently asked questions

Should I use UUID v4 or v7?

Use v7 for database primary keys: it starts with a timestamp, so new IDs are added at the end of an index instead of randomly, which keeps inserts fast. Use v4 when you don't want the ID to reveal when it was created.

Can two generated UUIDs ever be the same?

In theory, yes; in practice, no. A v4 UUID has 122 random bits. You would need to generate about 2.7 quintillion of them before there's a 50% chance of a single collision.

What's the difference between ULID and UUID v7?

Both put a millisecond timestamp first, so they sort by creation time. ULIDs are written as 26 characters of Crockford Base32, shorter and easier to copy; UUID v7 uses the standard 36-character UUID format that databases and libraries support natively.

How long should a NanoID be?

The default 21 characters from the 64-character alphabet give 126 bits of randomness, similar to UUID v4. Shorter IDs are fine for small, private datasets, but the tool warns below about 120 bits.

Are UUIDs good database keys?

They work well when IDs are created in many places. Time-ordered UUID v7 or ULID keeps index inserts efficient, unlike random v4, which scatters writes.

Sources