induwara.lk
induwara.lkUtility · Developer

UUID Generator — v4 random & v7 time-ordered

Generate UUID v4 (122 random bits) or UUID v7 (millisecond timestamp + random) one at a time or up to 1,000 in a batch. Inspect any UUID for version, variant, and embedded timestamp. RFC 9562 conformant, runs entirely in your browser.

By Induwara AshinsanaUpdated May 11, 2026
Generate UUIDsRFC 9562 (May 2024)

Random bits sourced from Web Crypto's getRandomValues — never leaves your device.

Quick presets

Pick a count and click Generate. UUIDs appear here, ready to copy. Nothing is sent to a server.

Inspect any UUID

Random bytes are drawn from window.crypto.getRandomValues — the same CSPRNG the browser uses for TLS handshakes. UUIDs are built per RFC 9562 §5.4 (v4) and §5.7 (v7); full citations below.

How it works

A UUID is a 128-bit value rendered as 32 hexadecimal digits in the canonical 8-4-4-4-12 form. Four bits encode the version and two bits encode the variant; the remaining 122 bits carry the payload. This tool implements the two versions most useful in practice — UUIDv4 and UUIDv7 — exactly as specified in RFC 9562 (May 2024, obsoletes RFC 4122).

  1. Random bytes. The browser draws 16 bytes from window.crypto.getRandomValues — the cryptographically secure pseudo-random source the browser uses for TLS, WebCrypto, and Subresource Integrity. No fallback to Math.random is ever used. This is the same primitive Node's crypto.randomUUID() uses internally.
  2. UUIDv4 (§5.4). All 16 bytes start as random. Byte 6 is then masked to set the version nibble: byte6 = (byte6 & 0x0F) | 0x40. Byte 8 is masked for the variant: byte8 = (byte8 & 0x3F) | 0x80. The result is 122 bits of entropy with a recognisable layout: the third group always starts with 4 and the fourth group starts with 8, 9, a, or b.
  3. UUIDv7 (§5.7). Bytes 0–5 store the 48-bit Unix timestamp in milliseconds, big-endian. Byte 6 carries the version nibble (0111) in its high four bits and 4 random bits in its low four bits. Byte 7 is 8 more random bits — those 12 random bits together are rand_a. Byte 8 carries the variant (10) in its high two bits, followed by 62 random bits across bytes 8–15 (rand_b). The time prefix means v7 values are lexicographically sortable in generation order — a property B-tree indexes love.
  4. Bulk mode. For batches, the v4 path simply calls the v4 generator n times. The v7 path increments the timestamp by 1 millisecond per record so the batch sorts strictly in generation order even if many UUIDs land on the same millisecond boundary; the 74 random bits keep each record globally unique.
  5. Verification.Every render runs a self-test: known input bytes → expected canonical UUID, then v7 timestamp write → independent read-back, then a structural verifier that checks length, hyphen positions, hex-only characters, version nibble, and variant bits via a separate code path from the generator. The “RFC 9562 verified” badge in the card header lights up only when all four cross-checks pass.

The output format chips are reversible cosmetic transforms applied after generation: case is RFC-canonical lowercase by default, but UPPER, no-hyphens (32-char compact), Microsoft-style {braces}, and the RFC 4122 §3 urn:uuid: prefix are one click away. Copying preserves the chosen format; so do the .txt and .csv downloads. The CSV export includes a per-record ISO-8601 timestamp column for v7 batches so the file is analysis-ready in any spreadsheet.

Collision analysis: by the birthday-paradox approximation, drawing n ≈ √(2 · 2¹²² · ln(1/(1-p))) UUIDv4 values gives a probability p of any pair colliding. For p = 0.5 that is ≈ 2.71 × 10¹⁸ values — one billion UUIDs per second for 85 years from a single source. Within any realistic application, collisions are not a meaningful failure mode.

Worked examples

Example

UUIDv4 from a known byte string

  1. Random bytes (hex): 11 22 33 44 55 66 77 88 99 aa bb cc dd ee ff 00
  2. Byte 6 mask: (0x77 & 0x0f) | 0x40 = 0x47 (version nibble = 4)
  3. Byte 8 mask: (0x99 & 0x3f) | 0x80 = 0x99 (variant top 2 bits = 10)
  4. Formatted 8-4-4-4-12:
  5. 11223344-5566-4788-99aa-bbccddeeff00
  6. Verifier: version 4 · variant rfc9562 · 36 chars · hyphens at 8/13/18/23

Example

UUIDv7 with timestamp = 0x012345678901 (≈ 22 Aug 2009 UTC)

  1. unix_ts_ms (48 bits): 01 23 45 67 89 01
  2. rand_a (12 bits) = 0xabc → byte6 = (7<<4) | 0xa = 0x7a · byte7 = 0xbc
  3. variant (10) || rand_b top 6 bits 0b101010 → byte8 = 0xaa
  4. rand_b low 56 bits: 12 34 56 78 9a bc de
  5. Output: 01234567-8901-7abc-aa12-3456789abcde
  6. extractV7Timestamp() reads back 1,250,999,896,321 ms — the original.

Example

Boundary — count = 0 and overflow at 1,001

  1. count = 0 → generateBulk() returns []
  2. count = 1 → exactly one record with index 1
  3. count = 1000 → 1,000 records, the documented maximum
  4. count = 1001 → input is clamped, UI shows: "Maximum 1,000 per batch"
  5. Negative or non-numeric input → empty batch, error message in helper text

Example

Inspecting a non-canonical input

  1. Paste: " {11223344-5566-4788-99aa-bbccddeeff00} "
  2. Normaliser trims whitespace, drops {braces}, lowercases hex
  3. Result: valid · version 4 · variant rfc9562
  4. Paste: "112233445566478899aabbccddeeff00" (no hyphens)
  5. Normaliser re-inserts hyphens at canonical positions
  6. Result: valid · version 4 · canonical 11223344-5566-4788-99aa-bbccddeeff00

Frequently asked questions

Sources & references

The bit layouts and verification routines on this page were last cross-checked against RFC 9562 on 2026-05-11. The spec is stable; if the IETF UUID working group publishes a clarification, the tool is reviewed and updated.

Related tools

Rate this tool
Be the first to rate

Comments & feedback

Spotted a bug or want an improvement? Tell us — our team reviews every comment, and good ideas get built. Comments are public and anonymous.

Spotted a bug, edge case, or want to suggest an improvement?

Email me at [email protected] — most fixes ship within 24 hours.