UUID Generator & Toolkit
Generates UUID v4 (random)
Generate UUID v7, v4, v1, v3, v5, v6 and v8 — single or bulk up to 10,000, as text, CSV, JSON or SQL. Validate, decode timestamps, convert formats, compare, check collision odds, grab code snippets for 8 languages, or call the free /api/uuid. Everything runs in your browser.
Time-ordered (Unix ms) + random — best for database keys.
UUID generator — key facts
- Format
- 128-bit, 32 hex digits (8-4-4-4-12)
- Best for DB keys
- v7 — time-ordered & sortable
- Most common
- v4 — 122 random bits
- Deterministic
- v3 (MD5) / v5 (SHA-1) from a name
- Bulk
- Up to 10,000 → text / CSV / JSON / SQL
- Collision odds
- Negligible below ~10¹⁸ random UUIDs
- API
- GET /hub/api/uuid?version=v7&count=10
- Privacy
- Generated in-browser, crypto-secure
UUID versions explained (v1–v8)
| Version | How it works | Sortable? |
|---|---|---|
| UUID v7 | Time-ordered (Unix ms) + random — best for database keys. | Yes |
| UUID v4 | Fully random — the classic, most widely used UUID. | No |
| UUID v1 | Timestamp + node (MAC-style). Gregorian epoch. | No |
| UUID v6 | Reordered v1 — sortable timestamp. | Yes |
| UUID v3 | Name-based, MD5 hash of namespace + name (deterministic). | No |
| UUID v5 | Name-based, SHA-1 hash of namespace + name (deterministic). | No |
| UUID v8 | Custom / experimental — vendor-defined layout. | No |
UUID v7 vs v4 — which should you use?
UUID v4 is 122 random bits. It is perfect when you want an identifier that leaks no information and is impossible to guess. Its weakness is database indexing: because consecutive inserts land in random positions, B-tree indexes fragment and write performance drops at scale.
UUID v7 fixes that by placing a 48-bit Unix-millisecond timestamp at the front, followed by random bits. New rows are inserted in roughly chronological order, keeping indexes compact — you get the global uniqueness of a UUID with the insert performance closer to an auto-increment key. For most new tables in 2026, v7 is the recommended default; reach for v4 only when ordering or an embedded timestamp is undesirable.
UUID v4 generator
Generate cryptographically-random UUID v4 — the most widely used identifier. Pick “v4” above and any count from 1 to 10,000.
UUID v7 generator
Generate time-ordered UUID v7 with an embedded Unix-millisecond timestamp — the best choice for sortable database primary keys. It’s the default here.
Bulk UUID generator
Need thousands at once? Set the count to 1,000 or 10,000 and export as plain text, CSV, a JSON array or a ready-to-run SQL INSERT statement.
GUID generator
A GUID is simply Microsoft’s name for a UUID. Every UUID generated here is a valid GUID you can drop straight into .NET, SQL Server or Windows code.
UUID validator & decoder
Paste one or many UUIDs to validate their format, version and variant, or decode the embedded timestamp, node and clock-sequence from v1, v6 and v7.
Name-based UUID (v3 / v5)
Derive a deterministic UUID from a namespace and a name using MD5 (v3) or SHA-1 (v5) — the same input always yields the same UUID.
Free UUID API
No key, no sign-up, CORS-enabled. Returns JSON by default; add &format=text|csv|sql for other outputs.
# single v4
GET /hub/api/uuid
# 1,000 sortable v7 UUIDs as JSON
GET /hub/api/uuid?version=v7&count=1000
# as SQL INSERT
GET /hub/api/uuid?version=v7&count=100&format=sql
# response (json)
{ "version": "v7", "count": 1, "uuids": ["018f..."], "uuid": "018f..." }What is a UUID?
A UUID (Universally Unique Identifier), also called a GUID, is a 128-bit value used to label information without a central authority. Written as 32 hexadecimal digits in five hyphen-separated groups (8-4-4-4-12), it is unique enough that two systems can independently generate IDs that will essentially never clash. UUIDs are defined by RFC 9562 (which superseded RFC 4122) and power database primary keys, API request IDs, distributed-system entity IDs, file names and more.
Frequently Asked Questions
What is the best UUID version to use?+
For new database keys, UUID v7 is now the best default: it embeds a Unix-millisecond timestamp so IDs are time-sortable, which keeps database indexes compact and fast — unlike fully-random v4. Use v4 when you want no embedded information at all, and v5 when you need a deterministic ID derived from a name.
What is the difference between UUID v4 and v7?+
v4 is 122 random bits — unpredictable but unordered, which fragments B-tree indexes. v7 puts a 48-bit Unix-ms timestamp at the front followed by random bits, so values generated over time sort in order while staying globally unique. v7 is the modern choice for primary keys.
How do I generate UUIDs in bulk?+
Pick a version, set the count (1, 10, 100, 1,000 or 10,000), and the tool generates them instantly. Export as plain lines, CSV, a JSON array, or a ready-to-run SQL INSERT statement, then copy or download.
Is there a UUID API?+
Yes. GET /hub/api/uuid?version=v7&count=10 returns a JSON array (add &format=text, csv or sql for other outputs). It is free, needs no key, and supports CORS.
How do I validate a UUID?+
Open the Validate tab and paste one or many UUIDs. Each is checked against the canonical 8-4-4-4-12 format and reports its version and variant. Invalid strings are flagged.
Can I decode the timestamp from a UUID?+
Yes, for time-based versions. Paste a v1, v6 or v7 UUID into the Decode tab to read its embedded timestamp (as UTC and Unix ms), plus variant, node and clock-sequence where present.
What are the odds of a UUID collision?+
Negligible for random UUIDs. With 122 random bits you would need to generate on the order of a billion UUIDs per second for ~85 years to reach a 50% chance of a single collision. The Collision tab computes the exact probability for any count.
Are the UUIDs generated securely and privately?+
Generation uses the browser's cryptographically-secure crypto.getRandomValues, and everything happens locally — nothing you generate is sent to a server.
What is a nil UUID?+
The nil UUID is all zeros (00000000-0000-0000-0000-000000000000), used as a placeholder for ‘no value’. There is also a max UUID of all f's defined in RFC 9562.
What is the difference between a UUID and a GUID?+
They are the same thing. GUID (Globally Unique Identifier) is Microsoft's name for a UUID; both are 128-bit identifiers. This tool generates standard UUIDs that work anywhere a GUID is expected.
How do I generate a UUID in JavaScript?+
In modern browsers and Node 19+, use the built-in crypto.randomUUID() for a v4 UUID. For v7 or other versions, use the uuid npm package, e.g. import { v7 } from 'uuid'. The Code tab on this page shows ready-to-copy snippets.
How do I generate a UUID in Python?+
Use the standard library: import uuid then uuid.uuid4() for random, uuid.uuid1() for time-based, or uuid.uuid5(uuid.NAMESPACE_DNS, name) for name-based. For v6/v7 use the uuid6 package. See the Code tab.
UUID v7 vs ULID — which is better?+
Both are time-sortable 128-bit IDs. UUID v7 is now an official RFC 9562 standard and is stored natively as a uuid type in databases like PostgreSQL, so it interoperates everywhere UUIDs are expected. ULID uses Crockford base32 text. For new projects, v7 is usually the safer, more portable choice.
How many UUIDs can I generate at once?+
Up to 10,000 in one click here, exported as plain text, CSV, a JSON array or a SQL INSERT. For larger volumes, call the /hub/api/uuid?count=… endpoint or generate them in your own code with the snippets provided.
Is UUID v1 a security risk?+
UUID v1 embeds a timestamp and a node identifier (historically the MAC address), which can leak information and be partly predictable. For anything security-sensitive prefer v4 (fully random) or v7 (random tail), which do not expose hardware identifiers.
Can I generate the same UUID again (deterministic)?+
Yes — use v3 or v5. Given the same namespace and name they always produce the same UUID, which is ideal for deriving stable IDs from existing keys like a URL or email. v1/v4/v6/v7 are non-deterministic by design.
Can I generate more than 1,000 UUIDs at once?+
Yes — up to 10,000 in a single click here, where most generators cap at 1,000. Export them as plain text, CSV, a JSON array or a SQL INSERT, or call the /hub/api/uuid?count= endpoint for any quantity.
Is this UUID generator RFC 9562 compliant?+
Yes. It implements UUID v1–v8 to RFC 9562 (which superseded RFC 4122 in 2024), including the modern time-ordered v7. Versions and variant bits are set exactly per spec, and the Validate tab checks any UUID against it.
How do I generate a UUID in SQL (PostgreSQL / SQL Server)?+
In PostgreSQL use gen_random_uuid() (v4) or uuidv7() on Postgres 18+; in SQL Server use NEWID() or NEWSEQUENTIALID(). The Database tab shows ready-to-copy column definitions for Postgres, MySQL, MongoDB, Supabase and Firebase.
What's the difference between UUID and NanoID?+
Both are unique IDs, but a UUID is a 128-bit standardised format (RFC 9562) stored natively in databases, while NanoID is a shorter, URL-friendly random string with a configurable alphabet. Use UUID v7 for database keys; NanoID when you want compact public IDs.