Skip to main content
Developer Tools

UUID Generator

New Popular

Free online UUID and unique ID generator. Generate cryptographically secure UUIDs (v4, v1, v7), ULIDs, NanoIDs, CUID2s, Short IDs, and custom-format IDs in bulk up to 1000. Export as plain text, JSON, CSV, SQL, XML, TypeScript, or Python. Includes a UUID parser/validator with timestamp extraction and color-coded segment breakdown, a collision tester, and a custom template builder with localStorage persistence.

UUID Generator
Quick UUID v4
Insert token:
Preview:
No IDs generated yet
Click Generate to create your IDs

How to Use

1
Choose ID Type

Select from 8 ID formats: UUID v4 (random), v1 (timestamp), v7 (sortable), ULID, NanoID, CUID2, Short ID, or build a Custom template. The Quick UUID panel shows a live UUID v4 for instant copying.

2
Set Quantity & Format

Enter a count from 1 to 1000, or tap a preset. Choose your output format: plain text, JSON array, JSON objects, CSV, SQL INSERT, XML, TypeScript, or Python.

3
Generate & Copy

Click Generate to produce all IDs instantly. In plain text mode each ID is individually clickable to copy. Use Copy All to grab everything at once, or Download to save as a file.

4
Parse & Compare

Switch to the UUID Parser tab to validate and inspect any UUID — see its version, variant, embedded timestamp, and 7 alternative formats. Use Compare Types to choose the best ID format for your project.

What Are UUIDs and Why Do They Matter?

A UUID (Universally Unique Identifier), also called a GUID (Globally Unique Identifier), is a 128-bit identifier standardised in RFC 4122. The core guarantee is that a UUID generated independently on any machine will never collide with another UUID — without coordination between systems. This makes UUIDs essential for distributed databases, microservices, event sourcing, and any context where you need an ID before inserting into a database or coordinating with a central server.

UUID Versions Explained

  • UUID v4 (Random) — 122 bits of cryptographic randomness. No timestamp component. The most widely used version because it reveals nothing about creation time or location. Use this when uniqueness and privacy matter more than sortability.
  • UUID v1 (Timestamp + MAC) — Encodes a 60-bit Gregorian timestamp (100-nanosecond intervals since Oct 15, 1582) plus a node ID. This implementation uses a random node (multicast bit set) to protect privacy. Chronologically sortable within the same node.
  • UUID v7 (Unix Epoch, RFC 9562) — 48-bit Unix millisecond timestamp in the first 6 bytes, 74 bits of randomness thereafter. Naturally sortable by database B-tree indexes. The recommended replacement for v1 in new applications.

Alternative ID Formats

  • ULID (Universally Unique Lexicographically Sortable Identifier) — 10-character Crockford Base32 timestamp (48 ms) + 16-character random component = 26 characters total. Lexicographically sortable, case-insensitive, and 30% shorter than a UUID with hyphens.
  • NanoID — URL-safe, compact, configurable length. Uses rejection sampling to eliminate modulo bias. Default 21 characters with alphanumeric alphabet achieves approximately 126 bits of collision resistance.
  • CUID2 — Collision-resistant, fingerprint-resistant. Always starts with a letter, lowercase only, suitable for HTML IDs and CSS class names. Good default for JavaScript applications.
  • Short ID — Human-readable configurable-length IDs from multiple character sets. Useful for order numbers, referral codes, and user-facing references.
  • Custom Template — Combine any of the above generators with static text, timestamps, and sequence numbers using a simple {token} syntax.

Output Formats

Generated IDs can be exported in 8 formats ready to paste directly into your code: plain text (one per line, click-to-copy), JSON array, JSON object array (with a configurable key), CSV (with header), SQL INSERT statement (configurable table and column), XML, TypeScript const array, and Python list.

UUID Parser & Validator

The Parser tab accepts any UUID string — with or without hyphens, in URN format (urn:uuid:…), or wrapped in braces. It extracts the version and variant, decodes the embedded timestamp for v1 and v7 UUIDs, renders a colour-coded segment breakdown, and shows 7 alternative representations including Base64 and integer encoding.

