UUID Generator

Generate RFC 4122 version 4 UUIDs using the cryptographic random source of your browser. Create one at a time or in bulk, and format the result for C#, for .NET, for PostgreSQL or as plain text.

Generate

Generated UUIDs


            
            

Ready — paste some input or load the sample.

100% Client-Side · Privacy First. This tool runs entirely inside your browser. Nothing you type is uploaded, logged or sent to a server — you can even use it offline.

Overview

A UUID is a 128 bit identifier that is designed to be generated independently on many machines without any coordination. Version 4 takes all 128 bits from a cryptographically secure random source and sets two of them to mark the version and the variant, which is what makes it a version 4 UUID. That randomness is the point: no central registry, no waiting for a database to hand out an id, and no chance of two machines picking the same value. The format is eight, four, four, four and twelve hexadecimal characters separated by hyphens, which is 32 hex digits in total. This generator produces them using the random source that the browser itself exposes, so the identifiers are as unpredictable as the platform allows. You can request several at once, and you can switch to uppercase, to the form without hyphens, or to the braced form that some template engines and GUID consumers expect.

How to use the uuid generator (v4)

  1. 1Set how many identifiers you need.
  2. 2Choose the format: plain, upper case, without hyphens or in braces.
  3. 3Generate the identifiers.
  4. 4Copy them or download them as a text file.
  5. 5Use them as primary keys, correlation ids or file names.
  6. 6Generate a new batch rather than reusing a value, because an identifier that is reused quietly breaks every reference that points at it.

Cheat sheet

The syntax you will use most, and what each part does.

PatternWhat it means
550e8400-e29b-41d4-a716-446655440000 The canonical form: 32 hexadecimal digits in five groups separated by hyphens.
Version 4 The third group starts with 4, which marks a randomly generated identifier.
550e8400e29b41d4a716446655440000 The same identifier without hyphens, a form several databases and message queues prefer.
{550e8400-e29b-...} The braced form, used by some template engines and by Windows style GUID tooling.
550E8400-E29B-41D4-A716-446655440000 The uppercase form. The value is identical; only the presentation differs.
crypto.randomUUID() The built-in browser method that produces exactly this, with no library needed.

Common mistakes

The primary key index bloats.

A random UUID scatters inserts across the whole index, because the values are not in order. Use a UUIDv7 or a sequential id when the column is a clustered primary key.

The identifiers look like they are not unique.

They are unique. The chance of a collision across a billion version 4 identifiers is about one in a billion.

The value is treated as a number.

A UUID is not a number. Some spreadsheets silently convert it to a float and destroy it, so import it as text.

The identifier leaks information.

A version 1 UUID encodes the timestamp and the machine address. Version 4 carries no such information, which is why it is the right default.

Worked examples

A single identifier

How many UUIDs: 1
Uppercase: off
Remove hyphens: off
Wrap in braces: off

One canonical version 4 UUID with the hyphens.

A batch for seeding a database

How many UUIDs: 5
Uppercase: off
Remove hyphens: on
Wrap in braces: off

Several identifiers, one per line, ready to paste into a script.

Frequently asked questions

Are the identifiers random enough?

Yes. They come from the cryptographic random source of the browser rather than from a general purpose random function, so they are suitable for keys, tokens and identifiers that must not be guessable.

Should I use UUIDs as database primary keys?

Only with care. A random UUID fragments the index of a table as it grows and makes it much slower to insert than an increasing integer. Version 7 identifiers, which are time ordered, are the better answer today.

What is the difference between version 4 and version 7?

Version 4 is fully random, while version 7 puts a timestamp in the high bits and keeps the rest random. Version 7 therefore sorts by creation time, which is exactly what a primary key index wants.

Can I generate them in my own code?

Yes. crypto.randomUUID() in a browser, or the uuid package in Node.js, produce the same kind of value. This tool is the quickest way to get a batch without writing any code.

What does the version digit tell me?

The first digit of the third group is the version, so 4 means a random UUID and 7 means a time ordered one. The first digit of the fourth group is the variant, which is always a hex digit from eight to b.

Do I need the hyphens?

Not for a raw database column, because most databases can store the 32 character form in a fixed length field. Some libraries and file systems expect the canonical hyphenated form, so keep the hyphens unless you know the target accepts the compact one.

Is a UUID safe to expose in a URL?

Yes, because a version 4 UUID contains no information about the machine, the time or the user. A version 1 identifier does leak the creation time and the network address, which is one reason it is rarely used today.

Can two runs produce the same value?

The probability is effectively zero. A version 4 UUID has 122 random bits, so you would need roughly ten billion trillion identifiers to reach a fifty percent chance of one collision.

Why does the format option change the hyphens?

Different systems expect different shapes. The plain form is the canonical RFC 4122 value, the compact form suits a fixed length database column, and the braced form is what some Java and .NET code produces.

Can I use the generated value as a file name?

Yes, and it is a good choice because the value has no characters that a file system dislikes. Add an extension of your own to keep the type of the file visible.

Is the output random enough to be a secret?

It comes from a cryptographic source, so it is strong enough for a correlation id. For an actual token, use a dedicated secret generator, because a UUID is not designed to be revocable or to carry an expiry.