UUID Generator: Universally Unique Identifiers Explained
A UUID (Universally Unique Identifier) is a 128-bit number formatted as 32 hex characters in 8-4-4-4-12 groups. They're random enough that you can generate one anywhere in the world and never collide with another — making them ideal as database keys without coordination.
Format: xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx where M is the version (1-5) and N indicates a variant. The most common is UUID v4, which is purely random — 122 bits of randomness gives you a 1-in-a-quintillion chance of any collision in practical lifetimes.
Other versions: v1 (timestamp-based, includes MAC address), v3/v5 (deterministic from a name), v7 (newer, time-ordered randomness — best of both worlds for databases).
Common UUID uses
- •Database primary keys (avoiding auto-increment coordination)
- •Distributed system identifiers (each node generates without checking)
- •File and resource names that won't collide
- •Tracking events across services without coordination
- •Session IDs and tokens (though dedicated session libraries are better)
Extended FAQ
Are UUIDs truly unique?
Cryptographically random v4 UUIDs have a collision probability so low it's essentially zero for any practical use. You'd need to generate a billion UUIDs per second for 85 years to have a 50% chance of collision.
Why are some UUIDs starting with the same characters?
v1 UUIDs encode timestamp and MAC, so they share prefixes when generated near each other. v4 are purely random and don't show this pattern.
Are my generated UUIDs stored?
No — runs entirely in your browser.
