UUID Generator

UUID Generator

Generate UUID v1/v3/v4/v5/v6/v7/v8, ULID, and NanoID — parser, bulk, and deep-link sharing. 100% private.

What is a UUID?

A UUID (Universally Unique Identifier) is a 128-bit number used to uniquely identify information in distributed systems without central coordination. UUIDs are defined by RFC 9562 (2024), which supersedes RFC 4122 (2005).

A UUID is written as 32 hexadecimal characters in the 8-4-4-4-12 format like 01902e8c-5fa3-7b3f-b5de-8c5b8a2e7f1d. The 13th character encodes the version (1-8), and the 17th encodes the variant (the high bits of that hex digit). The remaining bits carry timestamp, namespace hash, random data, or custom fields depending on the version.

UUID Examples

Click any example to load it into the Parser tab and see the decomposition.

TypeDescriptionSampleTry
NIL UUIDSpecial all-zero UUID00000000-0000-...
MAX UUIDSpecial all-one UUIDffffffff-ffff-...
v1Time-based (Gregorian 100ns)c232ab00-9414-...
v4Random (most common)a1b2c3d4-e5f6-...
v7Sortable (Unix ms + random)01902e8c-5fa3-...
v5 (DNS)SHA-1 namespace (DNS)2ed6657d-e927-...
ULIDCrockford Base32, 26 chars01HNQ8K9XM...
NanoIDURL-safe, compact (21 chars)V1StGXR8_Z5jdHi...
PostgreSQLgen_random_uuid() output9f4eab3c-...
FirestoreFirebase Firestore document IDdBc8xQq2jK...

UUID Versions Compared

This tool supports all modern identifier formats. Each has distinct properties:

TypeBitsSortable?Deterministic?Time ExposedBest For
v1128No (byte-order)NoYesLegacy systems
v2128NoNoYesDCE Security (legacy)
v3128NoYes (MD5)NoStable IDs from names
v4128NoNoNoSession/API tokens
v5128NoYes (SHA-1)NoStable IDs from names
v6128YesNoYesv1 migration
v7128YesNoYesDB primary keys
v8128CustomCustomCustomExperimental
ULID128YesNoYesCompact sortable IDs
NanoIDVariableNoNoNoURL slugs, short IDs

Common Use Cases

  • Database primary keys — UUID v7 is ideal because time-ordered inserts align with B-tree index locality (2-10x faster vs v4).
  • Session tokens / API keys — UUID v4 is the right choice; pure randomness means no timestamp leakage.
  • URL slugs / short codes — NanoID with a custom length/alphabet produces compact URL-safe IDs.
  • Distributed tracing IDs — UUID v7 or ULID provide both uniqueness and chronological ordering.
  • Namespace-based IDs — v3 (MD5) or v5 (SHA-1) generate the same UUID for the same input, useful for deduplication.
  • Event IDs — v7 or ULID let you sort events by creation time without separate timestamp columns.

Common UUID Errors and How to Fix Them

Invalid UUID format

Cause: The string is not 8-4-4-4-12 hex characters. Extra whitespace, missing dashes, or non-hex characters break parsers.

Fix: Trim the input and check for exactly 32 hex chars with dashes at positions 8, 12, 16, 20. This tool's Parser auto-strips whitespace and curly braces {} for .NET GUID compatibility.

Unknown UUID version

Cause: The 13th hex character is not in 1-8, so the version field is out of spec.

Fix: Verify the source UUID was generated correctly. Non-standard or corrupted UUIDs may have garbage in the version bits.

Invalid variant bits

Cause: The high 2 bits of the 17th hex char are not 10 (RFC 9562) — e.g., an Apple NSUUID with variant 110 (Microsoft).

Fix: Check the UUID's origin. RFC 9562 variants start with 8, 9, a, or b at that position.

Namespace UUID required

Cause: v3 or v5 selected without a namespace UUID and name.

Fix: Choose a standard namespace (DNS, URL, OID, X.500) or provide a valid custom UUID, then enter a name string.

Alphabet contains duplicates (NanoID)

Cause: Custom NanoID alphabet has repeated characters, which skews distribution.

Fix: Provide an alphabet with all unique characters. The tool rejects duplicates before generation.

UUID in Your Language

Every major language has UUID support either built-in or via a well-maintained library:

LanguagePackagev4 Examplev7 Note
Node.jscrypto (built-in)crypto.randomUUID()npm install uuid → v7()
Pythonuuid (built-in)uuid.uuid4()Python 3.14+: uuid.uuid7()
Javajava.util.UUIDUUID.randomUUID()com.github.f4b6a3:uuid-creator
Gogithub.com/google/uuiduuid.NewString()uuid.NewV7()
.NET/C#SystemGuid.NewGuid()UUIDNext NuGet package
PHPramsey/uuidUuid::uuid4()Uuid::uuid7()
RubySecureRandom (built-in)SecureRandom.uuiduuid7 gem

