Skip to content

UUID v4 Generator

Make a batch of correctly formatted version 4 UUIDs for test data, fixtures and documentation, in the letter case and layout your system expects.

Runs in your browserFree, no sign-upLast reviewed

Settings

Fill in the settings to see your result here.

Your result appears here instantly — nothing is uploaded.

Quick answers

What is a version 4 UUID?
A 128-bit identifier in which 122 bits are random and 6 are fixed to mark the version and variant. It is written as 32 hexadecimal digits in five groups, 8-4-4-4-12. It needs no central registry: any program can create one and expect it to be unique.
How long is a UUID?
36 characters with hyphens (32 hex digits plus 4 hyphens), 32 characters without, and 16 bytes when stored in binary. All versions have the same length.
How can I tell a UUID is version 4?
Look at the first character of the third group: it is 4. The first character of the fourth group is 8, 9, a or b. In f47d851c-fd7f-4efa-874c-dacca7153c14 those are the 4 in 4efa and the 8 in 874c.
Can two version 4 UUIDs be the same?
With properly random generation it is possible but negligible. There are 2^122 values, about 5.3 undecillion. You would need to generate roughly 103 trillion before the chance of a single duplicate reached one in a billion, and about 2.71 quintillion for a 50% chance.
Is a GUID the same as a UUID?
Yes. GUID is Microsoft's name for the same 128-bit identifier and the two are interchangeable. GUIDs are often shown in uppercase and sometimes wrapped in braces. Tick Uppercase for the capital form; this tool does not add braces.
Can I use these UUIDs in production?
Use them for testing, examples and mock data. Each batch is produced by a pseudo-random generator started from one of a million seeds, so the values are neither unguessable nor guaranteed unique at scale. For live systems call crypto.randomUUID() or your language's UUID library.

How UUID Generator works

This tool produces 1 to 50 version 4 UUIDs per click in the standard 8-4-4-4-12 layout, for example f47d851c-fd7f-4efa-874c-dacca7153c14. You can switch the output to uppercase and remove the hyphens to get a bare 32-character hex string. Every value has the version digit 4 and a variant digit of 8, 9, a or b in the right places, so it passes UUID validation. One limit to know before you use them: the values come from a general-purpose pseudo-random generator, not a cryptographic one. They are well suited to sample data, test fixtures and placeholder IDs. For identifiers in a production system, generate UUIDs in your own code with the functions listed below.

Example output in each format

Real output from the tool. A new batch is produced each time you press Generate.

Default: lowercase with hyphens

How many: 3, Uppercase unticked, Include hyphens ticked

f47d851c-fd7f-4efa-874c-dacca7153c14, 1ae530ac-09be-409e-ad74-48b41d6e202c, 6b615ffc-4092-482d-b3c4-cf2df809ba9f

Length 36 chars. The third group of each starts with 4; the fourth groups start with 8, a and b.

Uppercase, GUID style

How many: 2, Uppercase ticked, Include hyphens ticked

F47D851C-FD7F-4EFA-874C-DACCA7153C14, 1AE530AC-09BE-409E-AD74-48B41D6E202C

Without hyphens

How many: 2, Uppercase unticked, Include hyphens unticked

f47d851cfd7f4efa874cdacca7153c14, 1ae530ac09be409ead7448b41d6e202c

Length 32 chars. The version digit is now the 13th character and the variant digit the 17th.

Uppercase without hyphens

How many: 1, Uppercase ticked, Include hyphens unticked

F47D851CFD7F4EFA874CDACCA7153C14

UUID v4 format, group by group

Using f47d851c-fd7f-4efa-874c-dacca7153c14 as the example.

GroupExampleHex digitsContents
1f47d851c832 random bits
2fd7f416 random bits
34efa4Version digit 4, then 12 random bits
4874c4Variant digit (8, 9, a or b, carrying 2 random bits), then 12 random bits
5dacca7153c141248 random bits

32 + 16 + 12 + 14 + 48 = 122 random bits. The other 6 bits are the fixed version (4 bits) and variant (2 bits).

How to generate a version 4 UUID in code

For real identifiers, use the built-in function for your platform. Each of these returns a version 4 UUID by default.

Language or toolCall
JavaScript (browsers, Node.js)crypto.randomUUID()
Pythonimport uuid; uuid.uuid4()
Javajava.util.UUID.randomUUID()
C# / .NETGuid.NewGuid()
PostgreSQL 13 and laterSELECT gen_random_uuid();
Rubyrequire 'securerandom'; SecureRandom.uuid
Linux or macOS shelluuidgen
PowerShell[guid]::NewGuid()

