Skip to main content

UUID Generator

Batch-generate UUID v4 / v7 with hyphen removal, uppercase and validation

Batch-generate UUID v4 and v7, with an adjustable countOptional uppercase and hyphen removal for different database requirementsPaste to validate: detects the version and reads the v7 timestampUses cryptographically secure browser randomness, never predictable pseudo-randomness
Version
Validate & decode

Result10 generated

A UUID has 122 random bits, so you would need roughly 2.7×10¹⁸ of them before a collision becomes 50% likely. At everyday volumes they are safe to treat as unique.

Short random ID

easMnaQCD2nW

Validate & decode

Last updated: 2026-10-10

About this tool

UUID is the most widely used globally unique identifier in distributed systems, and the two you meet most often are v4 (purely random) and v7 (time-ordered). This tool covers batch generation, format conversion and reverse validation - paste a UUID and it tells you which version it is, and for a v7, exactly when it was created. That last part is genuinely useful when you are chasing down a data problem.

Features

UUID v4: purely random

122 of the 128 bits are random, with no time or machine information encoded. Unpredictable, so it suits session IDs, tokens and other security contexts.

UUID v7: time-ordered

The leading 48 bits are a millisecond timestamp, so generated IDs increase roughly in time order. As a database primary key this avoids the index fragmentation that random v4 writes cause - that is the whole point of v7.

Cryptographically secure source

Randomness comes from WebCrypto getRandomValues, not Math.random. The latter is a predictable PRNG, and IDs built on it can be enumerated in security-sensitive settings.

Reverse validation and decoding

Paste a UUID to confirm the format is valid and see which version it is; for a v7 it also recovers the creation time, which makes it easy to tell how fresh a record is.

Short random IDs

Beyond standard UUIDs, short IDs are available with four alphabets: hex, alphanumeric, lowercase or digits. Rejection sampling is used so every character is equally likely.

Batch copy and download

The common case is wanting dozens or hundreds at once, so there is one-click copy of everything or download as a text file to feed straight into a script or database.

How to use

  1. 1

    Pick a version

    For a database primary key choose v7 (ordered writes, index-friendly). For session IDs, tokens and other security identifiers choose v4 (unpredictable).

  2. 2

    Set the count and format

    Adjust the count as needed. Some databases store UUIDs as a 32-character string with no hyphens - tick “Remove hyphens” and you save a conversion step.

  3. 3

    Generate and take the result

    Click generate, then copy everything or download a file to paste straight into code or import into a database.

  4. 4

    Validate an existing UUID

    When handed a UUID of unknown origin, paste it into the validation box to confirm the format and version; if it is a v7 you also see when it was created.

Options

UUID v4
122 of the 128 bits are random, with 6 bits identifying the version and variant. Collision probability is vanishingly small: you would need roughly 2.7×10¹⁸ of them before a repeat becomes 50% likely.
UUID v7
A 48-bit Unix millisecond timestamp, then a 4-bit version, 12 random bits, a 2-bit variant and 62 random bits. Time-ordered while still guaranteeing uniqueness.
Hyphens
The standard form is 8-4-4-4-12, 36 characters in total. Without hyphens it is 32 hex characters, the form some databases and APIs expect.
Letter case
RFCs call for lowercase hex, but parsers must be case-insensitive. Some systems conventionally use uppercase, so the output can be switched as needed.
Short random ID
Not a UUID at all - just a fixed-length random string. Useful for short links, order numbers and other length-sensitive cases, but collisions rise sharply as the length shrinks.

Common use cases

  • Generating primary keys for database tables (UUID v7 is friendlier to indexes)
  • Producing unpredictable identifiers such as session IDs and API tokens
  • Giving distributed nodes local IDs that cannot collide
  • Creating IDs in bulk for front-end mock data
  • Validating UUIDs coming in from an external system
  • Recovering the creation time of a UUID v7 to judge how fresh a record is
  • Generating short link codes or order numbers

FAQ

Questions you may have about this tool

Should I choose UUID v4 or v7?

It depends on the purpose. For a database primary key, choose v7 - the timestamp sits in the high bits, so generated IDs increase with time and writes do not scatter randomly the way v4 writes do, which would make the B-tree index split constantly and hurt performance on large tables. For session IDs, tokens and anything needing unpredictability, choose v4, since it carries no time information and its generation pattern cannot be inferred from the outside.

Can UUIDs collide?

In theory yes, but the probability is minuscule. v4 has 122 random bits, so you would need to generate roughly 2.7×10¹⁸ UUIDs before a collision becomes 50% likely - at a billion per second that still takes centuries. In practice you can safely treat them as unique.

Why not generate UUIDs with Math.random?

Because Math.random is a predictable PRNG. An attacker who observes a few outputs may be able to derive the following sequence and guess the session IDs or tokens you generate. This tool uses WebCrypto getRandomValues, an operating-system-provided cryptographically secure source. If the environment does not support it, the tool reports an error rather than quietly degrading.

Can I still use a UUID after removing the hyphens?

Yes - the content is identical, only the presentation differs. The standard form is 8-4-4-4-12, 36 characters; without hyphens it is 32 hex characters. Some databases (MySQL BINARY(16) storage, certain APIs) use the latter and you get to skip a conversion.

How do I read the timestamp inside a UUID v7?

The leading 48 bits of a v7 are a Unix millisecond timestamp. The validation box in this tool parses and displays it automatically. That is handy for troubleshooting - you can tell whether a record was created three days ago or written just now.

How does a short random ID differ from a UUID?

A UUID is a 128-bit standard format following an RFC, with version and variant bits; a short ID is merely a fixed-length random string following no standard. Short IDs suit length-sensitive cases like short links and order numbers, but remember that shorter means more collisions, so they are unsuitable for large datasets.

Are the IDs I generate uploaded or logged?

No. The randomness is produced by your browser and no network request is made, so we can neither receive nor record what you generate. You can disconnect from the network and confirm the tool still works.

Why do UUIDs contain some fixed digits?

Those are the version and variant bits. The 13th hex character is the version (4 for v4, 7 for v7), and the top two bits of the 17th character are fixed at 10 (so it is always 8, 9, a or b). Those positions are not random - the specification requires them so parsers can identify the version and avoid collisions with other UUID variants.