Monitoring
Solutions
Resources
Free Tools
Pricing
Free Tools / Encoding & data / UUID Generator

UUID Generator

Generate one UUID or a thousand, as random version 4 or time-sortable version 7, formatted the way your code needs. Paste an existing UUID to see its version and, for v7, when it was created.

Inspect a UUID

Runs entirely in your browser — nothing you enter here is sent to a server.

What a UUID is

A UUID — universally unique identifier, called a GUID on Microsoft platforms — is a 128-bit number, written as 32 hexadecimal digits in five groups: 8-4-4-4-12. Its purpose is to let any machine create an identifier that will not collide with one created anywhere else, without asking a central authority. That makes it the natural key for distributed systems: a client can create a record's id before the server has ever seen it.

The digit at the start of the third group is the version, and it tells you how the UUID was made. Two versions matter for new work.

Version 4 — random

122 random bits. No information leaks from it and nothing needs coordinating. The long-standing default, and still right for tokens and identifiers shown to users.

Version 7 — time-ordered

A 48-bit Unix timestamp in milliseconds followed by random bits. New ids sort after old ones, which keeps database indexes compact. The modern choice for primary keys.

Why order matters

Random v4 keys insert all over a B-tree index, causing page splits and poor cache use on large tables. Sequential v7 keys append to the end, like an auto-increment id.

What v7 reveals

The creation time, to the millisecond, is readable by anyone who sees the id. Usually harmless; avoid v7 where the time itself is sensitive.

How unique is "unique"?

With 122 random bits there are about 5.3 × 10³⁶ possible version 4 UUIDs. To reach even a one-in-a-billion chance of a single collision you would need to generate around 100 trillion of them. In practice the risk is not chance but a weak random source — which is why this generator uses the browser's cryptographic generator, crypto.getRandomValues, rather than Math.random.

Store UUIDs in a native uuid column type (PostgreSQL) or as 16 bytes (BINARY(16) in MySQL) rather than 36 characters of text: it more than halves the size of the index and speeds up every comparison.

Frequently asked questions

What is the difference between UUID v4 and v7?

v4 is entirely random. v7 starts with a millisecond timestamp, so ids generated later sort later. Use v7 for database primary keys and v4 where you want no information in the id.

Is a UUID the same as a GUID?

Yes. GUID is Microsoft's name for the same 128-bit identifier. The formats are compatible; Windows tools often show them in upper case with braces.

Can two UUIDs ever be the same?

In theory yes, in practice no. With a proper random source you would have to generate billions per second for decades before a collision became likely.

Should I use a UUID as a database primary key?

It works well when ids must be created outside the database or merged across systems. Prefer v7, and store it in a native or binary column, to avoid the index fragmentation that random v4 keys cause.

Related free tools

A calculator answers once. Monitoring answers every minute.

Upzilla checks your sites, servers and APIs around the clock and alerts you the moment something breaks. 10 monitors free, no card required.

Start monitoring free →