UUID Generator

Create random version 4 or sortable version 7 UUIDs with the Web Crypto API, in standard, uppercase, compact, braces or URN format, or decode an existing UUID.

What to do
Version
4 (random)
Random bits
122
IDs for a 50% collision
≈ 2.7 × 10¹⁸birthday bound for 122 random bits
Format
Lowercase with hyphens (standard)
UUID (generated in your browser)xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx122 random bits
  • UUIDs are created on your device with the Web Crypto API and are never sent anywhere.

Show the work

  1. Draw 128 bits from crypto.getRandomValues, the browser’s cryptographically secure generator.
  2. Overwrite 4 bits with the version (0100 = 4) and 2 bits with the variant (10), leaving 122 random bits.
  3. Print the 16 bytes as 32 hex digits grouped 8-4-4-4-12.

A UUID (universally unique identifier) is a 128-bit label that any computer can create on its own with essentially no risk of repeating one made elsewhere. Databases use them as primary keys, distributed systems use them to name events and files, and APIs use them in URLs. This generator creates version 4 (fully random) and version 7 (time-ordered) UUIDs using your browser’s cryptographically secure random number generator, and it can also take apart any existing UUID to show its version, variant and embedded timestamp.

How to use the UUID generator

  1. Choose Generate UUIDs or Inspect a UUID.
  2. To generate, pick the version (4 or 7), how many (1–500) and a format: standard lowercase, uppercase, compact (no hyphens), Windows-style braces or a urn:uuid: URN.
  3. Press Generate or inspect. The first UUID appears on the tape and the full list below; press again for a fresh batch.
  4. To inspect, paste a UUID in any common form. The tool reports the version, variant, timestamp (for versions 1, 6 and 7), clock sequence and node, and color-codes each field.

UUIDs are created on your device and are never sent to CalcFluent or anyone else.

UUID structure

A UUID is written as 32 hex digits in five groups: 8-4-4-4-12. Two fields are fixed by the standard (RFC 9562, published in 2024 to replace RFC 4122):

xxxxxxxx-xxxx-Vxxx-Nxxx-xxxxxxxxxxxx
  • V, the 13th digit, is the version: 4 for random, 7 for Unix-time-based, 1 and 6 for Gregorian-time-based, 3 and 5 for name-based hashes.
  • N, the 17th digit, holds the variant. For standard UUIDs its top two bits are 10, so N is always 8, 9, a or b.

Version 4 fills the remaining 122 bits with random data. Version 7 puts the Unix time in milliseconds in the first 48 bits (12 hex digits) and fills the other 74 with random bits; within one batch this tool uses 12 of them as a counter so the list stays in order.

Worked example

Inspect 01932c07-209c-7a1b-8c4d-6e0f12a3b4c5.

Version: the 13th digit is 7, so this is a time-ordered UUID.

Variant: the 17th digit is 8 = 1000 in binary; it starts with 10, the standard variant.

Timestamp: the first 12 digits, 01932c07209c, are hex for 1,731,610,484,892 milliseconds since 1970-01-01 UTC, which is 2024-11-14 18:54:44.892 UTC.

Version 4 vs. version 7

Version 4 Version 7
Content 122 random bits 48-bit ms timestamp + 74 random bits
Sortable by creation time No Yes (to the millisecond)
Database index friendliness Poor: inserts land all over the index Good: new keys append near the end
Reveals creation time No Yes
Typical use Tokens, public IDs, file names Primary keys, event and log IDs

Older version 1 UUIDs embed a timestamp and often the machine’s network (MAC) address; version 6 reorders version 1’s timestamp so it sorts. Both still appear in legacy systems, and the inspector decodes them.

How unlikely is a collision?

For n random UUIDs drawn from 2¹²² possibilities, the chance of any duplicate is about n² ÷ 2¹²³. A billion UUIDs (10⁹) give a probability around 10⁻¹⁹. Real-world duplicates come from bugs — a seeded, non-cryptographic generator, cloned virtual machines that reuse state, or code that copies an ID instead of generating a new one — not from the math.

Storage tips

  • Store UUIDs as a native UUID type or as 16 bytes, not as a 36-character string, to halve index size.
  • Keep one case in your system; lowercase is the canonical form in RFC 9562.
  • If IDs appear in URLs, the compact or Base64-style forms save space, but convert back to the canonical form for storage.

For random passwords instead of identifiers, use the password generator. To turn a v7 timestamp or any epoch time into a readable date, try the Unix timestamp converter.

Frequently asked questions

Should I use UUID version 4 or version 7?

Use v7 for database primary keys and anything you will sort or index: its leading timestamp keeps new rows together in B-tree indexes and makes IDs roughly sortable by creation time. Use v4 when an ID must reveal nothing, not even when it was created.

Can two random UUIDs collide?

In practice, no. A version 4 UUID has 122 random bits, so you would need about 2.7 × 10¹⁸ of them for a 50% chance of a single duplicate. Generating a billion per second, that would take over 85 years.

Is a GUID the same as a UUID?

Yes. GUID (globally unique identifier) is Microsoft's name for the same 128-bit format. Windows tools often print GUIDs in uppercase inside braces, which the Format menu can produce.

Are these UUIDs safe to use as secret tokens?

They come from a cryptographically secure generator, but UUIDs are designed to be unique, not secret: v7 exposes its creation time and many systems log IDs freely. For password-reset links or API keys, use a dedicated random token of at least 128 bits.

What is the nil UUID?

00000000-0000-0000-0000-000000000000, the all-zero value used to mean "no UUID". RFC 9562 also defines the max UUID, ffffffff-ffff-ffff-ffff-ffffffffffff, as a sentinel.

Last reviewed October 2026 by the CalcFluent editorial team. How we check our calculators.