UUID Generator

Version 4 and version 7 UUIDs, generated in your browser. Nothing is sent to a server.

Your UUIDGenerated locally
UUID version

Random. The right choice for almost everything.Time-ordered. Sorts chronologically, ideal for database keys.All zeros. A placeholder or sentinel value.

Formatting

This UUID generator creates universally unique identifiers in your browser, with nothing sent to a server. Pick version 4 or version 7, generate up to 100 at once, and copy or download them. Everything runs client-side, so no value is ever transmitted.

What is a UUID?

A UUID is a 128-bit value used to label something uniquely without asking a central authority for permission. Two systems that have never communicated can each mint one and rely on them not clashing, which is what makes UUIDs useful in distributed software.

The anatomy of a UUID

Every value this UUID generator produces is written as 32 hexadecimal digits in five hyphen-separated groups: 8-4-4-4-12. Those 36 characters encode 128 bits.

Only six of those bits are fixed. Four identify the version, two identify the variant, and the standard dictates both. Everything else is payload.

A diagram breaking down a version 4 UUID into its parts. The 36-character string contains 32 hexadecimal digits in five hyphen-separated groups of 8, 4, 4, 4 and 12. Of the 128 bits, 4 bits at the start of the third group fix the version to 4, and 2 bits at the start of the fourth group fix the variant. The remaining 122 bits are random.

What a UUID generator actually produces: 122 random bits, with the version and variant nibbles fixed by the standard.Structure defined in RFC 9562, which replaced RFC 4122 in 2024.

UUID, GUID, and why they are the same thing

GUID is Microsoft's name for the identical 128-bit structure. The two words describe the same thing and are used interchangeably.

Anything produced by this UUID generator is valid wherever either term is used, so auniqueidentifier column in SQL Server accepts it exactly as a Postgresuuid column does.

How UUIDs are generated

Version 4 — random

A version 4 UUID is almost entirely random. 122 of its 128 bits come straight from a random source, and the remaining six are the fixed version and variant markers.

There is no timestamp, no counter, and no machine identifier. Two values generated a second apart have no relationship to each other.

Where the randomness comes from

This UUID generator uses crypto.getRandomValues(), the browser's cryptographic random source, which draws from the operating system's entropy pool.

Math.random() is never used. It is seeded and deterministic, so recovering the seed would let someone reproduce every value it ever produced.

Version 7 — time-ordered

Version 7 replaces the first 48 bits with a Unix millisecond timestamp and fills the rest with randomness. The result still looks like an ordinary UUID but increases over time.

That single change means a list of version 7 values sorts chronologically as plain text, with no separate created-at column needed to order them.

Why version 7 is better for database keys

Databases store primary keys in a B-tree. Random keys scatter inserts across the whole tree, splitting pages and fragmenting the index.

Time-ordered keys append to the end instead. The index stays compact, and only its hot end needs to stay in memory.

A comparison of how version 4 and version 7 UUIDs behave as database primary keys. Version 4 values are fully random, so consecutive inserts land at scattered positions in a B-tree index, causing page splits and index fragmentation. Version 7 values begin with a millisecond timestamp, so they increase over time and each insert appends to the end of the index, keeping it compact.

Same 128 bits, very different insert behaviour. Version 7 keeps a database index compact where version 4 fragments it.

⚠️ Version 7 leaks the creation time of each record. That is usually harmless and often useful, but if the timing itself is sensitive, stay with version 4.

Why this UUID generator does not offer version 1

Version 1 combines a timestamp with the network MAC address of the machine that created it. That address identifies a specific piece of hardware.

Every value here is generated locally precisely so nothing about you leaves the page. Offering a version that embeds your network adapter's identity would contradict that, so it is not included.

If you need the time-ordering that people historically used version 1 for, version 7 provides it without the hardware identifier.

Can two UUIDs ever be the same?

This is the most common worry people bring to a UUID generator, and the arithmetic is reassuring.

The actual collision probability

122 random bits gives 5.32 × 10³⁶ possible values. Applying the birthday approximation shows how many you would have to generate before a clash became plausible.

A chart showing how the chance of any two version 4 UUIDs colliding grows with the number generated. After one million UUIDs the probability is about 9 in 10 to the 26. After one trillion it is about 9 in 10 to the 14. Reaching a one in a billion chance requires 103 trillion UUIDs, and reaching a 50 percent chance requires 2.31 quintillion, which at a billion UUIDs per second would take 73 years.

Collision probability by volume. Reaching a coin-flip chance of one duplicate takes 73 years of running a UUID generator at a billion values per second.Birthday approximation, p ≈ n² ÷ 2N, where N = 2¹²². Figures are reproducible from that formula.

