UUID Generator

This UUID generator creates random version 4 UUIDs (also called GUIDs) with your browser's cryptographically secure random number generator. Make one or up to 1,000 at a time, switch case, drop the hyphens, or create time-ordered UUID v7 and ULID values. A validator below checks any UUID you paste.

Type

Generated in your browser with the Web Crypto secure random generator. Nothing is sent to or logged by a server.

How do you generate a UUID?

A version 4 UUID is generated by taking 128 random bits from a secure random source and overwriting 6 of them with the version (4) and variant markers, which leaves 122 random bits. This page does exactly that with the Web Crypto API (crypto.randomUUID()), so each click gives fresh, unpredictable IDs that never leave your device.

How to use the GUID generator

  1. Pick UUID v4 for random IDs (the usual choice), UUID v7 for IDs that sort by creation time, or ULID for a shorter, time-sortable alternative.
  2. Enter how many you need (1–1,000) and press Generate.
  3. Choose uppercase, remove hyphens for a 32-character string, or add braces for the Windows GUID style.
  4. Copy the list or download it as a text file, one ID per line.

Anatomy of a random UUID v4

A UUID is 128 bits written as 32 hex digits in groups of 8-4-4-4-12. Two places carry fixed meaning. The first digit of the third group is the version, so every v4 UUID has a 4 there. The first digit of the fourth group holds the variant, which for standard UUIDs is always 8, 9, a or b:

xxxxxxxx-xxxx-4xxx-Nxxx-xxxxxxxxxxxx
               │    └── variant: 8, 9, a or b
               └─────── version: 4

The other 122 bits are random, giving 2122 (about 5.3 × 1036) possible values. That is why randomly generated v4 IDs can be treated as unique in practice, provided the random source is good. Browsers' crypto.randomUUID() and crypto.getRandomValues() are cryptographically secure; Math.random() is not and should never be used to create UUIDs. The layout is specified in RFC 9562, section 5.4.

UUID v7 and ULID: time-ordered IDs

Random v4 keys land all over a database index, which can slow inserts on very large tables. Version 7 (RFC 9562, section 5.7) fixes that by putting a 48-bit Unix timestamp in milliseconds at the front, followed by random bits. New IDs therefore sort after older ones. When you generate several in the same millisecond, this tool adds a counter so the list is still in creation order. Paste a v7 UUID into the validator to read back the moment it was created.

A ULID uses the same idea, a millisecond timestamp plus 80 random bits, but writes it as 26 characters of Crockford Base32 (for example 01ARYZ6S41TSV4RRFFQ69G5FAV), as described in the ULID specification. ULIDs are not UUIDs, but they store in the same 128 bits.

Create a UUID in code

JavaScript   crypto.randomUUID()
Node.js      require('node:crypto').randomUUID()
Python       import uuid; str(uuid.uuid4())
Java         java.util.UUID.randomUUID().toString()
C#           Guid.NewGuid().ToString()
PostgreSQL   SELECT gen_random_uuid();
macOS/Linux  uuidgen

To validate a UUID in code, a regular expression such as ^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$ (case-insensitive) checks the format, version and variant. You can try it in the regex tester. Time-based versions embed a timestamp you can compare with the epoch converter.

Frequently asked questions

What is UUID?

A UUID (universally unique identifier) is a 128-bit value used to label something uniquely without a central authority handing out numbers. It is written as 32 hexadecimal digits in five groups, like 3f2b8c1e-9d4a-4f6e-b1c2-7a8d9e0f1a2b, and the format is defined by RFC 9562.

What is a GUID?

A GUID (globally unique identifier) is Microsoft’s name for a UUID; the two terms describe the same 128-bit format. In Windows and .NET, GUIDs are often shown in uppercase and wrapped in braces, such as {3F2B8C1E-9D4A-4F6E-B1C2-7A8D9E0F1A2B}, which this generator can produce.

What is a UUID number?

A UUID number is the 128-bit integer behind a UUID string; the hex text is just a readable way of writing it. Because it is so large (2^128 possible values), it is normally stored as 16 bytes or as the 36-character string rather than as a decimal number.

What is a UUID used for?

UUIDs are used as identifiers that can be created anywhere without checking a central list: database primary keys, API resource IDs, file and message IDs, device IDs and request trace IDs. Random v4 UUIDs reveal nothing about when or where they were made, while v7 UUIDs start with a timestamp so new rows sort in creation order.