About the UUID Generator
Databases, distributed systems and APIs need identifiers that can be created anywhere without checking a central list, and UUIDs fill that role. This UUID generator creates version 4 UUIDs, which contain 122 random bits, using your browser's cryptographically secure random number generator, singly or in bulk. Options for uppercase letters, braces and removing hyphens match the formats different systems expect. The chance of two version 4 UUIDs colliding is so small that it can be ignored in practice. Nothing is stored or sent anywhere. For other random values, see the Random String Generator, and for secure passwords, the Password Generator.
Each identifier is a version 4 UUID: apart from a handful of fixed bits that mark the version and variant, every bit is random. Those bits are drawn from the secure generator built into your browser, the one used for encryption keys, rather than the everyday Math.random function, so the IDs are hard to predict as well as unique. That matters for things like invitation links or upload names, where a guessable ID could let someone reach a file meant for somebody else.
You can create anything from one to a thousand at a time and format them for whatever will consume them: capital letters, curly braces as some Microsoft tools like, or no hyphens for a compact 32-character form. The all-zero nil UUID is offered too, since it is the agreed placeholder for an identifier that has not been assigned.
How to use the UUID Generator
- Set the quantityOne for a quick ID, or up to a thousand for filling a test database.
- Pick the formatLower case with hyphens is standard; capitals, braces and no hyphens are there if you need them.
- Create the batchPress the button and a fresh set of identifiers appears immediately, ready to use.
- Take the listCopy everything to the clipboard or save the batch as a plain text file, one ID per line.
UUID Generator features
- Version 4 UUIDs drawn from cryptographically secure randomness
- Anything from a single ID up to a thousand in one go
- Lower-case or upper-case letters
- Optional curly braces and optional removal of hyphens
- The nil UUID for placeholders
- Copy or download a whole batch
- Nothing is stored or transmitted
Common uses
- Creating database keys without an auto-increment sequence
- Tagging requests and log entries with trace IDs
- Filling test tables with realistic identifiers
- Giving uploaded files names that cannot clash
- Supplying an idempotency key with an API request
UUIDs in practice: database keys, version 7 and index performance, idempotency keys, storage and alternatives
UUIDs give every record, request or file a unique identifier without asking a central server for the next number. That makes them ideal for distributed systems, offline apps and public URLs, but they come with trade-offs in storage and database performance that are worth understanding. This guide explains how to read a UUID, compares UUIDs with auto-increment IDs, shows why version 7 matters for databases, and covers idempotency keys, storage formats and shorter alternatives.
Reading a UUID
A UUID is written as 32 hexadecimal characters in five groups, 8-4-4-4-12, such as:
3f2b8c1e-9d4a-4b7e-a1c3-5e6f7a8b9c0d
The first character of the third group shows the version, here 4 for a random UUID, and the first character of the fourth group shows the variant, usually 8, 9, a or b. Checking these positions tells you what kind of UUID a system generated.
UUIDs or auto-increment IDs?
Auto-increment integers are small, fast and easy to read, but they reveal how many records exist and make it easy to guess other IDs, for example by changing order 1042 to 1043 in a URL. UUIDs can be generated anywhere, merge easily between databases and do not reveal counts. Many systems use an integer internally and a UUID in public URLs and APIs.
Version 7 and database performance
Random version 4 UUIDs scatter new rows across a database index, which can slow inserts and bloat indexes on large tables. Version 7 UUIDs, standardised in 2024, start with a timestamp, so new IDs are roughly in creation order and insert neatly at the end of the index. For new database tables that need UUID keys, version 7 is often the better choice.
Idempotency keys
Payment and ordering APIs often accept an idempotency key, a UUID generated by the client for each operation. If a network error causes the client to retry, the server recognises the same key and returns the original result instead of charging twice. Generating a fresh UUID for each new operation, and reusing it only for retries of that operation, makes such systems safe.
Storage formats
As text, a UUID takes 36 characters with hyphens. Stored as binary, it needs only 16 bytes, which saves space and speeds comparisons in large tables. Many databases offer a native UUID type that stores the compact form while displaying the familiar text.
Case and formatting
UUIDs are case-insensitive, but systems sometimes compare them as plain strings, so mixing upper and lower case can cause lookups to fail. Choosing lower case, the form recommended by the standard for output, and normalising inputs avoids these mismatches. Some systems also wrap UUIDs in braces, which should be stripped before comparison.
Alternatives
Other identifier schemes include ULIDs, which are sortable and shorter in text form, and short random IDs such as those produced by nanoid, popular for URLs. They suit different needs, but UUIDs remain the most widely supported, with libraries in every major language and native support in many databases.
Testing and debugging
During development, generating batches of UUIDs helps create test data, seed databases and simulate requests. Keeping a few known UUIDs in test fixtures makes tests repeatable, while fresh random ones check that code does not depend on particular values.
Common mistakes
- Exposing sequential IDs where users should not guess other records.
- Using random version 4 UUIDs as keys on very large, insert-heavy tables without considering version 7.
- Storing UUIDs as long text when binary types are available.
- Comparing UUIDs case-sensitively.
Related tools
For random passwords and secrets, use Password Generator. To hash identifiers, try Hash Generator, and for timestamps, Unix Timestamp Generator.
Offline apps and syncing
Mobile and desktop apps that work offline can create records with UUIDs on the device and sync them later without conflicts. With auto-increment IDs, two phones working offline might both create record 57, and the server would have to renumber one of them, breaking any links that pointed to it. Generating the identifier at the moment of creation, wherever that happens, removes the problem entirely.
Merging databases
When two branch databases, such as separate systems for shops in Lahore and Karachi, are combined into one, integer IDs collide because both started counting at 1. Records with UUIDs merge without renumbering, and references between tables stay intact. This is one of the main reasons teams choose UUIDs for systems that may later be split, combined or replicated.
Request IDs in logs
Assigning a UUID to every incoming request and including it in each log line makes it possible to follow a single request through several services. Showing the same ID in error messages lets support staff ask a customer for the code on screen and find the exact log entries in seconds, instead of searching by time and guessing which entries belong together.
Naming uploaded files
Renaming uploaded files with UUIDs prevents clashes when two people upload a file called invoice.pdf, and avoids exposing original file names that may contain personal details. The original name can be stored in the database and shown to the user, while the stored file uses the UUID. This also makes cache and storage paths predictable for developers.
Privacy
UUIDs are generated in your browser with the built-in cryptographic random generator. Nothing is sent to a server or stored.
Frequently asked questions
Could two of these UUIDs ever be the same?
In practice, no. A version 4 UUID contains 122 random bits, so you would have to create billions every second for about a century before a duplicate became likely. Databases and distributed systems therefore assume uniqueness and skip any lookup.
Is a GUID different from a UUID?
No, they are the same thing under two names. GUID is the term Microsoft uses, which is also why wrapping the value in curly braces is a common convention in Windows and .NET software.
How do version 1 and version 7 differ from version 4?
Version 1 includes a timestamp and the computer's network address, which can leak information. Version 7 includes a timestamp followed by random bits, so IDs sort in creation order and suit database indexes. Version 4, generated here, is fully random.
Can a UUID be used as a secret token?
They are hard to predict because they come from a secure random source, but an identifier is not the same as a secret. Anyone who sees a shared link sees the ID inside it, so pair it with proper access checks when the data behind it is private.
What is the nil UUID for?
It is the standard way of saying no identifier yet. An all-zero value is set aside for this meaning, sparing you from inventing a home-made marker that might one day collide with a genuine ID.
Does the site keep the UUIDs it generates?
No. They are created inside your browser, shown to you once and gone when you close the tab, so nobody else ever sees or records the identifiers you use.