What this means in practice

Duplicates in real systems almost never come from the UUID generator. They come from code that reuses a value, a migration that copies rows, or a test fixture with a hard-coded identifier.

If you are seeing duplicate UUIDs, check those first. The odds of the random number generator being at fault are far smaller than the odds of a bug.

How to use this UUID generator

Pick a version

The UUID generator opens on version 4, which is the right answer for most cases. Choose version 7 when the value will be a database primary key, and Nil when you need a well-known placeholder.

Choose formatting

Hyphens are on by default, giving the canonical 8-4-4-4-12 form. Turn them off for a compact 32-character string, and switch to uppercase if the receiving system expects it.

Both forms represent the same 128 bits, so this setting only affects how the UUID generator prints them, never their uniqueness.

Generate in bulk

Set the quantity to 5, 10, 50, or 100. The UUID generator produces them all at once, and the list can be copied in a single click or downloaded as a text file for seeding a test database.

Version 7 values generated in bulk stay strictly ordered, even when several are minted within the same millisecond, because a monotonic counter occupies the bits after the timestamp.

When to use a UUID

Database primary keys

A UUID generator lets a client create a record's identity before the server ever sees it, removing a round trip and making offline-first behaviour straightforward. Use version 7 here.

Distributed systems and merge-friendly data

When several services or devices create records independently, sequential integers collide the moment their data is merged. Giving each one its own UUID generator removes the problem entirely, since no coordination is needed.

When not to use one

Do not treat the output of a UUID generator as a secret. It is an identifier designed to be shared, printed in logs and put in URLs, not to be unguessable in an adversarial sense.

For values that must stay secret, use the secret key generatoror the API key generator. For an arbitrary token where you control the alphabet and length, use the random string generator.

Frequently asked questions

How is a UUID generated?

A version 4 UUID is 122 random bits plus 6 fixed bits marking the version and variant. This UUID generator draws those bits from crypto.getRandomValues(), the browser’s cryptographic random source. A version 7 UUID replaces the first 48 bits with a millisecond timestamp, so values sort in the order they were created.

Can two UUIDs ever be the same?

In practice, no. A version 4 UUID carries 122 random bits, or 5.32 × 10³⁶ possible values. Generating a billion every second, it would take 73 years to reach a 50% chance of one collision. A bug in your own code is far more likely.

What is the difference between a UUID and a GUID?

Nothing meaningful. GUID is Microsoft’s name for the same 128-bit identifier, and the terms are used interchangeably. Values produced here are valid as either.

Which UUID version should I use?

Use version 4 unless the value will be a database primary key, in which case use version 7. Version 7 sorts chronologically, so inserts land at the end of the index instead of scattering across it, which keeps the index compact.

Why is there no version 1 option?

Version 1 embeds the generating machine’s MAC address and a precise timestamp, which leaks information about the device that created it. Every value on this site is generated locally for privacy reasons, so offering a version that identifies your hardware would work against that.

Are these UUIDs random enough to be secure?

The randomness is cryptographic, but a UUID is an identifier rather than a secret and should not be used as one. Do not use a UUID as a password, session token, or API key. Use the secret key generator for those.

Is this UUID generator free, and is there a limit?

It is free, with no account and no usage limit. You can produce up to 100 at a time, copy them all in one click, or download them as a plain text file.

Does it follow the official standard?

Yes. Output conforms to RFC 9562, the 2024 specification that replaced RFC 4122. Version and variant bits are set exactly as the standard requires, and version 7 uses a monotonic counter so values generated in the same millisecond still sort correctly.

More free generators

Every generator here runs locally in your browser, with no account and no limits.

Methodology

Last updated

Which standard this follows

Output conforms to RFC 9562 (2024), which obsoletes RFC 4122. Version bits occupy the high nibble of byte 6 and variant bits the high bits of byte 8, exactly as the specification requires.

How version 7 stays ordered

48-bit unix_ts_ms · 4-bit version · 12-bit counter · 2-bit variant · 62-bit random

The 12 bits after the version hold a monotonic counter rather than pure randomness, following RFC 9562 §6.2. Without it, values minted inside the same millisecond would sort randomly among themselves, defeating the purpose of the version. The counter is seeded randomly each millisecond so values stay unpredictable.

How the collision figures are calculated

p ≈ n² ÷ 2N, where N = 2¹²² = 5.32 × 10³⁶

The standard birthday approximation. Every number in the collision table can be reproduced from this formula, which is why no external source is cited for it.