UUID Generator
Generate RFC 4122 compliant UUIDs (Universally Unique Identifiers). Version 4 UUIDs are randomly generated and have 122 bits of entropy.
Version:v4Entropy:122 bits
Generated Values
Usage Examples
SQL (Primary Key)
CREATE TABLE users (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
email VARCHAR(255) NOT NULL
);
INSERT INTO users (id, email) VALUES
('uuid-here', '[email protected]');JavaScript
// Native (Node.js 14.17+ / modern browsers)
const uuid = crypto.randomUUID();
// With uuid package
import { v4 as uuidv4 } from 'uuid';
const id = uuidv4();UUID v4 structure
xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx
- The
4indicates version 4 (random) - The
yis one of 8, 9, a, or b (variant 1) - All other characters are random hex digits
- Total: 32 hex characters = 128 bits (122 random + 6 version/variant)
Bulk Generation
UUIDs
Generate in Terminal
macOS / Linux
$
uuidgenLinux (kernel)
$
cat /proc/sys/kernel/random/uuidPython
$
python3 -c "import uuid; print(uuid.uuid4())"Node.js
$
node -e "console.log(require('crypto').randomUUID())"