UUID v6 Generator
Press c to copy or r for a new one
Generate in bulk
What is UUID v6?
A v6 UUID holds exactly the same fields as a v1, in a different order. v1 puts the low 32 bits of the timestamp first, which scatters consecutive IDs across an index. v6 puts the high bits first, so the text and the bytes both sort into creation order.
Everything after the timestamp is unchanged: a 14-bit clock sequence and a 48-bit node ID that is traditionally the MAC address of the machine that made it.
When to reach for v6
RFC 9562 is direct about this one. v6 exists for systems that already have v1 UUIDs and want time ordering without changing what the fields mean, because a v1 converts to a v6 and back with no loss at all.
For anything new, use v7. It sorts just as well, encodes plain Unix milliseconds instead of 100-nanosecond intervals counted from 1582, and spends its remaining bits on randomness rather than on a MAC address it would rather not publish.
What it gives away
The same things a v1 does: when it was created, and the identity of the machine that created it. In a browser there is no MAC address to read, so the node here is random per session.
Paste one into the decoder to see the timestamp come back out.
Generate one in code
TypeScript
import { v6 as uuidv6 } from "uuid";
uuidv6();Python
import uuid6 # pip install uuid6
uuid6.uuid6()Go
import "github.com/google/uuid"
id, err := uuid.NewV6()Rust
// uuid = { version = "1", features = ["v6"] }
use uuid::{Uuid, NoContext, Timestamp};
Uuid::new_v6(Timestamp::now(NoContext), &[1, 2, 3, 4, 5, 6]);What is a UUID?
A UUID is a Universally Unique IDentifier: a 128-bit number used to identify something without coordinating with anyone else. It is usually written as 32 hexadecimal characters in five hyphenated groups.
UUIDs come in several versions. v4 is random, v1 and v6 encode a timestamp and a MAC address, v3 and v5 hash a name inside a namespace, and v7 encodes a Unix millisecond timestamp followed by random bits.
Why use UUIDs?
UUIDs can be generated anywhere, by anyone, with no central authority, and still be safely assumed not to collide. That makes them useful for distributed systems, offline clients, and merging data from separate databases.
They are also instantly recognisable, which makes them easy to pick out of logs.
Some databases (for example Postgres) store a UUID as a 128-bit integer rather than a 36-character string, so using one as a primary key costs far less than it looks.
What are the downsides?
Uniqueness is probabilistic, not guaranteed. The odds of two v4 UUIDs colliding are negligible, but they are not zero.
Some versions leak information. A v1 or v6 UUID contains the MAC address of the machine that generated it and the moment it was generated, which is enough to correlate a device across systems. You can see exactly what a UUID gives away with the UUID decoder.
Time-ordered IDs are also partly guessable, so they are a poor choice for anything that doubles as a secret, such as a password reset token.