Skip to main content

rawops.dev

Skip to tool content

UUID Generator

Generate UUID v4 (random) and v7 (timestamp-based). Bulk generation, format options, and validation. Everything runs in your browser.

89313529-7f01-4462-8662-65c9db24b000

Bulk Generate

Validate UUID

Send to:

What is a UUID?

A UUID (Universally Unique Identifier), also known as GUID (Globally Unique Identifier), is a 128-bit identifier that is practically unique across space and time. UUIDs are formatted as 32 hexadecimal characters separated by hyphens: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.

With UUID v4, the probability of generating a duplicate is astronomically low — you'd need to generate ~2.71 quintillion (2.71×10¹⁸) UUIDs to have a 50% chance of collision.

UUID v4 vs v7

FeatureUUID v4UUID v7 (RFC 9562)
Source122 random bits48-bit timestamp + 74 random bits
SortableNoYes (time-ordered)
Database indexPoor (random distribution)Excellent (sequential inserts)
Contains timestampNoYes (ms precision)
Best forGeneral purpose, max randomnessDatabases, distributed systems, event IDs

When to Use UUIDs

  • Database primary keys — Avoid sequential IDs that expose record count. UUID v7 is ideal for databases.
  • Distributed systems — Generate IDs without central coordination. No ID collisions across services.
  • API request IDs — Track requests across microservices with unique correlation IDs.
  • File names — Unique temporary file names without collision risk.
  • Session tokens — Though purpose-built token generators (like secure random strings) are often better for auth tokens.

Generating UUIDs from the Command Line

# Linux
uuidgen                              # v4
cat /proc/sys/kernel/random/uuid     # v4

# macOS
uuidgen                              # v4 (uppercase)
uuidgen | tr '[:upper:]' '[:lower:]' # lowercase

# Python
python3 -c "import uuid; print(uuid.uuid4())"

# Node.js
node -e "console.log(crypto.randomUUID())"

# Generate multiple
for i in $(seq 10); do uuidgen; done

Related Tools & Resources