UUID Generator

Generate random UUIDs (v4) and timestamp-based UUIDs (v1).

67574600-ad17-415a-8a44-a1ec9fa5ebee

UUID Format Breakdown

xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx
  • 4 indicates UUID version 4 (random)
  • y is the variant (8, 9, a, or b)
  • Total: 128 bits = 32 hex digits + 4 dashes = 36 characters

Code Examples

// Native UUID v4 (modern browsers/Node)
crypto.randomUUID(); // "550e8400-e29b-41d4-a716-446655440000"

// Or using the uuid package
import { v4 as uuidv4 } from 'uuid';
uuidv4(); // "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"

Frequently Asked Questions

What's the difference between UUID v1 and v4?

UUID v1 uses timestamp and MAC address (can reveal when/where created). UUID v4 is completely random (no information leakage). v4 is most commonly used for security reasons.

Are UUIDs truly unique?

UUID v4 has 122 random bits, giving 5.3×10^36 possibilities. Collision probability is astronomically low - you'd need to generate 1 billion UUIDs per second for 85 years to have a 50% collision chance.

Should I use UUID or ULID?

UUIDs are more widely supported. ULIDs are sortable by time and slightly shorter. Use UUID for compatibility, ULID when you need time-sortable identifiers.

Related Tools