Guide
UUID v4 or v7 - generating unique IDs the right way
A UUID (universally unique identifier) is a 128-bit ID written as 36 characters, such as 0f8fad5b-d9cb-469f-a165-70867728950e. Anyone can create one without asking a central server, and it’s practically guaranteed never to clash with another. That makes UUIDs ideal for database keys, file names, request IDs, test data and distributed systems. This generator makes random v4 and time-ordered v7 UUIDs, one or ten thousand at a time.
Generating UUIDs
- Choose a version: v4 (random) or v7 (time-ordered).
- Set how many, from 1 to 10,000.
- Pick a format: UPPERCASE, Hyphens on or off, and {Braces}.
- Copy the first one, Copy all, or download the list as uuids.txt, one per line.
Your settings are remembered for next time. Random bits come from your browser’s cryptographic random generator, on your device.
v4 vs v7
| v4 | v7 | |
|---|---|---|
| Built from | 122 random bits | Timestamp (ms) + 74 random bits |
| Sort order | Random | By creation time |
| Reveals creation time | No | Yes, to the millisecond |
| Best for | Public IDs, tokens of identity, general use | Database primary keys, logs, event streams |
Why v7 for databases: most databases store primary keys in a sorted index (a B-tree). Random v4 keys land all over that index, which causes page splits and cache misses as tables grow. v7 keys increase over time, so new rows go to the end, much like an auto-increment number, while staying unique across servers.
Why v4 elsewhere: v7 reveals when a record was created. For IDs in public URLs, that can leak information such as signup dates or order volumes.
Reading a UUID
0190c3a1-7b2e-7c4d-9f3a-2b1c0d9e8f7a
- The 13th character (first of the third group) is the version: 4 or 7.
- The 17th character (first of the fourth group) is the variant, normally 8, 9, a or b.
- In v7, the first 12 hex digits are the timestamp in milliseconds since 1970.
Format options
- Hyphens off: 32 hex characters, for systems with fixed-length fields or compact storage.
- Uppercase: some Microsoft tools and older systems display GUIDs in capitals; UUIDs are case-insensitive by definition.
- Braces: the registry-style GUID format,
{0F8FAD5B-D9CB-469F-A165-70867728950E}, used in Windows, COM and some .NET configuration.
Bulk generation
Need IDs for test fixtures, seed data or a spreadsheet import? Generate up to 10,000 at once and download them as a text file, one per line, ready to paste into a column or a script.
What UUIDs aren’t for
- Secret tokens: password-reset links and session tokens should use a dedicated random token generator with more randomness than a UUID; v7 is partly predictable.
- Human-readable references: 36 characters are hard to read over the phone. Use a short order number for people and keep the UUID internally.
- Guaranteed ordering across machines: v7 sorts by time, but clocks on different servers can drift.
Who generates UUIDs
- Backend developers create primary keys and request IDs.
- QA engineers create unique test data.
- Data engineers assign IDs to records from different systems.
- DevOps engineers tag resources and deployments.
A complete example: seed data for a test database
- Choose v7, so IDs sort by creation time like real data.
- Generate 500 and download uuids.txt.
- Paste them into the first column of your seed spreadsheet or script.
- Commit the seed file so tests use stable IDs.
Tips
- Store UUIDs in a native UUID column type where your database offers one; it’s smaller and faster than text.
- Use v4 for IDs shown publicly in URLs.
Related tools
- Password Generator for secrets people type.
- Hash Generator for fingerprints of data.
- Timestamp Converter to read the time inside a v7 UUID once converted to milliseconds.
- Random Number Generator for random numbers in a range.
Checked against the current version of the UUID Generator on .