Collision Tester

The Collision Test generates up to 1 million UUIDs and checks every single one against a Set for duplicates. The test runs in non-blocking 5,000-ID chunks so the browser stays responsive. After completion it displays the theoretical collision probability alongside the empirical result.

Cryptographic Randomness

All generators on this tool use crypto.getRandomValues() — the browser's cryptographically secure pseudo-random number generator (CSPRNG). Math.random() is never used. NanoID uses rejection sampling to eliminate modulo bias. This means every ID is as random as your browser's entropy pool allows.

Privacy

All generation happens locally in your browser. No IDs, templates, or custom formats are sent to any server. Saved templates are stored only in your browser's localStorage and never leave your device.

Frequently Asked Questions

A UUID (Universally Unique Identifier) is a 128-bit number that can be generated independently on any machine without coordination. UUID v4 has 122 bits of randomness, meaning the probability of two randomly generated UUIDs colliding is approximately 1 in 5.3 × 10³⁶ — for practical purposes, impossible. In the Collision Test you can verify this empirically by generating up to 1 million UUIDs and finding zero duplicates.

UUID v4 is purely random — 122 bits of cryptographic randomness with no timestamp. UUID v7 embeds a 48-bit Unix millisecond timestamp in the first 6 bytes, making UUIDs generated later sort after those generated earlier. This matters for database performance: with UUID v4 as a primary key, rows are inserted at random positions in the B-tree index, causing page splits and fragmentation. UUID v7 inserts at the end of the index like an auto-increment integer, preserving locality.

UUID (Universally Unique Identifier) and GUID (Globally Unique Identifier) refer to the same 128-bit identifier. "GUID" is Microsoft's term, used in .NET, SQL Server, and COM. "UUID" is the term from the IETF standard (RFC 4122). They are interchangeable and formatted identically.

ULID is 26 characters vs 36 for a UUID with hyphens — 28% shorter. It is lexicographically sortable (newer IDs sort after older ones), case-insensitive, and uses Crockford's Base32 which eliminates ambiguous characters (no O, I, L). ULIDs are good for distributed log systems, event streams, or anywhere you need a shorter sortable ID that is also URL and filename safe.

Yes, with some caveats. UUID v4 causes index fragmentation in B-tree databases like PostgreSQL, MySQL, and SQL Server because random IDs insert at random positions. For database PKs, prefer UUID v7 or ULID — both embed a timestamp so new rows always insert at the end of the index, matching auto-increment behaviour. If you must use v4, store it as a binary(16) type rather than varchar(36) for much better index performance.

For UUID v1, the parser extracts the 60-bit Gregorian timestamp (100-nanosecond intervals since October 15, 1582) and converts it to a human-readable UTC date and time. For UUID v7, it extracts the 48-bit Unix millisecond timestamp. It also identifies the RFC 4122 variant byte, shows a colour-coded segment breakdown (time-low, time-mid, version, variant, node/random), and provides 7 alternative representations including standard, no-hyphens, uppercase, URN, braces, Base64, and integer.

Yes. All randomness comes from crypto.getRandomValues(), the browser's cryptographically secure RNG. Nothing is generated server-side and nothing is transmitted over the network — all generation happens in your browser's JavaScript engine. Generated IDs are suitable for use as database primary keys, session tokens, correlation IDs, and other production uses. For security-sensitive tokens (API keys, session cookies), ensure you also use HTTPS and appropriate rotation policies.

The custom template uses curly-brace tokens you can combine with static text: {v4} inserts a UUID v4, {v7} inserts a UUID v7, {ulid} inserts a ULID, {nano} inserts a 21-character NanoID, {random:N} inserts N random alphanumeric characters, {ts} inserts the current Unix timestamp in milliseconds, {date} inserts today's date as YYYYMMDD, and {seq} inserts a sequential counter. For example, ORDER-{date}-{random:6} produces IDs like ORDER-20260318-k8Mn2X.