UUID Generator
Generate random version 4 UUIDs instantly in your browser. Set the quantity, click Generate, and copy each UUID with one click. No signup required.
TL;DR. This tool generates RFC 4122 version 4 UUIDs using crypto.getRandomValues inside your browser. Each UUID is 128 bits (122 random bits plus 6 version/variant bits), formatted as 32 lowercase hex characters in 8-4-4-4-12 groups. Use v4 for session tokens, database row IDs, file names, and anywhere you need a globally unique identifier without a central counter. For database primary keys where insert order matters, prefer UUID v7 which encodes a millisecond timestamp in the high bits for sequential B-tree indexing.
How to use the UUID generator
- Set the quantity. Enter a number from 1 to 100 in the Quantity field. Need a single ID for a test record? Leave it at 1. Need to seed a database fixture file? Set it to 50 or 100.
- Click Generate UUIDs. Each click produces a fresh batch. The UUIDs are generated using
crypto.getRandomValues, the same cryptographic RNG your browser uses for TLS. They are not transmitted anywhere. - Copy individual UUIDs. Click the copy icon on the right of any row to put that UUID on your clipboard. The icon turns green for 2 seconds to confirm the copy.
- Paste directly into code. A v4 UUID like
550e8400-e29b-41d4-a716-446655440000is ready to use as a string literal in any language. Postgres accepts the hyphenated form directly for its nativeuuidcolumn type. - Regenerate freely. There is no state saved between sessions. Every page load and every click on Generate produces cryptographically independent values with no connection to previous batches.
UUID format and version cheatsheet
The 128-bit UUID value encodes version and variant bits at fixed positions. Everything else depends on the version.
| Concept | Detail |
|---|---|
| Format | 8-4-4-4-12 hex digits, e.g. 550e8400-e29b-41d4-a716-446655440000 |
| 128 bits | 32 hex characters plus 4 hyphens = 36 total chars in the canonical string |
| Char 13 | Version nibble: "4" for v4 random, "7" for v7 time-ordered |
| Char 17 | Variant nibble: 8, 9, a, or b for RFC 4122 (most modern UUIDs) |
| v1 | Timestamp + MAC address. Sortable but leaks hardware info. |
| v4 | 122 random bits. Default choice for session tokens, row IDs, file names. |
| v5 | SHA-1 hash of a namespace + name. Same input always produces same UUID. |
| v7 | 48-bit ms timestamp + 74 random bits. Time-ordered, ideal for DB primary keys. |
| Nil UUID | 00000000-0000-0000-0000-000000000000. Represents "no value" (like null). |
| Max UUID | ffffffff-ffff-ffff-ffff-ffffffffffff. Upper sentinel value (RFC 9562). |
| Postgres | Native uuid type stores 16 bytes. Use gen_random_uuid() for v4 server-side. |
| MongoDB ObjectId | 12-byte (24 hex chars): 4-byte timestamp + 5-byte random + 3-byte counter. |
| URL-safe variant | Some systems strip hyphens or use base62. Always document your format. |
When to use each UUID version
- v4 (random) - default for most use cases: Session tokens, API keys, temporary file names, in-memory object IDs, test fixtures. The 122 random bits make collisions statistically impossible at any realistic scale.
- v7 (time-ordered random) - best for database primary keys: The 48-bit millisecond timestamp prefix means new rows sort after old rows in a B-tree index. This reduces page splits and cache eviction in Postgres, MySQL InnoDB, and SQLite compared to random v4 inserts.
- v5 (name-based SHA-1) - deterministic IDs from stable inputs: Use when you need the same string to always map to the same UUID: canonical IDs for URLs, content-addressed cache keys, idempotent event deduplication. Pick a fixed namespace UUID and hash it with your input.
- v1 (timestamp + MAC) - avoid in new systems: Leaks your server's MAC address, which is a minor privacy issue. Not sortable in string form because the timestamp bytes are in a non-sequential order. Use v7 instead for any new time-sortable requirement.
Frequently asked questions
What is a UUID and what are the different versions?+
How likely is a v4 UUID collision?+
What does each part of the UUID format mean?+
Should I use UUID or a database auto-increment integer as a primary key?+
What is the nil UUID and the max UUID?+
What is the difference between a UUID and a GUID?+
Related developer tools
- Hash Generator
MD5, SHA-1, SHA-256 in the browser
- Password Generator
Cryptographically random passwords
- Timestamp Converter
Convert Unix timestamps to readable dates
- Base64 Converter
Encode and decode Base64 strings