# UUID Generator & Inspector (v4 / v7)

> Generate random v4 or time-ordered v7 UUIDs, or paste any UUID to read its version, variant, and (for v7) the embedded creation timestamp. Generation uses the browser's secure random source. Runs entirely in your browser.

- Tool: https://ronutz.com/en/tools/uuid
- Family: Identifiers

---

## What it does

Generate UUIDs, or paste an existing one to inspect it. Generation produces either a random version 4 UUID or a time-ordered version 7 UUID, using the browser's secure random source (`crypto.getRandomValues`). Inspection takes any UUID and reports whether it is valid, which version and variant it is, and, for a version 7 value, the creation time embedded inside it. Everything runs in your browser.

## What a UUID is

A UUID is a 128-bit identifier, written as 32 hexadecimal digits in the familiar 8-4-4-4-12 grouping, for example `f47ac10b-58cc-4372-a567-0e02b2c3d479`. Its purpose is to be unique without a central authority handing out numbers: any party can mint one and rely on it not colliding with anyone else's. Two fixed fields encode its structure: a version nibble that says how the UUID was made, and a variant field that marks it as an RFC 4122/9562 UUID.

## Version 4 and version 7

- **Version 4** is almost entirely random: 122 of its 128 bits come from the random source, and the other 6 are the fixed version and variant bits. It is the right default when you just need an unpredictable, collision-resistant id and do not care about ordering.
- **Version 7** is time-ordered. Its most significant 48 bits are a Unix millisecond timestamp, followed by 74 random bits. Because the timestamp is at the front, version 7 UUIDs sort in creation order, which makes them far better than version 4 as database primary keys: sequential inserts keep an index compact instead of scattering writes across it.

Version 7 is new in RFC 9562, the 2024 specification that updated and obsoleted the original RFC 4122.

## Inspecting a UUID

Paste any UUID and the tool parses it without generating anything: it confirms the format, reads the version and variant from their fixed positions, and, for a version 7 UUID, decodes the embedded 48-bit timestamp back into a date. That last part is the useful trick: a version 7 id quietly carries the moment it was created, so you can read a record's creation time straight from its key.

## Using it

Generate a v4 or v7 UUID with a click, or paste an existing UUID to read its version, variant, and, for v7, its timestamp. Generation draws on the secure random source, so v4 values are unpredictable; inspection is a pure parse and reveals only what the UUID itself encodes.

## Standards and references

- [RFC 9562 - Universally Unique IDentifiers (UUIDs)](https://www.rfc-editor.org/rfc/rfc9562) - current UUID spec, including v7
- [RFC 4122 - A UUID URN Namespace](https://www.rfc-editor.org/rfc/rfc4122) - original UUID definitions

## Related reading

- [ULID, KSUID, Snowflake, and other sortable IDs](https://ronutz.com/en/learn/sortable-id-formats.md): The popular alternatives to UUIDs for time-ordered identifiers, how each is built, and why UUIDv7 now covers most of what they were invented for.
- [UUID versions explained: v1 through v8](https://ronutz.com/en/learn/uuid-versions.md): The whole UUID family in one place, from time-and-MAC v1 to random v4 to time-ordered v7, plus the name-based versions and how the version and variant bits are read.
- [UUIDs as database keys: v4, v7, and index locality](https://ronutz.com/en/learn/uuid-database-keys.md): The real trade-off between UUIDs and auto-increment integers, and why random v4 keys quietly hurt database performance.
- [UUIDs: random v4 and time-ordered v7](https://ronutz.com/en/learn/uuid.md): How a 128-bit identifier stays unique without a central authority, and why v7 is becoming the default for database keys.
- [Will UUIDs collide? Probability and the birthday bound](https://ronutz.com/en/learn/uuid-collisions.md): How many random bits a UUID actually has, the birthday math for a collision, and when you want deterministic UUIDs instead.
