UUID v7 generator

Generate time-ordered UUID v7 identifiers in your browser with Date.now() and crypto.getRandomValues(). RFC 9562 version 7, locally. Nothing uploaded.

Count accepts 1–100. Click Generate to mint new identifiers. Values outside 1–100 are adjusted to fit that range. After Generate, the field shows the clamped count. Docify's UUID v7 generator creates RFC 9562 version 7 identifiers in your browser. Bits 0–47 are Date.now() Unix milliseconds (leap seconds ignored). That millisecond clock is the same POSIX-ms count as /unix-timestamp/ Milliseconds mode. This page does not convert 1700000000 or extract those 48 bits. The version nibble is 7. The remaining 74 bits come from crypto.getRandomValues(). This page does not implement RFC 9562 §6.2 monotonic counters, so two IDs from the same millisecond are not ordered by click. Uppercase and Remove hyphens only reformat the stored strings. It does not generate v1, v3, or v4. Version 5 is /uuid-v5-generator/. The v4 generator is /uuid-generator/. ULID is /ulid-generator/. Nothing is uploaded.

UUIDs

How it works

  1. You can generate 1 to 100 UUIDs at a time. The count field clamps invalid input to this range.
  2. Each click writes a 16-byte RFC 9562 §5.7 layout: Date.now() into the first 48 bits, version nibble 7, variant bits 10, and 74 CSPRNG bits from crypto.getRandomValues(). There is no Math.random() fallback and no §6.2 monotonic counter.
  3. Uppercase and Remove hyphens only reformat the stored strings (toUpperCase() and stripping -). They do not mint a different UUID version. Copy writes the formatted lines. Clear empties the list.

UUID v7 in Python and Node

The snippets below build RFC 9562 §5.7: 48-bit Unix milliseconds, version nibble 7, variant 10xx, then random bits. CPython 3.14+ uuid.uuid7 is the named stdlib API. Node has no uuid.uuid7; crypto.randomUUID() is v4 only. The Node snippet uses Date.now() and crypto.randomBytes — the same POSIX-ms clock and CSPRNG family this page runs through crypto.getRandomValues(). For how v7 compares to v4 and v5, see UUID Versions Explained: v4 vs v1, v5, v7 and v8 (Format & Length).

Node.js with crypto.randomBytes

Write the 48-bit millisecond timestamp into the first six octets, then version nibble 7 and variant 10xx. Live minting should start from crypto.randomBytes(16), not zeros. Also import { randomBytes } from 'node:crypto'. This is not crypto.randomUUID():

const { randomBytes } = require('crypto');

function uuidv7(ms, rand) {
  const bytes = Buffer.from(rand);
  bytes[0] = Number((ms >> 40n) & 0xffn);
  bytes[1] = Number((ms >> 32n) & 0xffn);
  bytes[2] = Number((ms >> 24n) & 0xffn);
  bytes[3] = Number((ms >> 16n) & 0xffn);
  bytes[4] = Number((ms >> 8n) & 0xffn);
  bytes[5] = Number(ms & 0xffn);
  bytes[6] = (bytes[6] & 0x0f) | 0x70;
  bytes[8] = (bytes[8] & 0x3f) | 0x80;
  const hex = bytes.toString('hex');
  return hex.slice(0, 8) + '-' + hex.slice(8, 12) + '-' + hex.slice(12, 16) + '-' + hex.slice(16, 20) + '-' + hex.slice(20);
}

uuidv7(1700000000000n, Buffer.alloc(16))
// "018bcfe5-6800-7000-8000-000000000000"

uuidv7(BigInt(Date.now()), randomBytes(16))
// version 7, variant 8/9/a/b; bits 0–47 are Date.now()

Python with uuid.uuid7

CPython 3.14+ uuid.uuid7 is RFC 9562 §5.7 plus §6.2 Method 1 (a 42-bit counter so IDs from the same millisecond stay ordered). UUID.time on version 7 is that 48-bit Unix-millisecond field, not the Gregorian 100-ns count used by v1:

import datetime as dt
import uuid

u = uuid.uuid7()
u.version
# 7
u.time  # 48-bit Unix ms; changes each call
dt.datetime.fromtimestamp(u.time / 1000, tz=dt.timezone.utc)
# datetime.datetime(..., tzinfo=datetime.timezone.utc)

This page does not implement RFC 9562 §6.2 Method 1, 2, or 3, so two IDs from the same millisecond are not ordered by click. CPython uuid.uuid7 does use Method 1. Both use the same POSIX-ms clock as Unix timestamp Milliseconds mode. 1700000000000 is 1700000000 seconds — 2023-11-14T22:13:20.000Z. The Node layout string uses zero rand_a / rand_b so the 48-bit field is visible; Generate never writes that all-zero tail. uuid.uuid7 takes no timestamp argument and will not print 018bcfe5-6800-7000-8000-000000000000. crypto.randomUUID() and uuid.uuid4 belong on the UUID v4 generator. uuid.uuid1 is Gregorian 100-ns time plus a node id, not Unix ms. uuid.uuid6 and uuid.uuid8 are also 3.14+ and are not offered here. The high bits leak the minting millisecond; this is not a password hasher. For seconds vs milliseconds, see Unix Seconds vs Milliseconds: UTC vs Local. Sibling time-ordered IDs are ULID generator.

UUID v7 in the shell

