UUID Generator

Secure random v4 and sortable v7 UUIDs, up to 1,000 at a time.

Runs in your browser Instant No sign-up
Version
How many
UUIDs
Done
Processed locally · nothing is uploadedProcessed locally

How to use the UUID generator

  1. Choose a Version: v4 (random), v7 (time-ordered) or ULID.
  2. Choose How many: 1, 10, 100 or 1,000.
  3. Adjust the format: Uppercase, Hyphens (on by default) and {Braces}.
  4. Click Generate for a new batch, then Copy or Download the list as uuids.txt.

v4 or v7?

v4 (random) v7 (time-ordered)
Layout 122 random bits 48-bit Unix ms timestamp, 12-bit counter, 62 random bits
Sort order Random Creation order
Database index New rows scatter across the index New rows append at the end
Reveals creation time No Yes, to the millisecond
Standard RFC 9562 (formerly RFC 4122) RFC 9562

A v7 batch looks like this. Note the shared timestamp prefix and the counter after the 7, which starts at a random value so a batch doesn’t reveal its size:

01a0e36e-ab69-7a3c-9b97-6d49a9705e0c
01a0e36e-ab69-7a3d-806c-cfaee5905c50
01a0e36e-ab69-7a3e-8112-669bef04c60a

Random primary keys make B-tree indexes in PostgreSQL, MySQL and SQL Server split pages and lose cache locality as tables grow. Time-ordered v7 keys keep inserts sequential while remaining globally unique, which is why many teams now default to v7 for new tables.

ULID

Choose ULID for a ULID: a 48-bit millisecond timestamp plus 80 random bits, written as 26 Crockford Base32 characters. ULIDs sort by creation time like UUID v7, are shorter in URLs, and avoid the letters I, L, O and U so they can’t be misread. IDs generated in the same millisecond increase by one, so a batch stays strictly ordered:

01M3W01W6R1N4SMTG0PGGQ3SKH
01M3W01W6R1N4SMTG0PGGQ3SKJ
01M3W01W6R1N4SMTG0PGGQ3SKK

The first 10 characters are the timestamp, so they match within a batch. Use Lowercase if your system stores IDs in lower case; the uppercase form is canonical. If your database has a native UUID type, UUID v7 is usually the better fit, since a ULID needs a text or binary column.

Formats

Options Example
Default 4581ee4c-acf1-473e-83f8-5b603191973e
Uppercase 4581EE4C-ACF1-473E-83F8-5B603191973E
Hyphens off 4581ee4cacf1473e83f85b603191973e
Uppercase, hyphens off, {Braces} {8B6ACC65E873408E9A7F69700911466F}

The canonical form is lowercase with hyphens. Parsers generally accept uppercase, but store and compare the canonical form to avoid duplicates.

Storing and validating UUIDs

Store UUIDs in a native type where one exists: PostgreSQL uuid, SQL Server uniqueidentifier, or BINARY(16) in MySQL. These use 16 bytes instead of 36 for a CHAR(36) column and compare faster. When validating input, check the canonical pattern of 8-4-4-4-12 hex digits, read the version from the first digit of the third group (4 or 7), and reject anything else at your API boundary.

Identifiers, not secrets

A v4 UUID is hard to guess, but it isn’t designed to be a secret: IDs are logged, put in URLs and shared between systems, and v7 even reveals when it was created. For API keys, reset tokens and passwords, use the Password Generator, which lets you choose the length and character sets and shows the entropy.

Generating UUIDs in code

crypto.randomUUID(); // v4 — browsers and Node.js 19+
import uuid
str(uuid.uuid4())
str(uuid.uuid7())  # Python 3.14+
-- PostgreSQL
SELECT gen_random_uuid();  -- v4 (PostgreSQL 13+)
SELECT uuidv7();           -- v7 (PostgreSQL 18+)

To read the timestamp inside a v7 UUID, take the first 12 hex digits as milliseconds and paste the decimal value into the Unix Timestamp Converter. For other kinds of identifiers and checksums, try the Hash Generator.

Frequently asked questions

Are these UUIDs random enough for production?

Yes. They are generated in your browser with crypto.getRandomValues, the same cryptographically secure source used for keys and tokens. Nothing is requested from a server.

Should I use UUID v4 or v7?

Use v7 for database primary keys and anything you want to sort by creation time: the first 48 bits are a millisecond timestamp, so new rows land at the end of the index instead of at random positions. Use v4 when the ID must not reveal when it was created.

Can two UUIDs ever collide?

In theory, yes; in practice, no. A v4 UUID has 122 random bits. You would need to generate roughly 2.7 quintillion of them before the chance of a single duplicate reaches 50%.

What is the difference between a UUID and a GUID?

None in practice. GUID is Microsoft's name for the same 128-bit identifier. Windows tools often print GUIDs in uppercase and wrapped in braces, which you can reproduce with the Uppercase and {Braces} options.

How are v7 UUIDs generated in the same millisecond kept in order?

All UUIDs in one batch share the same timestamp, and the next 12 bits hold a counter that starts at a random value and increases by one for each ID (RFC 9562, method 1). The rest is random. A batch of up to 1,000 therefore sorts in exactly the order it was generated.

Last updated