In browsers crypto.randomUUID() is available on secure (HTTPS) pages only.

UUID versions compared

VersionBuilt fromSortable by timeTypical use
v1Timestamp plus a node ID, traditionally the MAC addressNot as textLegacy systems; can reveal when and where it was made
v3MD5 hash of a namespace and a nameNoSame input always gives the same UUID
v4122 random bitsNoGeneral-purpose IDs with no embedded information
v5SHA-1 hash of a namespace and a nameNoRepeatable IDs derived from names; preferred over v3
v6v1 timestamp with the fields reorderedYesDrop-in sortable replacement where v1 is already used
v748-bit Unix millisecond timestamp, then random bitsYesDatabase primary keys that should insert in order
v8Custom, application-defined layoutDependsExperimental or vendor-specific schemes

Versions 6, 7 and 8 were standardised in RFC 9562 (2024), which replaced RFC 4122. This tool generates v4 only.

What these generated UUIDs are suitable for

The About panel under the results reports 122 random bits because that is how many bits a version 4 UUID has room for. How unpredictable a particular UUID is depends on the generator behind it. Here, each press of Generate starts a small pseudo-random generator from a seed between 0 and 999,999 and fills in the hex digits from it. The results are valid and look fully random, but there are only a million possible batches, and anyone who knows the method could reproduce them.

That makes the tool a good fit for work where the UUID only needs to be well formed: seed rows in a development database, IDs in API documentation and Postman examples, unit-test fixtures, mock JSON, spreadsheet rows that need a stand-in key, and trying out a validation rule or a column type. It is the wrong source for record IDs in a live system, and for anything that works as a secret, such as password-reset links, share URLs or session identifiers. Those should come from a cryptographically secure generator, and secret tokens are usually better as dedicated random strings than as UUIDs.

Regex to validate a version 4 UUID

^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$

Apply it case-insensitively so that uppercase values match too. The literal 4 checks the version digit and [89ab] checks the variant digit. To accept any UUID version, replace the 4 with [0-9a-f]. For the hyphen-free form, remove the four hyphens from the pattern. Every value this tool outputs with hyphens matches the pattern as written.

How to get your result

  1. 1

    Leave Version on Version 4 (random). It is the only version this tool makes.

  2. 2

    Enter How many UUIDs you need, from 1 to 50.

  3. 3

    Tick Uppercase if your system stores them in capitals, as GUIDs often are on Windows.

  4. 4

    Untick Include hyphens to get the compact 32-character form.

  5. 5

    Press Generate, then copy individual values or download the list as uuids.txt. Press Generate again for a new batch.

Questions people ask

Should UUIDs be uppercase or lowercase?
The standard says to output lowercase and to accept either case on input, so f47d... and F47D... are the same UUID. Lowercase is the safer default. Use uppercase only when a system that compares them as plain text expects capitals.
Is a UUID without hyphens still valid?
It is the same 128-bit value, and many databases and libraries accept the 32-character form. The canonical text format includes the hyphens, so strict validators may reject it. Keep the hyphens unless a field length or naming rule forces you to drop them.
What is the difference between UUID v4 and v7?
v4 is entirely random. v7 begins with a millisecond timestamp, so values created later sort after earlier ones. That makes v7 kinder to database indexes, while v4 reveals nothing about when it was created. This tool does not generate v7.
Are version 4 UUIDs good database primary keys?
They work and are widely used, especially when IDs must be created on several machines without coordination. On large tables their random order spreads inserts across the whole index, which costs write performance. Store them in a native uuid or 16-byte binary column, and consider v7 for high insert volumes.
How many UUIDs can I generate at once?
Up to 50 per click. For more, press Generate again and download each batch, or generate them in code: a loop around crypto.randomUUID() or uuid.uuid4() produces thousands in well under a second.
Is a UUID secure enough to use as a secret token?
Not by design. A UUID's job is to be unique, not secret. A properly random v4 is hard to guess, but UUIDs get logged, put in URLs and shown to users. Use a dedicated random token from a cryptographic source for anything that grants access.
What is the nil UUID?
The value with every bit set to zero: 00000000-0000-0000-0000-000000000000. It is used to mean no value or not yet assigned. It is not a version 4 UUID and this tool will never output it.
Do I need to be online to generate UUIDs?
Only to load the page. The values are created by JavaScript in your browser, and nothing you generate is sent to or stored on a server.

Looking for something else? Browse all generators or see every tool.