Home › Generators › UUID Generator
🆔

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?

UUID versions compared

VersionWhat is insideSorts in time order?Typical use
Version 160-bit timestamp + clock sequence + node IDYesLegacy systems; avoid for new code
Version 3MD5 hash of namespace + nameNoLegacy deterministic IDs
Version 4122 random bitsNoGeneral default, test data, tokens
Version 5SHA-1 hash of namespace + nameNoStable IDs from a name
Version 748-bit Unix-ms timestamp + 74 random bitsYesDatabase primary keys
Nil UUIDAll zero bits—Placeholder for "no value yet"
ULID48-bit timestamp + 80 random bits, Base32 textYesShort, 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

FormatExampleLength
Standard550e8400-e29b-41d4-a716-44665544000036 characters
Uppercase550E8400-E29B-41D4-A716-44665544000036 characters
No hyphens550e8400e29b41d4a71644665544000032 characters
Braces{550e8400-e29b-41d4-a716-446655440000}38 characters
URNurn:uuid:550e8400-e29b-41d4-a716-44665544000045 characters
Base64VQ6EAOKbQdSnFkRmVUQAAA==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}$/i

Glossary

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?
They are the same thing. GUID, or Globally Unique Identifier, is simply Microsoft's name for the UUID standard. A version 4 GUID generated by Microsoft tools and a version 4 UUID from this page follow the identical format and are interchangeable. Use whichever term your platform's documentation prefers.
Can two UUIDs ever be the same?
In theory yes, in practice no. With 122 random bits, you would need to generate about a billion UUIDs per second for about 85 years before a duplicate became likely. For any real application, from a personal project to a global database, collisions are not a practical concern.
Why version 4 and not another version?
Version 4 UUIDs are purely random, which makes them simple and private: they reveal nothing about when or where they were created. Version 1 embeds a timestamp and a node ID, which can leak information about the machine that made it. Version 7, the newer time-ordered standard, embeds only a Unix timestamp in milliseconds — no machine address — so it sorts in time order without the privacy problem of version 1. For database keys, test data and tokens, version 4 is the standard, safe default, and version 7 is the better choice when you want new rows to land next to each other in an index.
How long is a UUID, in characters and bytes?
A UUID is always 128 bits, or 16 bytes. Written out, that is 32 hexadecimal digits plus 4 hyphens, 36 characters in total, in five groups of 8-4-4-4-12. Without hyphens it is 32 characters; with braces it is 38; as a URN (urn:uuid:...) it is 45. The same 16 bytes written as a ULID take 26 characters.
Are UUIDs case-sensitive?
No. The hexadecimal digits may be upper or lower case — 550E8400 and 550e8400 are the same UUID — and every parser should accept both. Lowercase is the usual convention, so this tool generates lowercase unless you pick the UPPERCASE format. When you store UUIDs as text, pick one case and stick to it so string comparisons behave.
Should I use a UUID or an auto-increment integer as a database key?
An auto-increment integer is small (4 or 8 bytes), sequential and easy to read, but it only works when one database hands out the numbers — and it leaks how many rows you have and in what order they were created. A UUID works across systems with no coordination, which is why distributed apps and offline-first apps use them, but it costs 16 bytes per key. Version 7 is the compromise: a UUID that still sorts in time order, so it behaves much more like a sequential key in an index.
How should I store a UUID in a database?
Use a native UUID type when your database has one — PostgreSQL has uuid, and MySQL has UUID_TO_BIN() to pack the 36-character text into 16 bytes. Storing the text form instead costs 36 bytes per row plus index overhead, so binary storage saves more than half the index space on a large table. If you must store text, store lowercase without braces, and never store it with the urn:uuid: prefix.
Can I use a UUID as a secret token or password?
No. RFC 9562, the standard that defines UUIDs, says they should not be assumed hard to guess and should not be used as security capabilities. A version 4 UUID has 122 bits of randomness, which is less than the 128 bits or more recommended for a real secret, and version 7 has only 74 random bits because its first 48 bits are a public timestamp. For session tokens, API keys and anything that must stay secret, generate at least 128 bits with a cryptographic random generator (for example crypto.randomBytes(32) in Node) instead.
What is a ULID?
A ULID (Universally Unique Lexicographically Sortable Identifier) is a 128-bit ID like a UUID, but written as 26 characters of Crockford Base32 instead of hexadecimal. Its first 48 bits are a millisecond timestamp, like version 7, and the remaining 80 bits are random, so ULIDs also sort in time order. They are shorter and safe to use in URLs, which is why some teams prefer them for public-facing IDs — but they are not UUIDs, and most databases have no native ULID type.
What is the NIL UUID?
The NIL UUID is all zero bits: 00000000-0000-0000-0000-000000000000. It means "no UUID yet" and is used as a placeholder or a null value where a UUID field cannot be empty. Its opposite is the Max UUID, where every bit is 1: ffffffff-ffff-ffff-ffff-ffffffffffff. Neither is ever generated randomly.

Related tools

💬 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.