GintiCalcEvery calculation

IDForge

UUID Generator

Generate one UUID or a bulk batch — using the browser's cryptographic random source.

UUID versions and when to use each

Every UUID is 128 bits written as 32 hex characters in five dash-separated groups. The version digit sits at the start of the third group.

VersionGenerated fromSortable?Typical use
v1Timestamp plus MAC addressPartlyLegacy; leaks the host's MAC
v3MD5 hash of a namespace and nameNoDeterministic IDs, legacy
v4Random bitsNoThe default choice for most IDs
v5SHA-1 hash of a namespace and nameNoDeterministic IDs from a stable name
v7Unix timestamp plus random bitsYesDatabase keys, where ordering helps

v4 has 122 random bits, so collisions are not a practical concern. v7 is worth preferring for primary keys because time-ordered values keep B-tree indexes from fragmenting the way random v4 values do.

When to use v4

v4 UUIDs are random and unguessable — perfect for primary keys, session tokens, and anywhere you need a unique ID without coordination. Avoid for sortable IDs (use ULID or UUIDv7 instead).

Frequently asked questions

I need unique IDs for my database rows — should I use UUIDs?

UUID v4 works well as a primary key when you don't need sortability. For time-sortable IDs (useful for database indexing), consider ULID or UUID v7 instead. UUIDs are 128-bit, giving a collision probability near zero.

Can two UUIDs ever be the same?

Theoretically yes, but practically no. With 122 random bits in a v4 UUID, you'd need to generate about 2.7 billion UUIDs per second for 100 years to have a 50% chance of a single collision.

What's the difference between UUID v1 and v4?

UUID v1 encodes the timestamp and MAC address of the generating machine, making it sortable but potentially leaking device identity. UUID v4 is purely random — no timestamp, no hardware info, no ordering.

Related Developer calculators

You might also like

Last updated: September 7, 2026