Anatomy of a UUID
A UUID is 128 bits, written as 32 hex digits in five groups: 8-4-4-4-12. Two positions tell you what kind it is:
019a7c3e-5b1f-7d2a-9c4e-8f6a2b1d3e5c
^ ^
| variant (8, 9, a or b = RFC 9562)
version (7)v4 vs v7
| v4 | v7 | |
|---|---|---|
| Made from | 122 random bits | 48-bit Unix ms timestamp + 74 random bits |
| Sortable by time | No | Yes |
| Database index friendly | Poor (random inserts) | Great (append-only) |
| Reveals creation time | No | Yes, to the millisecond |
Checking a list of UUIDs
Paste one UUID per line into the inspector. Quotes, braces, trailing commas and urn:uuid: are ignored, so you can paste straight from JSON, SQL or a log. Each line gets its version and creation date, and problems are marked in place:
- Look-alike letters: an O where a 0 should be, or an l for a 1. Fixed in one click.
- Wrong group lengths: the group with a missing or extra digit is marked.
- Missing hyphens: 32 digits with no hyphens (or hyphens in the wrong places) are re-grouped as 8-4-4-4-12.
- Duplicates are flagged with the line they repeat.
- Non-standard versions: usually a random 128-bit ID rather than a real UUID.
Click any line in the results to jump to it in the input.
Generating UUIDs in code
// JavaScript (browser & Node 19+)
crypto.randomUUID() // v4
// Python 3.14+
import uuid
uuid.uuid4(); uuid.uuid7()
// PostgreSQL 18+
SELECT uuidv7();
// macOS / Linux
uuidgen | tr A-Z a-zGenerating IDs for an API? The JWT decoder is useful for checking the tokens that carry them.
Questions people ask
Should I use UUID v4 or v7?
Can two UUIDs ever be the same?
What’s the difference between a UUID and a GUID?
{6F9619FF-8B86-D011-B42D-00CF4FC964FF}, so there are toggles for both.Why is my UUID invalid?
Are these UUIDs secure?
crypto.getRandomValues, a cryptographically secure source, in your browser. Still, don’t use UUIDs as secret tokens: v7 leaks its creation time, and IDs tend to end up in logs and URLs.