Generate on this page writes lowercase RFC 9562 §5.7 UUIDs with hyphens — one ID per line. Bits 0–47 are Date.now() Unix milliseconds. There is no §6.2 monotonic counter. util-linux 2.41+ uuidgen --time-v7 calls uuid_generate_time_v7(): the same 48-bit Unix-ms field from gettimeofday, ten random bytes, then version nibble 7 and variant 10xx. That command also skips §6.2, so two IDs from the same millisecond are not ordered. CPython 3.14+ python -m uuid -u uuid7 calls uuid.uuid7() and prints the same lowercase hyphenated layout — with §6.2 Method 1, unlike this page and uuidgen --time-v7. Default python -m uuid is v4. 3.12 and 3.13 reject -u uuid7. These commands mint a new ID each run — they do not decode or validate a pasted UUID.

util-linux uuidgen (Linux)

--time-v7 / -7 shipped in util-linux 2.41. uuid_unparse prints lowercase 8-4-4-4-12. Older uuidgen rejects the flag:

uuidgen --time-v7
# lowercase 8-4-4-4-12; version nibble is 7

uuidgen --time-v7 --count 3
# three independent v7 lines; no §6.2 counter

macOS uuidgen

Apple's uuidgen has no --time-v7 flag. Output is uppercase v4. For v7 on a Mac, use this page, the CPython uuid.uuid7 block above (3.14+), or python -m uuid -u uuid7 (3.14+):

uuidgen
# uppercase 8-4-4-4-12; version nibble is 4

uuidgen --time-v7
# unrecognized option

CPython python -m uuid

The stdlib uuid CLI shipped in 3.12, but -u uuid7 and -C / --count arrived in 3.14. Pass -u uuid7 to call uuid.uuid7() — RFC 9562 §5.7 plus §6.2 Method 1. Default -u uuid4 is random v4, not this page. 3.12 and 3.13 reject both flags:

# 3.14+: lowercase hyphenated v7 (same layout this page writes)
python -m uuid -u uuid7
# lowercase 8-4-4-4-12; version nibble is 7

# 3.14+: batch in one process (Method 1). This page clamps 1–100
# and does not order same-ms IDs; the CLI has no 100 cap.
python -m uuid -u uuid7 -C 3
# three v7 lines; same-ms IDs stay ordered

# 3.12 / 3.13 reject the version
python -m uuid -u uuid7
# invalid choice: 'uuid7'

Default uuidgen and uuidgen --random are UUID v4 — use the UUID v4 generator. uuidgen --time is v1. uuidgen --time-v6 is v6, not this page. --sha1 / --md5 with --namespace and --name are hash-based v5 / v3 — use the UUID v5 generator. /proc/sys/kernel/random/uuid is also v4. --count with --time-v7 loops uuid_generate_time_v7(); it is not the v1 clock cache. This page's Count (1–100) also mints independent v7s. CPython uuid.uuid7 and python -m uuid -u uuid7 do use §6.2 Method 1. python -m uuid -u uuid7 -C 3 loops that function in one process, so same-ms IDs in that batch stay ordered. Three separate python -m uuid -u uuid7 processes each start a new counter. Default python -m uuid and python -m uuid -C 3 are v4 — use the v4 generator. python -m uuid -u uuid1 is v1. python -m uuid -u uuid5 -n @dns -N www.example.com is v5. -u uuid6 and -u uuid8 are also 3.14+ and are not offered here. -u uuid3 is MD5 (v3) and is not offered here. print() adds a newline after every ID, including the last; this page joins with LF and does not. This page's Uppercase and Remove hyphens options are display-only; neither uuidgen nor python -m uuid has a hyphen-strip flag — use tr -d '-' for 32 hex digits. PowerShell [guid]::NewGuid().ToString() is lowercase hyphenated v4, not v7. Windows has no uuidgen --time-v7 unless WSL. Version details are in UUID Versions Explained: v4 vs v1, v5, v7 and v8 (Format & Length).

FAQ

Does this generator upload anything?
No. Each ID is created in your browser with Date.now() and crypto.getRandomValues(). The page does not send the strings to a server.
What count range does Generate accept?
Count accepts 1–100. Click Generate to run the conversion. Values outside 1–100 are adjusted to fit that range. After Generate, the field shows that clamped integer. Each Generate click mints that many RFC 9562 version 7 UUIDs.
Which UUID version does this produce?
Version 7 only. RFC 9562 §5.7 stores a 48-bit Unix millisecond timestamp (Date.now(), leap seconds ignored) in bits 0–47, writes version nibble 7, then fills the remaining 74 bits from crypto.getRandomValues(). The variant bits are 10xx. Count accepts 1–100. Empty or 0 defaults to 1; 101 caps at 100. Uppercase and Remove hyphens only reformat stored strings and do not change the version. It does not generate v1, v3, or v4. Version 5 is /uuid-v5-generator/. The v4 generator is /uuid-generator/. ULID is /ulid-generator/.
Are successive v7 values strictly monotonic?
Not within the same millisecond. This page does not implement RFC 9562 §6.2 Method 1, 2, or 3 (no extra clock sequence or monotonic counter). IDs minted in different milliseconds sort by that 48-bit timestamp. Two clicks in the same millisecond can sort in either order because rand_a and rand_b are fresh CSPRNG bits. Date.now() is the same POSIX-ms clock as /unix-timestamp/.
Does this generator convert a Unix timestamp?
No. Date.now() is the same POSIX-ms clock as /unix-timestamp/ Milliseconds mode. This page writes those 48 bits into a UUID; it does not convert 1700000000, does not parse a pasted UUID, and does not extract those bits. The /unix-timestamp/ tool can convert timestamps like 1700000000 seconds to 2023-11-14T22:13:20.000Z.
Are these IDs secrets or proof of uniqueness?
No. A v7 UUID is a 48-bit clock plus 74 bits of CSPRNG output (and the version/variant bits). This page does not check a registry, mint a database sequence, or treat the string as a password, session token, or signed claim. The high bits leak the minting millisecond.

Related