UUID Generator/ v4 · v7
Generate UUID v4 (random) and UUID v7 (time-ordered) in bulk. Supports uppercase, no-dash format, and one-click copy.
Did this tool solve your problem?
What is a UUID
A UUID (Universally Unique Identifier) is a 128-bit identifier, typically shown as 32 hex characters like `550e8400-e29b-41d4-a716-446655440000`. UUID v4 is randomly generated with an astronomically low collision probability — you'd need to generate 103 trillion UUIDs for a 50% chance of one duplicate. Perfect for distributed system primary keys.
UUID version differences
v1 uses timestamp + MAC address (traceable), v3/v5 uses namespace + hash (deterministic), v4 is purely random (most common), v7 is time-sorted + random (new standard, balances ordering with randomness). v4 is standard for everyday development; v7 is ideal for database primary keys that need chronological ordering.
Code Examples
// UUID v4 (browser & Node 19+)
const id = crypto.randomUUID();
// "110e8400-e29b-41d4-a716-446655440000"
// Node.js (< 19)
import { randomUUID } from "crypto";
const id = randomUUID();
// npm: uuid package
import { v4 as uuidv4, v7 as uuidv7 } from "uuid";
console.log(uuidv4());
console.log(uuidv7());import uuid # UUID v4 print(uuid.uuid4()) # "a8098c1a-f86e-11da-bd1a-00112444be1e" # UUID v5 (name-based, deterministic) print(uuid.uuid5(uuid.NAMESPACE_DNS, "example.com")) # As hex (no dashes) print(uuid.uuid4().hex)
// go get github.com/google/uuid import "github.com/google/uuid" // UUID v4 id := uuid.New() fmt.Println(id.String()) // UUID v7 (google/uuid v1.6+) id7, _ := uuid.NewV7() fmt.Println(id7.String())
-- PostgreSQL
SELECT gen_random_uuid(); -- v4
INSERT INTO users (id, name)
VALUES (gen_random_uuid(), 'Alice');
-- MySQL 8+
SELECT UUID(); -- v1 format
-- For v4: use application layer
-- SQLite (with extension or app)
SELECT lower(hex(randomblob(4))) || '-' ||
lower(hex(randomblob(2))) || '-4' ||
substr(lower(hex(randomblob(2))),2) || '-' ||
substr('89ab', abs(random()) % 4 + 1, 1) ||
substr(lower(hex(randomblob(2))),2) || '-' ||
lower(hex(randomblob(6)));