UUID v4 Generator: Random UUIDs Online
Generate random UUID v4 identifiers in your browser with crypto.randomUUID(). RFC 9562 compliant, locally generated. Nothing uploaded.
A UUID (Universally Unique Identifier) is a 128-bit identifier in the format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx (8-4-4-4-12 hex digits). UUID v4 uses 122 random bits for uniqueness — the "4" at position 13 marks the version. This tool generates UUIDs using crypto.randomUUID(), which provides cryptographically secure randomness per RFC 9562. Generate up to 100 UUIDs at once, optionally in uppercase or without hyphens. All processing happens in your browser — nothing is uploaded.
UUID v4 format
A UUID v4 follows the standard 8-4-4-4-12 hexadecimal format:
550e8400-e29b-41d4-a716-446655440000 │ │ │ │ │ │ │ │ │ └── 12 hex (48 bits, random) │ │ │ └── 4 hex (16 bits, random, first char 8-b) │ │ └── 4 hex (version "4" + 12 random bits) │ └── 4 hex (16 bits, random) └── 8 hex (32 bits, random)
- Version: The 13th character is always "4" for UUID v4
- Variant: The 17th character is 8, 9, a, or b (RFC 4122/9562 variant)
- Total: 128 bits = 32 hex characters = 36 characters with hyphens
How to generate UUIDs in code
JavaScript (browser and Node.js 19+)
// Cryptographically secure, RFC 9562 compliant
const uuid = crypto.randomUUID();
// "550e8400-e29b-41d4-a716-446655440000"
// Bulk generation
const uuids = Array.from({ length: 10 }, () => crypto.randomUUID());Python
import uuid # Generate a random UUID v4 id = uuid.uuid4() print(id) # 550e8400-e29b-41d4-a716-446655440000 # As string without hyphens print(id.hex) # 550e8400e29b41d4a716446655440000
Other languages
- Java:
UUID.randomUUID() - Go:
github.com/google/uuidpackage - Ruby:
SecureRandom.uuid - PHP:
Ramsey\Uuid\Uuid::uuid4() - C#:
Guid.NewGuid()
UUID v4 in the shell
Generate on this page calls crypto.randomUUID() and prints lowercase RFC 9562 UUID v4 with hyphens — one ID per line. util-linux uuidgen --random writes that same layout. Default uuidgen is also random when a high-quality RNG is present; otherwise it falls back to time-based UUID v1, so pass --random to match this page. macOS uuidgen is v4 only and prints uppercase; pipe through tr 'A-F' 'a-f' to match this page's default. CPython 3.12+ python -m uuid prints str(uuid.uuid4()) — the same lowercase hyphenated v4. These commands mint a new ID each run — they do not decode or validate a pasted UUID.
util-linux uuidgen (Linux)
--random / -r forces a random-based UUID (version nibble 4). The kernel file below is the same lowercase v4 layout:
uuidgen --random # lowercase 8-4-4-4-12; version nibble is 4 cat /proc/sys/kernel/random/uuid
macOS uuidgen
Apple's uuidgen has no --random flag. Output is uppercase v4. Lowercase to match this page:
uuidgen # uppercase 8-4-4-4-12; version nibble is 4 uuidgen | tr 'A-F' 'a-f'
CPython python -m uuid
CPython 3.12+ can run the stdlib uuid module as a script. Default -u uuid4 calls uuid.uuid4() and prints lowercase 8-4-4-4-12 — the same layout this page writes. 3.14 added -C / --count (default 1). 3.12 and 3.13 reject that flag:
# Default is uuid4 (same as this page) python -m uuid # lowercase 8-4-4-4-12; version nibble is 4 # 3.14+: batch. This page clamps 1–100; the CLI has no 100 cap. python -m uuid -C 3 # three independent v4 lines
uuidgen --time and python -m uuid -u uuid1 are UUID v1 (clock plus node / MAC when present), not this generator. uuidgen --sha1 / --md5 with --namespace and --name, and python -m uuid -u uuid5 -n @dns -N www.example.com, are hash-based v5 / v3 — use the UUID v5 generator. -u uuid3 is MD5 (v3) and is not offered here. Recent util-linux uuidgen --time-v7 and CPython 3.14+ python -m uuid -u uuid7 are UUID v7 — use the UUID v7 generator. -u uuid6 and -u uuid8 are also 3.14+ and are not offered here. util-linux uuidgen --count is a time-based cache; it does not change random v4 and is not the CPython -C batch. For a batch on 3.12 or 3.13, loop python -m uuid or uuidgen --random, or use the crypto.randomUUID() / uuid.uuid4() block above. This page's Uppercase and Remove hyphens options are display-only; neither uuidgen nor python -m uuid has a hyphen-strip flag — use tr -d '-' for 32 hex digits. print() adds a newline after every ID, including the last; this page joins with LF and does not. PowerShell [guid]::NewGuid().ToString() is lowercase hyphenated v4 (.NET Guid). Version details are in UUID Versions Explained: v4 vs v1, v5, v7 and v8 (Format & Length).
How it works
- Enter count: Specify how many UUIDs to generate (1–100).
- Generate: Click Generate to create UUIDs using
crypto.randomUUID(). Each call produces a cryptographically random UUID v4. - Format options: Toggle Uppercase to convert to capital letters, or Remove hyphens to get the 32-character format. These are display options only — the underlying UUID is unchanged.
- Copy: Click Copy to copy all generated UUIDs to your clipboard, one per line.
Bulk generation
Generate up to 100 UUIDs at once by entering a count and clicking Generate. Each UUID is produced by a separate crypto.randomUUID() call—they are independent random values, not sequential. Copy pastes all UUIDs to your clipboard, one per line. For larger batches or programmatic use, see the code examples above.
UUID versions compared
| Version | Source | Use case |
|---|---|---|
| v1 | Timestamp + MAC address | Legacy systems (privacy concerns) |
| v4 | 122 random bits | General-purpose unique IDs |
| v5 | SHA-1 of namespace + name | Deterministic IDs from names |
| v7 | Unix ms timestamp + random | Database keys (sortable) |
FAQ
- What is a UUID?
- A UUID (Universally Unique Identifier) is a 128-bit identifier formatted as 32 hexadecimal digits in the pattern 8-4-4-4-12 (e.g., 550e8400-e29b-41d4-a716-446655440000). UUIDs are designed to be unique across space and time without requiring a central registry.
- What is UUID v4?
- UUID version 4 is a randomly generated UUID. It uses 122 random bits (the remaining 6 bits indicate version and variant). The "4" in position 13 identifies the version, and position 17 starts with 8, 9, a, or b to indicate the RFC 4122/9562 variant. This tool uses crypto.randomUUID(), which generates cryptographically secure random UUIDs.
- What are the odds of a UUID collision?
- Extremely low. With 122 random bits, you would need to generate about 2.71 quintillion (2.71×10¹⁸) UUIDs to have a 50% chance of a collision. For practical purposes, UUID v4 collisions are negligible — you could generate 1 billion UUIDs per second for 85 years before reaching that threshold.
- UUID v4 vs UUID v1 vs UUID v7 — which should I use?
- UUID v4 (random) is best for general-purpose unique IDs where ordering does not matter. UUID v1 embeds a timestamp and MAC address, which can leak information and is rarely used today. UUID v7 (RFC 9562) is time-ordered and ideal for database primary keys since it preserves insert order and improves index locality.
- Should UUIDs be uppercase or lowercase?
- Both are valid. RFC 9562 recommends lowercase for output, but parsers should accept both. This tool outputs lowercase by default, with an option to convert to uppercase. Most databases and APIs accept either case.
- Can I remove the hyphens from a UUID?
- Yes. The hyphens are formatting only — the underlying 128-bit value is the same. Some systems store UUIDs as 32 hex characters without hyphens. This tool provides a "Remove hyphens" option for that format.
- Does this tool upload my UUIDs?
- No. All UUIDs are generated entirely in your browser using crypto.randomUUID(). Nothing is sent to a server.
- Why might generation fail?
- crypto.randomUUID() requires a secure context (HTTPS or localhost). On plain HTTP pages, the method is unavailable and this tool will show an error.