ToolPane
Blog

UUID Generator

Generate cryptographically random UUIDs (v4) in bulk.

What is a UUID?

A UUID (Universally Unique Identifier) is a 128-bit identifier formatted as 32 hex digits in 5 groups: 8-4-4-4-12 (e.g., 550e8400-e29b-41d4-a716-446655440000). Also called GUID. Designed to be unique without a central authority. UUIDv4 uses random numbers, making collisions astronomically unlikely (2^122 possibilities).

UUID Versions

  • v1: Based on timestamp + MAC address (can leak device info).
  • v3: MD5 hash of a namespace + name (deterministic).
  • v4: Random — most commonly used (this tool generates v4).
  • v5: SHA-1 hash of namespace + name (deterministic, preferred over v3).
  • v7: Timestamp-ordered random UUID (new, great for database primary keys).
// JavaScript (browser)
crypto.randomUUID()
// "3b241101-e2bb-4d7a-8613-e2506e6d4a26"

// Node.js
const { randomUUID } = require('crypto');
randomUUID();

// Python
import uuid
str(uuid.uuid4())

// CLI (Linux)
uuidgen

When to Use UUIDs

  • Database primary keys (especially in distributed systems)
  • API resource identifiers
  • Session tokens
  • File naming to avoid collisions
  • Correlation IDs for distributed tracing

Frequently Asked Questions

Can two UUIDs ever be the same?
Theoretically yes, but practically no. UUIDv4 has 2^122 possible values. The probability of a collision after generating 1 billion UUIDs is about 0.00000000006%. You'd need to generate 2.7 quintillion UUIDs for a 50% collision chance.
Should I use UUIDs or auto-increment IDs?
Auto-increment is simpler and more space-efficient for single databases. UUIDs are better for distributed systems, preventing ID conflicts during merges, and when you don't want sequential IDs exposed in URLs.
Are UUIDs good for database performance?
Random UUIDv4 can cause B-tree fragmentation and slower inserts. Consider UUIDv7 (timestamp-ordered) or ULID for better index performance. Alternatively, use binary(16) storage instead of varchar(36).

Related Tools