SecurityNew

UUID Generator for v4 and v7 with Bulk Output

Generate v4 and v7 UUIDs in bulk and inspect any UUID or GUID

100% client-side — your data never leaves your browserNo data stored or uploadedFree for lifetime · No signup
Version

Validate and inspect a UUID

What is a UUID?

A UUID (Universally Unique Identifier) is a 128-bit value written as 32 hexadecimal digits in five hyphenated groups: 8-4-4-4-12, for example 3d609887-76b3-4fd4-b371-49e10ee830a7. The format is defined by RFC 9562, which replaced RFC 4122 in 2024. Because a UUID can be generated anywhere without asking a central server for the next number, it is the standard way to give database rows, API resources, files, messages and idempotency keys an ID before they are ever saved.

Two fields inside the value describe how it was made. The first digit of the third group is the version (the 4 in 4fd4), and the first digit of the fourth group encodes the variant (8, 9, a or b for RFC 9562 UUIDs). The inspector on this page reads both, so you can paste any ID from a log or a database and see what produced it.

UUID v4 vs v7, and why v7 is better for database primary keys

Version 4 is 122 bits of randomness. It is the default almost everywhere, and the chance of two v4 values colliding is negligible: you would need to generate around 2.7 quintillion of them for a 50% chance of a single duplicate. Its weakness is that random values land all over a B-tree index, so inserting millions of v4 primary keys into PostgreSQL, MySQL (InnoDB clusters rows by primary key) or SQL Server causes page splits, poor cache locality and index bloat.

Version 7 fixes that. Its first 48 bits are the Unix timestamp in milliseconds, followed by the version, a counter and random bits. New IDs therefore sort after older ones, inserts append to the end of the index like an auto-increment integer would, and you can still generate them on any machine without coordination. This generator also uses the 12-bit rand_a field as a counter within the same millisecond (RFC 9562 method 1), so a bulk batch stays in creation order. The trade-off: a v7 UUID reveals when it was created, so do not use it where the creation time is sensitive. For public, unguessable tokens prefer v4 or a dedicated random token.

GUID vs UUID

A GUID (Globally Unique Identifier) is Microsoft's name for the same 128-bit identifier, and in practice the two terms are interchangeable. What differs is presentation: Windows tools, the registry and .NET often print GUIDs in uppercase and wrapped in braces, such as {3D609887-76B3-4FD4-B371-49E10EE830A7}. Tick Uppercase and Braces above to produce that format. One real difference to know about: .NET's Guid.ToByteArray() and SQL Server store the first three groups little-endian, so the raw bytes of a GUID differ from the RFC byte order even though the text form is identical.

Generate a UUID in Python, JavaScript, SQL Server and PostgreSQL

Python: import uuid; uuid.uuid4() returns a random UUID, and str(uuid.uuid4()) gives the hyphenated text. Python 3.14 adds uuid.uuid7().

JavaScript: crypto.randomUUID() is built into every modern browser and Node.js 19+ (also available as require('node:crypto').randomUUID() in Node 14.17+). It returns a lowercase v4 string. For v7 in Node, the uuid package exposes v7().

SQL Server: SELECT NEWID(); returns a random UNIQUEIDENTIFIER. NEWSEQUENTIALID() is only allowed as a column default and gives sequential values that sort by SQL Server's own byte order rather than RFC 9562 v7.

PostgreSQL: SELECT gen_random_uuid(); is built in from version 13 (earlier versions need the pgcrypto extension). PostgreSQL 18 adds uuidv7() for time-ordered keys.

This page uses the same primitive as the JavaScript example: crypto.randomUUID() for v4, with a crypto.getRandomValues() fallback, and getRandomValues() plus the current time for v7.

How to use the UUID Generator for v4 and v7 with Bulk Output tool

  1. 1

    Pick a version

    Choose v4 for purely random IDs or v7 for time-ordered IDs that index well as database primary keys.

  2. 2

    Set the count and format

    Enter 1 to 1000, then toggle uppercase, hyphens and braces to match the format your code or database expects.

  3. 3

    Copy or download

    Copy a single UUID, copy the whole list, or download it as a .txt file with one UUID per line.

  4. 4

    Inspect an existing UUID

    Paste any UUID or GUID into the inspector to check it is valid and see its version, variant and, for v1, v6 and v7, the embedded creation time.

Frequently asked questions

Are these UUIDs generated on a server?

No. They are generated in your browser with the Web Crypto API (crypto.randomUUID and crypto.getRandomValues), which uses the operating system's cryptographically secure random number generator. Nothing is sent to or logged by TechLogHub.

Can two generated UUIDs ever be the same?

In theory yes, in practice no. A v4 UUID has 122 random bits; generating a billion per second for about 85 years would give roughly a 50% chance of one collision. v7 values also differ by timestamp and counter, which makes collisions within one generator even less likely.

Should I use UUID v4 or v7 for a primary key?

Use v7 when the UUID is a clustered or B-tree indexed primary key with a high insert rate: its time-ordered prefix keeps inserts sequential and the index compact. Use v4 when you need an identifier that leaks nothing, including its creation time.

How do I get the timestamp out of a UUID v7?

The first 12 hex digits (48 bits) are Unix time in milliseconds. Paste the UUID into the inspector above and it shows that time in UTC and in your local timezone. Programmatically: parseInt(uuid.replace(/-/g, '').slice(0, 12), 16).

Is a UUID the same as a GUID?

Yes, for practical purposes. GUID is Microsoft's term for the same 128-bit identifier; it is usually shown uppercase and sometimes in braces. Enable the Uppercase and Braces options to produce that style.

Related on TechLogHub

Get the next tool before you need it

One email a week: new and trending developer tools, fresh comparisons, and what shipped. Unsubscribe in one click.