Free Online Tool

UUID Generator

Generate v1, v4, v5 and v7 UUIDs in bulk, validate and decode any UUID, and convert between formats — free, no sign-up, everything in your browser.

Version
How many?
Format
Your UUIDs
Recent batches (this visit only)
Validate, decode & convert a UUID

What is a UUID?

A UUID (Universally Unique Identifier, also called a GUID) is a 128-bit identifier that can be created on any machine without asking a central authority — which is exactly why databases, APIs, and distributed systems use them as keys. In text form a UUID is 32 hexadecimal characters in five groups separated by hyphens: 8-4-4-4-12, for example 550e8400-e29b-41d4-a716-446655440000. The 13th character tells you the version, and the first character of the fourth group tells you the variant. The current standard is RFC 9562 (May 2024), which obsoletes the older RFC 4122.

UUID versions compared

Not all UUIDs are built the same way. The right version depends on whether you need randomness, time ordering, or a repeatable value.

VersionHow it is builtSortable by time?Best for
v1Gregorian timestamp (100-nanosecond ticks since 1582) + nodeYes, with reorderingLegacy systems, time-ordered IDs where v6/v7 are unavailable
v3MD5 hash of a namespace + nameNoDeterministic IDs from names (legacy)
v4122 bits of cryptographic randomnessNoGeneral-purpose IDs, session tokens, API keys
v5SHA-1 hash of a namespace + nameNoDeterministic IDs from names (preferred over v3)
v6Like v1, with timestamp bits reordered for sortingYesTime-ordered database keys
v7Unix timestamp in milliseconds + random bitsYesDatabase primary keys, event IDs, anything indexed by time
v8Custom / experimental layoutsDependsVendor-specific designs
NilAll bits zero: 00000000-0000-0000-0000-000000000000—"No value" placeholder
MaxAll bits one: ffffffff-ffff-ffff-ffff-ffffffffffff—Upper-bound sentinel value

This generator produces v1, v4, v5, v7, Nil, and Max. v3, v6, and v8 are documented above for completeness; v3 is superseded by v5, and v8 is reserved for custom layouts.

Which version should you use?

  • Default choice: v4. Random, private, and understood everywhere. Use it unless you have a specific reason not to.
  • Database primary keys: v7. Because v7 starts with a timestamp, new rows land next to each other in a B-tree index instead of at random positions. Random v4 keys force inserts all over the index, which RFC 9562 itself warns can hurt performance dramatically on large tables.
  • Same input, same ID every time: v5. Hashing a namespace + name means you can regenerate the identical UUID later — useful for seeding data and deduplication.
  • Avoid v1 for new work. Classic v1 embeds a MAC address in the node field, which can leak hardware identity — another issue RFC 9562 calls out directly. This tool's v1 uses a random node, never your real MAC address.

How likely is a UUID collision, really?

A v4 UUID has 122 random bits, giving 2122 — about 5.3 × 1036 — possible values. Collisions follow the birthday bound: you would need to generate roughly 261 UUIDs (about 2.3 billion billion) before the chance of even one collision reaches 50%. Put another way, generating 2 billion UUIDs per second, non-stop, it would take around 36 years to reach that point. For any real application, v4 collisions are not a practical concern — weak randomness is a bigger risk than the math, which is why this tool uses your browser's cryptographic random source (crypto.getRandomValues / crypto.randomUUID), never Math.random().

UUID vs auto-increment IDs, GUIDs, ULIDs, and NanoIDs

  • UUID vs auto-increment integers: integers need a central counter, leak how many records you have, and break when two databases merge. UUIDs work offline and merge cleanly — at the cost of 16 bytes instead of 4–8.
  • UUID vs GUID: the same thing. GUID is Microsoft's name for UUIDs; .NET stores them with the first three groups byte-reversed, which is why the converter above includes a .NET GUID output.
  • UUID vs ULID: ULIDs are also time-sortable but use a different 26-character text encoding and are not an IETF standard the way RFC 9562 UUIDs are.
  • UUID vs NanoID: NanoIDs are shorter, URL-friendly random strings — handy for public URLs, but they are not UUIDs and carry fewer bits unless configured otherwise.

