Skip to content
ToolPika

UUID Generator

A fresh UUID is ready below. Choose version 4 or 7, generate up to 1,000 at once, then copy or download them.

Version

Runs in your browser. Nothing you enter is sent to a server.

How it works

Both versions follow RFC 9562, the current UUID standard:

  • Version 4 fills 122 bits with cryptographically secure random data. The remaining 6 bits mark the version (the 4 at the start of the third group) and the variant (the third group ends up starting with 8, 9, a or b).
  • Version 7 puts the current time, in milliseconds since 1970, in the first 48 bits and fills the rest with random data. Two v7 UUIDs created a second apart sort in that order, both as text and as bytes.

Uppercase and “without hyphens” only change how the UUID is written; the value is the same. Most systems accept either form, but lowercase with hyphens is the standard text format.

Anatomy of a UUID

Part Example (v7) Meaning
First 12 hex digits 017f22e2-79b0 Timestamp: 22 February 2022, 19:22:22 UTC
Next digit 7 Version
Next 3 digits cc3 Random
Next digit 9 Variant (8, 9, a or b)
Last 15 digits 8c4-dc0c0c07398f Random

Generating UUIDs in code

Language Version 4
JavaScript (browsers, Node.js) crypto.randomUUID()
Python uuid.uuid4()
Java UUID.randomUUID()
C# Guid.NewGuid()
PostgreSQL gen_random_uuid()

Frequently asked questions

What is a UUID?

A universally unique identifier is a 128-bit value written as 32 hexadecimal digits in five groups, such as 919108f7-52d1-4320-9bac-f847db4148a8. It lets different systems create IDs independently without checking with each other. Microsoft calls them GUIDs; they are the same thing.

Should I use version 4 or version 7?

Version 4 is fully random and the most widely supported. Version 7 starts with a timestamp, so new IDs sort after older ones. That makes v7 a better choice for database primary keys, because inserts stay close together in the index.

Can two UUIDs ever be the same?

In theory, yes; in practice, no. A version 4 UUID has 122 random bits. You would need to generate about 2.7 quintillion (2.7 × 10¹⁸) of them to reach a 50% chance of a single duplicate.

Are these UUIDs safe to use?

They are generated in your browser with the Web Crypto API, the same secure random source used for encryption keys, and are never sent anywhere. Do not use a UUID as a password or secret token, though; use the password generator for that.