BuildUtilities

What is a UUID v4?

The 'random' UUID, generated from 122 random bits, with collisions effectively impossible.

UUID v4 fills almost every bit with random data, except for 6 bits that mark it as version 4. There's no timestamp, MAC address, or other source, just randomness.

That makes it safe to generate anywhere (client, server, edge) without coordination. The chance of two v4 UUIDs colliding is about 1 in 2^122, you'd need to generate billions per second for centuries to even worry.

Downside: v4 IDs don't sort by creation time. If you index by them in a database, inserts scatter across the index. UUID v7 fixes that.

Related tools

Keep reading

Tip Jar