How to store UUIDs in a database

  • PostgreSQL: use the native uuid type — id UUID PRIMARY KEY DEFAULT gen_random_uuid(). It stores 16 bytes and validates input.
  • MySQL: store as BINARY(16) for compact storage, converting with UUID_TO_BIN() / BIN_TO_UUID(), or use CHAR(36) if readability matters more than size.
  • General rule: for time-ordered tables, prefer v7 over v4 so new rows append to the index instead of scattering across it.

UUID in code

Generate a v4 UUID in the languages developers actually use:

JavaScript import { randomUUID } from 'crypto'; const id = randomUUID(); // e.g. 550e8400-e29b-41d4-a716-446655440000
Python import uuid id = uuid.uuid4() # random v4 id7 = uuid.uuid7() # time-ordered v7 (Python 3.12+)
PHP $id = \Ramsey\Uuid\Uuid::uuid4()->toString(); // or, without a library (PHP 7+): $data = random_bytes(16); $data[6] = chr(ord($data[6]) & 0x0f | 0x40); $data[8] = chr(ord($data[8]) & 0x3f | 0x80); $id = vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($data), 4));
SQL (PostgreSQL) INSERT INTO orders (id, total) VALUES (gen_random_uuid(), 49.99);

How to use this generator

  1. Pick a version — v4 for general use, v7 for database keys, v5 for repeatable IDs, v1 for legacy compatibility.
  2. Choose how many you need, from 1 to 1,000 at once.
  3. Pick a format: uppercase, no hyphens, braces, URN prefix, or quotes-and-commas for pasting into code arrays.
  4. Generate, copy one UUID or the whole batch, or download as TXT, CSV, JSON, or a ready-to-run SQL INSERT script.
  5. Paste any UUID into the validator to check it, see its version and variant, decode its timestamp (v1/v7), and convert it to base64, decimal, or .NET GUID byte order.

Frequently asked questions

What is a UUID?

A 128-bit identifier written as 32 hex characters in an 8-4-4-4-12 pattern. It can be generated anywhere without a central registry, which is why it works as a database key, API ID, or session token.

Should I use v4 or v7?

v4 for most things — it is random and private. v7 when the UUID is a database primary key or event ID, because its leading timestamp keeps new rows together in the index instead of scattering them.

Are UUIDs truly unique?

For practical purposes, yes. A v4 UUID has 2122 possible values; the birthday bound means about 261 UUIDs would be needed for a 50% collision chance.

Can a UUID be guessed or used as a password?

No. A v4 UUID is an identifier, not a secret: 122 bits is less than modern key sizes, and UUIDs are often exposed in URLs and APIs. Never use one as a password or API secret.

What is the difference between a UUID and a GUID?

None in meaning — GUID is Microsoft's term for UUID. The only practical difference is storage: .NET GUIDs byte-reverse the first three groups, which the converter on this page handles.

How do I store UUIDs in MySQL or PostgreSQL?

PostgreSQL has a native uuid type. MySQL stores them most compactly as BINARY(16) with UUID_TO_BIN(), or as CHAR(36) for readability.

Does v1 leak my MAC address?

Classic v1 can, because the node field historically held a MAC address. This tool's v1 uses a random node instead, and for new projects v7 is the better time-ordered choice anyway.

Is this generator free, and is my data uploaded anywhere?

Yes, free with no sign-up and no limits. Everything runs in your browser — nothing you generate is sent to a server, stored, or logged.

What are Nil and Max UUIDs?

Nil is all zeros (00000000-0000-0000-0000-000000000000) and means "no value"; Max is all ones and is used as an upper-bound sentinel. Both are defined in RFC 9562.

Can I generate UUIDs in bulk for seeding a database?

Yes — generate up to 1,000 at once and download them as TXT, CSV, JSON, or a SQL INSERT script ready to run.

Sources and further reading: RFC 9562 — Universally Unique IDentifiers (UUIDs), which obsoletes RFC 4122. Version, variant, timestamp, and collision figures on this page follow that specification.

Next step

Need another tool?

Try the Phone Storage Calculator, Data Usage Calculator, or AI Image Prompt Builder.

Browse all of CripsyWire