How to Use This Tool

  1. Select a Type (v4, v7, v1, v3, v5, v6, v8, ULID, NanoID) in the Generator tab.
  2. Configure options if applicable (namespace + name for v3/v5, custom hex for v8, length + alphabet for NanoID).
  3. Set the Count (1-1,000) and click Generate.
  4. Use Copy All or download as CSV/JSON/TXT.
  5. Switch to the Parser tab to analyze any existing UUID or ULID — it shows version, variant, timestamp, and bit decomposition.
  6. For v1/v6/v7 results, click Open in Timestamp Decoder to convert the extracted timestamp across time zones.

UUID v4 vs UUID v7 vs ULID

AspectUUID v4UUID v7ULID
Sortable by time
DB insert performancePoor (random scatter)Excellent (sequential)Excellent (sequential)
Random bits1227480
Use caseSession tokens, API keysDB primary keys (modern)Compact sortable IDs
Browser/Node supportNative (crypto.randomUUID)Library (uuid npm)Library (ulid npm)

Technical Reference

RFC 9562 bit layout for each UUID version (128 bits total):

VersionTimestampVersionVariantRandom/DataOther
v160-bit Gregorian 100ns4214 clock_seq48 node
v342122 MD5 hash
v442122 random
v542122 SHA-1 hash
v660-bit (reordered)4214 clock_seq48 node
v748-bit Unix ms4212 rand_a + 62 rand_b
v8Custom42122 custom
ULID48-bit Unix ms80 randomCrockford Base32 (26 chars)
NanoIDVariable randomCustom alphabet + length

Frequently Asked Questions

Is UUID v7 secure enough for session tokens?

No. UUID v7 embeds a Unix millisecond timestamp in the first 48 bits, which is predictable. For session tokens, API keys, or anything requiring unpredictability, use UUID v4 (fully random) or a dedicated CSPRNG-backed token.

What happened to UUID v2?

UUID v2 (DCE Security) is defined in the original spec but rarely used. Most modern libraries (Python uuid, Java UUID, Go google/uuid) do not implement it. This tool recognizes v2 in the Parser for debugging but does not generate v2 — it is essentially legacy.

Why did PostgreSQL 18 add uuidv7()?

UUID v7 is time-ordered, making it a much better primary key than v4. PostgreSQL 18 (released September 2025) added a native uuidv7() function because benchmarks consistently show 2-10x better INSERT performance with v7 due to sequential index writes.

Can I sort UUID v4 by creation time?

No. UUID v4 is fully random and has no time component. If you need time-ordered identifiers, use UUID v7, UUID v6, or ULID. These all embed a timestamp that makes them lexicographically sortable by creation time.

Is ULID better than UUID v7?

They solve the same problem (time-ordered IDs) but differ in format. ULID is 26 characters in Crockford Base32, more compact than UUID's 36 characters with dashes. UUID v7 is the RFC-standardized option with broader tooling support. Choose ULID for compactness, v7 for standards alignment.

How unique is NanoID compared to UUID?

Default NanoID (21 chars from a 64-char alphabet) has collision probability equivalent to UUID v4 — you would need ~149 quadrillion IDs to hit a 1% collision rate. Shorter NanoIDs are less unique; an 8-char ID from a 36-char alphabet hits 1% collision at ~370K IDs.

Can UUIDs collide?

In theory yes, but for UUID v4 the probability is astronomically small — about 1 in 2^122 for any two specific UUIDs. You would need to generate about 2.7 quintillion UUIDs to reach a 50% chance of collision. In practice, treat them as globally unique.

Are UUIDs really universally unique?

The "universally unique" guarantee comes from the 128-bit length and cryptographically strong randomness (v4) or timestamp + randomness (v7). As long as you use a proper CSPRNG, collision across the entire universe of generated UUIDs is negligibly small.

Is it safe to paste UUIDs here?

Yes. All processing happens entirely in your browser using JavaScript. Your data is never sent to any server. You can verify this by opening the Network tab in your browser's developer tools — no network requests are made after the page loads.

Why does Node.js crypto.randomUUID() only support v4?

crypto.randomUUID() is a standardized Web Crypto API method that specifically returns a v4 (random) UUID. For v7 and other versions, you need an external library like uuid on npm. Python's uuid module similarly defaults to v4 and added uuid7() only in Python 3.14.

Features

🆔 Multi-Version Generator

Generate v1, v3, v4, v5, v6, v7, v8, ULID, and NanoID from a single unified interface.

🔍 Parser & Visualizer

Paste any UUID to see the bit decomposition — version, variant, timestamp, and random segments color-coded.

📦 Bulk Generation

Generate up to 1,000 IDs at once and download as CSV, JSON, or TXT for test data or migrations.

💻 Code Snippets

Copy ready-to-use UUID generation code for Node.js, Python, Java, Go, .NET, PHP, and Ruby.

🔗 URL Deep-links

Share tool state via URL: ?type=v7&count=100 or ?action=parse&uuid=....

🔒 100% Private

All generation happens in your browser. No data is ever sent to any server. Safe for production.

Privacy & Security

This tool processes everything locally using the Web Crypto API (crypto.randomUUID, crypto.getRandomValues, crypto.subtle.digest). Nothing is sent to any server. You can verify via the Network tab in developer tools. For security-sensitive use cases like session tokens or API keys, prefer UUID v4 (fully random); avoid v1/v6/v7 which expose creation time.