What is UUID v1?
UUID v1 is a timestamp-based UUID defined in RFC 4122. It encodes a 60-bit timestamp representing 100-nanosecond intervals since October 15, 1582 (the UUID epoch), plus a clock sequence and a node identifier — originally a MAC address, though this tool uses a random node to protect privacy.
A v1 UUID looks like: 6ba7b810-9dad-11d1-80b4-00c04fd430c8
The timestamp in the UUID makes v1 UUIDs partially sortable, but the byte order puts the least-significant time bits first, so lexicographic sorting does not reflect creation order. This is one of the reasons UUID v7 was introduced as a modern replacement.
Pros and Cons of UUID v1
✓ Strengths
- Embeds a precise creation timestamp
- Useful for time-series lookups on legacy systems
- Widely supported by older libraries and databases
✗ Limitations
- Leaks MAC address (this tool uses random node instead)
- Poor B-tree index locality — random inserts in the index
- Not lexicographically sortable by time
- Superseded by UUID v7 for new projects
UUID v1 Code Examples
// npm install uuid
import { v1 as uuidv1 } from 'uuid';
const id = uuidv1();
console.log(id);
// → "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
// With custom node and clock sequence (advanced):
const id = uuidv1({ node: [0x01, 0x23, 0x45, 0x67, 0x89, 0xab] });
import uuid # Built-in standard library
# UUID v1 (timestamp-based)
time_id = str(uuid.uuid1())
print(time_id)
# → "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
# Note: uuid1() uses your system's MAC address as the node.
# Pass a random node for privacy:
import random
node = random.getrandbits(48)
private_id = str(uuid.uuid1(node=node))
// go get github.com/google/uuid
package main
import (
"fmt"
"github.com/google/uuid"
)
func main() {
id, err := uuid.NewUUID() // UUID v1
if err != nil {
panic(err)
}
fmt.Println(id.String())
// → "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
}
// Java's built-in UUID class only supports v4 generation.
// For v1, use a library such as java-uuid-generator:
// <dependency>
// <groupId>com.fasterxml.uuid</groupId>
// <artifactId>java-uuid-generator</artifactId>
// </dependency>
import com.fasterxml.uuid.Generators;
import java.util.UUID;
UUID id = Generators.timeBasedGenerator().generate(); // v1
System.out.println(id.toString());
<?php
// composer require ramsey/uuid
use Ramsey\Uuid\Uuid;
$id = Uuid::uuid1()->toString();
echo $id;
// → "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
Frequently Asked Questions
Does UUID v1 expose my MAC address?
The original RFC 4122 spec uses the machine's MAC address as the node field in v1 UUIDs, which is a privacy concern. This tool generates a random node instead, so no MAC address is embedded. If you use server-side libraries like Python's uuid.uuid1() they may use your actual MAC address — check the docs and pass a random node if needed.
Should I use UUID v1 or v7 for new projects?
Use UUID v7 for new projects. It was designed to address v1's limitations: the timestamp is in the most significant bits (making it lexicographically sortable), there's no MAC address leak, and it provides excellent B-tree index locality. UUID v1 is mainly relevant for maintaining compatibility with existing systems that already use it.
Can I extract the timestamp from a UUID v1?
Yes. The timestamp is encoded in the first three groups of the UUID, but the byte order is scrambled (time_low, time_mid, time_high). You need to rearrange the groups and subtract the UUID epoch offset (October 15, 1582) to get the Unix timestamp. Most UUID libraries provide a helper method for this.
Recently Generated
Your last 10 generations are saved locally in your browser. Nothing is sent to our servers.