UUID Generator
Free UUID generator. Create version 4 universally unique identifiers for databases, APIs and apps. Generate up to 100 at once with one click. No signup.
About this tool
A UUID, or Universally Unique Identifier, is a 128-bit label used to identify records, files, sessions and objects in software. Developers use them as database keys, API tokens and transaction IDs because they can be generated anywhere without a central authority handing them out.
This free tool generates version 4 and version 7 UUIDs — plus deterministic version 5 IDs made from a name — instantly in your browser. Generate one or a hundred at a time, in standard, uppercase, brace or URN form, copy them one by one or all at once, and download the list as a text or CSV file. You can also paste any UUID below to check its version and read the timestamp hidden inside a version 1 or version 7 ID. Nothing is uploaded or logged.
By Azhar Hussain · Last updated: 19 November 2026
How to use
Choose what you want to do. To generate, pick a version — 4 for random IDs, 7 for time-ordered IDs, 5 for a repeatable ID made from a name — then enter how many you need, from 1 to 100, choose an output format, and click Generate UUIDs. Each identifier looks like 550e8400-e29b-41d4-a716-446655440000: 32 hexadecimal digits in five groups.
To check an ID instead, switch to 'Check / decode a UUID' and paste it in. The tool reports the version, the variant, and — for versions 1 and 7 — the exact creation time stored inside the ID. It accepts hyphens or no hyphens, braces, and urn:uuid: prefixes.
Use the Copy button beside any single UUID, Copy All for the whole list, or Download .txt / .csv to save the batch. Paste them into database seed files, test fixtures, config files or anywhere a unique string is required. Every click produces a brand-new set, so you will never accidentally reuse one.
The math behind it
A version 4 UUID contains 122 bits of randomness, with 6 bits fixed to mark the version and variant. Those 122 random bits give 5.3 undecillion possible values, an unimaginably large space. This tool fills the bits using your browser's cryptographic random generator.
Version 7 keeps the same 128-bit shape but spends its first 48 bits on a Unix timestamp in milliseconds, leaving 74 random bits — so IDs created later sort after IDs created earlier. Version 5 is different again: it hashes a namespace and a name with SHA-1, so the same inputs always produce the same UUID. Because the space is so vast, two independently generated version 4 UUIDs will essentially never collide: you would need about 2.7 quintillion of them for a duplicate to become a coin flip, which at a billion a second takes about 85 years.
Which version should I use?
- Version 4 — the default. Purely random, private, and understood everywhere. Use it for test data, API resource IDs, file names, session IDs and anything where order does not matter.
- Version 7 — the database key. Time-ordered, so new rows land next to each other in a B-tree index instead of scattering across it. Use it for primary keys in PostgreSQL, MySQL and anywhere you insert a lot of rows.
- Version 5 — the stable ID. Made from a namespace and a name, so the same inputs always give the same UUID. Use it when an ID must be reproducible — for example, generating the same ID for python.org on every machine that runs your seed script.
- Version 1 — legacy only. Time-ordered like version 7, but it also embeds a node ID that can identify the machine, and its timestamp counts 100-nanosecond ticks since 15 October 1582. Prefer version 7 for anything new.
- Version 3 — legacy deterministic. Like version 5 but hashed with MD5 instead of SHA-1. It exists for old systems; new code should use version 5.
UUID versions compared
| Version | What is inside | Sorts in time order? | Typical use |
|---|---|---|---|
| Version 1 | 60-bit timestamp + clock sequence + node ID | Yes | Legacy systems; avoid for new code |
| Version 3 | MD5 hash of namespace + name | No | Legacy deterministic IDs |
| Version 4 | 122 random bits | No | General default, test data, tokens |
| Version 5 | SHA-1 hash of namespace + name | No | Stable IDs from a name |
| Version 7 | 48-bit Unix-ms timestamp + 74 random bits | Yes | Database primary keys |
| Nil UUID | All zero bits | — | Placeholder for "no value yet" |
| ULID | 48-bit timestamp + 80 random bits, Base32 text | Yes | Short, URL-safe public IDs |
Versions 1, 3, 4 and 5 come from the original RFC 4122; version 7 was added by RFC 9562 in 2024, which also kept the older versions and added versions 6 and 8.
Version 4 or version 7 for a database key?
This is the question developers ask most about UUIDs, and the answer is version 7 for new tables. The reason is how a B-tree index works: it keeps keys in sorted order, so inserting a new row means writing it next to its neighbours. Version 4 IDs are random, so every insert lands in a random spot in the index — the database keeps splitting pages and rewriting them, which fragments the index and slows writes down. Version 7 IDs are time-ordered, so each new row lands at the end, next to the previous one, almost like an auto-increment key.
Version 7 also stays monotonic within a single millisecond: IDs made in the same millisecond still sort in the order they were created. And it needs no special setup any more — PostgreSQL 18 has a built-in uuidv7() function, Python 3.14 has uuid.uuid7(), .NET 9 has Guid.CreateVersion7(), and Go has uuid.NewV7() in google/uuid. If your stack is older and has no version 7 support, version 4 still works fine as a key; it is just less kind to the index.
The same UUID in every format
| Format | Example | Length |
|---|---|---|
| Standard | 550e8400-e29b-41d4-a716-446655440000 | 36 characters |
| Uppercase | 550E8400-E29B-41D4-A716-446655440000 | 36 characters |
| No hyphens | 550e8400e29b41d4a716446655440000 | 32 characters |
| Braces | {550e8400-e29b-41d4-a716-446655440000} | 38 characters |
| URN | urn:uuid:550e8400-e29b-41d4-a716-446655440000 | 45 characters |
| Base64 | VQ6EAOKbQdSnFkRmVUQAAA== | 24 characters |
All six rows are the same 16 bytes. The version digit is the first digit of the third group — here a 4 — and the variant digit is the first digit of the fourth group — here an a, which means the RFC 9562 variant. Pick a format above and the generator will produce it directly.
Code examples
Python — version 4, version 5 and version 7 (uuid7 needs Python 3.14 or newer):
import uuid print(uuid.uuid4()) print(uuid.uuid5(uuid.NAMESPACE_DNS, "python.org")) print(uuid.uuid7())
JavaScript — version 4 in the browser and in Node:
crypto.randomUUID() // e.g. 550e8400-e29b-41d4-a716-446655440000
PostgreSQL — version 4 as a default, version 7 on PostgreSQL 18:
CREATE TABLE orders ( id uuid PRIMARY KEY DEFAULT gen_random_uuid() ); SELECT uuidv7(); -- PostgreSQL 18
Validate with a regular expression — accepts versions 1 to 7 with the RFC variant digit:
/^[0-9a-f]{8}-[0-9a-f]{4}-[1-7][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/iGlossary
- Version nibble — the 4 bits that say which kind of UUID this is; they appear as the first digit of the third group (a 4 means version 4, a 7 means version 7).
- Variant bits — the 2 or 3 bits that say which layout the UUID follows; they appear as the first digit of the fourth group, and 8, 9, a or b means the current RFC 9562 layout.
- CSPRNG — a cryptographically secure pseudo-random number generator, such as the browser Web Crypto API. Regular Math.random() is not one, and must never be used to make UUIDs.
- Namespace UUID — a fixed UUID that version 3 and version 5 hash together with a name; the standard ones are DNS, URL, OID and X.500.
- Nil UUID — the all-zero UUID, used as a placeholder for "no value yet".
- ULID — a 128-bit ID written as 26 Base32 characters, with a millisecond timestamp first, so it sorts in time order like version 7.
- Monotonic ordering — IDs created later always sort after IDs created earlier, which is what makes version 7 kind to database indexes.
- Crockford Base32 — the alphabet ULIDs use: digits plus letters, with easily confused characters (I, L, O, U) left out.
Sources and method
Method. UUIDs are generated entirely in your browser with the Web Crypto API: version 4 uses crypto.randomUUID() when available, with a crypto.getRandomValues() fallback that sets the version and variant bits by hand. Version 7 is built the same way — 48 bits of current Unix time in milliseconds, then random bits with the version and variant bits fixed. Version 5 hashes the namespace and name with SHA-1, as RFC 4122 specifies. Nothing is sent to a server, and nothing is stored.
Sources. RFC 4122 (the original UUID standard), RFC 9562 (May 2024, which added versions 6, 7 and 8 and replaced RFC 4122), and the W3C Web Crypto API specification. The collision figures use the birthday-paradox result — about 2.7 × 1018 version 4 UUIDs for a 50% chance of a duplicate — which at a billion a second works out at about 85 years.
Frequently asked questions
What is the difference between UUID and GUID?
Can two UUIDs ever be the same?
Why version 4 and not another version?
How long is a UUID, in characters and bytes?
Are UUIDs case-sensitive?
Should I use a UUID or an auto-increment integer as a database key?
How should I store a UUID in a database?
Can I use a UUID as a secret token or password?
What is a ULID?
What is the NIL UUID?
Related tools
Random Number Generator
Password Generator
Barcode Generator
QR Code Generator
Privacy Policy Generator
Random Name Generator
💬 Comments
Have a question about this page, or an idea to make it better? Share it below — your feedback helps everyone who uses this site.