Skip to content
ToolForge
Developer Tools

UUID Generator (v4 and v7)

Free UUID generator. Create random UUID v4 or time-ordered UUID v7 in bulk, with uppercase, hyphenless and braces options. Uses cryptographically secure randomness, nothing is logged.

Free, no sign-upRuns in your browserNothing uploaded

Generated locally with the browser's secure random source
  • 93131222-331c-4afb-bae9-7528749ca7d4
  • 6ac17f45-8b82-4e41-aa70-cda8ae86f65b
  • 68986f6c-ab1e-4de8-b0f8-3a1d82858823
  • f0b3e1bc-8bb3-44e1-ac3a-e30571e5a493
  • 08c71961-89ab-42ac-b5ea-b3d134f2a00a
version
V4
count
5
entropy
122 bits (CSPRNG)
sortable
no

v4 or v7?

Both give the same uniqueness guarantees. v7 starts with a millisecond timestamp, so its values sort chronologically as plain strings. That matters when the UUID is a database primary key: random v4 values scatter inserts across the whole B-tree index, which fragments it and slows writes. Use v7 unless something in your stack requires v4.

A UUID is a 128-bit identifier written as eight groups of four hexadecimal digits. What matters for choosing a version is not the format, all versions look the same, but how the bits are produced and therefore how they sort.

UUID v4 fills 122 bits from a cryptographically secure random source and sets the version and variant bits. Nothing about it encodes a time, a machine or a user, which makes it the right default for anything where predictability would be a problem. This tool uses crypto.getRandomValues, not Math.random, so the output is not guessable.

UUID v7 is the newer option and puts a millisecond timestamp in the leading bits, which means v7 values sort chronologically as plain strings. That makes them dramatically better as database primary keys: B-tree inserts land at the right edge of the index instead of scattering random pages across the whole file, which is where v4 fragmentation and write amplification come from. Use v7 unless something in your stack requires v4.

UUID Generator features

Cryptographically secure
Generated with crypto.getRandomValues, the browser's CSPRNG, so the values are unpredictable. Math.random is never used.
v4 and v7
Random v4 and time-ordered v7, plus v3 and v5 deterministic hashes from a namespace and name when you need reproducibility.
Bulk generation
Up to ten thousand identifiers per run, generated in a worker so the page stays responsive.
Format options
Lowercase, uppercase, hyphenless, and brace-wrapped output.
Export to JSON, CSV, SQL or text
Download as a JSON array, CSV, plain newline-separated text, or a ready-to-run SQL VALUES clause.
Embedded version and variant nibbles
Correctly sets the version nibble at position 12 and the RFC 4122 variant bits, which naive generators often get wrong.

How to use the UUID Generator

  1. Pick a version

    v4 for random identifiers, v7 for sortable identifiers. v7 values embed a timestamp, so they increase in order.

  2. Choose how many

    Set the count from 1 to 10000. One at a time is fine for pasting into a seed file; bulk is for fixtures and migration scripts.

  3. Set the output format

    Standard lowercase with hyphens is the default. Uppercase for systems that require it, without hyphens for fixed-width columns, or wrapped in braces for a Windows registry or LDAP entry.

  4. Copy or download

    Copy one, copy all as a newline-separated list, or download as JSON, CSV or plain text. The list is also formatted as a ready-to-run SQL VALUES clause.

Frequently asked questions

What is the difference between UUID v4 and v7?

v4 is 122 bits of pure randomness. v7 starts with a 48-bit big-endian millisecond timestamp followed by randomness, so v7 values sort chronologically. Same uniqueness guarantees, but v7 is far better as a database primary key because inserts stay sequential in the index.

Should I use UUID or a database-generated ID?

Use a database-generated integer or auto-incrementing key when the database is the only system that needs the identifier; it is smaller and simpler. Use a UUID when identifiers must be created client-side, in more than one system, or without a round trip. Avoid UUID as a primary key on a large InnoDB table without v7 or a sharded scheme, because random v4 values fragment the B-tree badly.

Why is Math.random not used?

Because it is not cryptographically secure. Its internal state is predictable and documented, so an attacker who can observe a few outputs can derive the rest. crypto.getRandomValues draws from the operating system entropy source and is the only correct choice for identifiers that must not be guessable.

Is a UUID the same as a ULID or KSUID?

Same family of ideas, different encoding. A ULID is 26 characters of Crockford base32 encoding 128 bits with a timestamp, and KSUID is base62. UUID v7 is now built into the RFC 9562 standard, so for new projects it is the option that does not need a third-party library.

Are these values stored or sent anywhere?

No. They are generated in your browser and displayed. Nothing is transmitted or logged, and reloading the page produces a completely different set.

What does the version digit mean?

The first hex digit of the third group is the version: 1, 3, 4, 5 or 7. The fourth character of the fourth group encodes the variant and must be 8, 9, a or b for RFC 4122 and 9562. Some hand-rolled generators get the variant wrong, which is exactly why you should use a library.

Every tool, in one place

ToolForge has uuid generator plus a growing set of image, colour and developer tools. All of them run locally in your browser, free and without an account.

Browse all tools