UUID v8 Generator
Your example UUID v8 is ready below. ClickTap Copy to use it, or Generate for a fresh one.
- Free, no sign-up
- Follows the official RFC 9562 standard
Need more? Make them in bulkGenerate UUID v8 in bulk
Make up to 10,000 UUID v8s at once and save them as a file. Three quick steps.
Enter a number from 1 to 10,000.
What is a UUID v8?
A UUID v8 is a UUID with a layout you design yourself. Only the version and variant digits are fixed. The other 122 bits mean whatever you decide.
RFC 9562 added version 8 for vendor-specific and experimental formats, such as an ID that packs in a shard number, your own time format or a hash. The standard only promises that the ID is 128 bits with the right version and variant. Whether it is unique depends on your design.
There is no single way to make a v8, so this page shows an example. It fills the 122 free bits with secure random data and sets the version and variant. The result is a valid v8, but it is only a demonstration. If you just want random IDs, use UUID v4, which every library and database already understands.
What a UUID v8 looks like
Here is the ID you just made, split into its parts. ClickTap Generate above and watch it change.
- The 8 means version 8. It is always in this spot.
- This digit is always 8, 9, a or b. It marks the standard layout.
- Everything else is yours to define: 122 bits. Here they are random, as an example.
When to use UUID v8
Good for
- Packing your own data, like a shard or region number, into a standard UUID
- Name-based IDs that use a newer hash, such as SHA-256
- Prototypes and experiments with new ID schemes
- Test data for code that must accept any UUID version
Make a UUID v8 in code
const b = crypto.getRandomValues(new Uint8Array(16));
b[6] = (b[6] & 0x0f) | 0x80; // version 8
b[8] = (b[8] & 0x3f) | 0x80; // variant
const hex = [...b].map((x) => x.toString(16).padStart(2, '0')).join('');
const id = [hex.slice(0, 8), hex.slice(8, 12), hex.slice(12, 16), hex.slice(16, 20), hex.slice(20)].join('-');
console.log(id);Built into browsers and Node.js. The uuid package has no v8 function, since the layout is yours. Put your own bits in b.
import secrets
import uuid
id = uuid.uuid8(secrets.randbits(48), secrets.randbits(12), secrets.randbits(62))
print(id)uuid8() is built in from Python 3.14. It takes your own 48, 12 and 62-bit values. Its default random values are not secure, so this passes values from secrets.
import java.nio.ByteBuffer;
import java.security.SecureRandom;
import java.util.UUID;
byte[] b = new byte[16];
new SecureRandom().nextBytes(b);
b[6] = (byte) ((b[6] & 0x0f) | 0x80); // version 8
b[8] = (byte) ((b[8] & 0x3f) | 0x80); // variant
ByteBuffer buf = ByteBuffer.wrap(b);
UUID id = new UUID(buf.getLong(), buf.getLong());
System.out.println(id);Built into Java, no library needed. Put your own bits in b before building the UUID.
using System.Security.Cryptography;
byte[] b = RandomNumberGenerator.GetBytes(16);
b[6] = (byte)((b[6] & 0x0F) | 0x80); // version 8
b[8] = (byte)((b[8] & 0x3F) | 0x80); // variant
Guid id = new Guid(b, bigEndian: true);
Console.WriteLine(id);Needs .NET 8 or later for bigEndian, which keeps the bytes in standard order.
import (
"crypto/rand"
"github.com/google/uuid"
)
var id uuid.UUID
rand.Read(id[:])
id[6] = id[6]&0x0f | 0x80 // version 8
id[8] = id[8]&0x3f | 0x80 // variant
fmt.Println(id)Uses crypto/rand for the bits and the google/uuid type to print them.
SELECT overlay(gen_random_uuid()::text placing '8' from 15 for 1)::uuid;Swaps the version digit of a random v4 for 8. gen_random_uuid() is built in since PostgreSQL 13.
UUID v8 vs other versions
Questions people ask
What is UUID v8 for?
Custom formats. If you need to pack your own data into a 128-bit UUID, v8 lets you do it while still marking the ID as a valid UUID.
Is a random UUID v8 the same as a v4?
Almost. Both have 122 random bits here. But a v8 tells readers the layout is custom, so tools assume nothing about it. For random IDs, use UUID v4.
Are UUID v8s unique?
Only if your layout makes them unique. The standard leaves that to you. Random bits, like the ones on this page, make a repeat very unlikely.
Which parts of a UUID v8 must I keep?
The version digit, which is always 8, and the variant bits, which make the first digit of the fourth group 8, 9, a or b. You define the other 122 bits.
Can a decoder read my UUID v8?
It can tell it is a v8, but not what your bits mean, since only you know the layout. The UUID decoder shows the version and variant.


