Generate UUIDs (v1, v3, v4, v5) or ULIDs, one at a time or 1,000 at once for seeding a table. Use v4 when you only need a unique value, and ULID when you want ids that sort by the time they were made.
Use v4 unless you have a reason not to. It carries 122 random bits from the browser's crypto API and needs no coordination between machines.
Pick ULID for database keys. A 48-bit millisecond timestamp comes first, then 80 random bits, so new rows land at the end of the index instead of scattering across it.
Built from a timestamp and a node ID. Anyone holding the id can read when it was made, so keep it out of public URLs.
Deterministic: the same namespace and name always give the same ID. v3 hashes with MD5 and v5 with SHA-1, so prefer v5 for anything new.
// Generated UUID v4
34a02305-6548-430c-a9df-6d7c7c34d284 Up to 1,000 ids per click, one per line. That is enough to seed a table or fill a load test without writing a script.
Random bits come from crypto.getRandomValues() in this tab, and the page makes no network call with them. This page does not generate UUID v7; use a library for that.
const { randomUUID } = require("node:crypto");
// UUID v4: random, built into Node 14.17+ and every modern browser
console.log(randomUUID()); // e.g. 3b241101-e2bb-4255-8caf-4136c566a962
// Several at once
console.log(Array.from({ length: 3 }, () => randomUUID()));
// v1, v3, v5 need the "uuid" package: npm i uuid
// const { v5: uuidv5, v1: uuidv1 } = require("uuid");
// uuidv5("example.com", uuidv5.DNS); // same input always gives the same ID
// ULID needs the "ulid" package: npm i ulid
// const { ulid } = require("ulid");
// ulid(); // 01ARZ3NDEKTSV4RRFFQ69G5FAV In the browser, crypto.randomUUID() is only available on secure contexts (https or localhost).
<?php
// UUID v4 with no dependencies (PHP 7+)
function uuid4(): string {
$b = random_bytes(16);
$b[6] = chr((ord($b[6]) & 0x0f) | 0x40); // version 4
$b[8] = chr((ord($b[8]) & 0x3f) | 0x80); // RFC 4122 variant
return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($b), 4));
}
echo uuid4(), PHP_EOL;
// UUID v5 (SHA-1) from a namespace and a name
function uuid5(string $namespace, string $name): string {
$ns = hex2bin(str_replace('-', '', $namespace));
$h = sha1($ns . $name, true);
$h[6] = chr((ord($h[6]) & 0x0f) | 0x50);
$h[8] = chr((ord($h[8]) & 0x3f) | 0x80);
return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex(substr($h, 0, 16)), 4));
}
echo uuid5('6ba7b810-9dad-11d1-80b4-00c04fd430c8', 'example.com'), PHP_EOL;
// cfbff0d1-9375-5685-968c-48ce8b15ae17
// For v1, v7 and ULID use ramsey/uuid or symfony/uid via Composer. import uuid
print(uuid.uuid4()) # random
print(uuid.uuid1()) # time + MAC address
print(uuid.uuid5(uuid.NAMESPACE_DNS, "example.com"))
# cfbff0d1-9375-5685-968c-48ce8b15ae17 (always the same)
print(uuid.uuid3(uuid.NAMESPACE_URL, "https://example.com"))
# Generate many
ids = [str(uuid.uuid4()) for _ in range(5)]
print("\n".join(ids))
# ULID: pip install python-ulid
# from ulid import ULID; print(ULID()) A UUID is 128 bits written as 32 hex digits in 8-4-4-4-12 groups. The first digit of the third group is the version, so you can spot a v4 by the 4 in position 15. RFC 9562 (2024) added v6 and v7. v7 puts a Unix millisecond timestamp in the first 48 bits, so it sorts by creation time like a ULID but is still a standard UUID. For ordered database keys, v7 is the default choice now.
ULID solves the same sorting problem with a different encoding: 26 characters of Crockford Base32, 48 bits of time then 80 random bits. It has no hyphens, is case-insensitive and sorts as a plain string by creation time. A ULID is not a UUID, but it is the same 128 bits, so it fits in the same column type.
This tool follows the specifications below. Read them when you need the exact normative wording, for example to settle an edge case between two implementations.
Use v4 by default: it is random and needs no coordination between machines. Use v5 (or v3) when the same input must always produce the same ID, and ULID when IDs should sort by creation time, for example as database keys. v1 contains a timestamp but does not sort as a string, because its time fields are stored low bits first.
Both derive an ID from a namespace and a name. v3 hashes with MD5 and v5 with SHA-1. Use v5 for anything new; v3 exists for compatibility with older systems.
Yes. v4 comes from the browser's cryptographically secure generator (crypto.randomUUID() or the uuid library on top of crypto.getRandomValues()), and the random part of a ULID uses crypto.getRandomValues() directly. Both are suitable for identifiers and tokens.
A 26-character, case-insensitive identifier: 48 bits of millisecond timestamp plus 80 bits of randomness, written in Crockford Base32. ULIDs sort as plain strings by creation time and are URL-safe.
Yes. Set Count to anything up to 1,000, click Generate, and Copy takes the whole list, one ID per line.
The first 10 characters of a ULID encode a millisecond timestamp. Decode them to a number and the Unix timestamp converter shows it as a date. When the ids go into a fixture file, the JSON formatter tidies it.