Home/Dev Tools/UUID Generator
0 UUID v4s

What Is a UUID?

A UUID (Universally Unique Identifier) is a 128-bit label used to identify information in computer systems. Defined by RFC 4122, a UUID is represented as 32 hexadecimal digits displayed in 5 groups separated by hyphens: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. The probability of two randomly generated UUID v4s colliding is astronomically small — roughly 1 in 5.3 × 10³⁶.

UUID v4 vs v1 vs v7 — What's the Difference?

  • UUID v4 — Randomly generated. 122 bits of randomness. No timestamp component. The most common UUID version for application IDs, session tokens, and database primary keys.
  • UUID v1 — Includes the current timestamp and MAC address. Can be reversed to reveal when and where it was generated. Not recommended for privacy-sensitive use cases.
  • UUID v7 — Combines a Unix timestamp (millisecond precision) with random bits. Sortable by creation time, making it suitable for indexed database records. A newer standard (RFC 9562).

UUID vs GUID — Are They the Same?

Yes — GUID (Globally Unique Identifier) is Microsoft's term for the same 128-bit identifier concept. GUIDs are typically formatted the same way as UUIDs (32 hex digits, 5 groups) but are sometimes displayed with surrounding braces: {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}. Use the Braces toggle in this tool to generate GUID-formatted output.

What Is a NanoID?

NanoID is a compact, URL-safe unique identifier. By default it generates a 21-character string using a 64-character alphabet (A–Z, a–z, 0–9, _, -), giving approximately 126 bits of entropy — comparable to UUID v4 but in fewer characters. NanoID is ideal for short URLs, API keys, and any context where a shorter string is preferable over the standard UUID format.

What Is a ULID?

A ULID (Universally Unique Lexicographically Sortable Identifier) is a 26-character identifier where the first 10 characters encode a Unix timestamp (millisecond precision) and the remaining 16 characters are random. Because ULIDs sort lexicographically by creation time, they are excellent as database primary keys — records inserted later appear later when sorted alphabetically, avoiding the index fragmentation problems that random UUIDs cause.

UUID v4 vs NanoID vs ULID — Which Should You Use?

  • Use UUID v4 when you need a standard, widely-supported identifier — most SDKs, ORMs, and databases understand UUID natively.
  • Use NanoID when you need a shorter, URL-safe identifier — for example, as a shareable link slug or compact API key.
  • Use ULID when you need sortable IDs — great for database primary keys where creation-time ordering matters without a separate created_at column sort.

Common Use Cases

  • Database primary keys — UUID v4 or ULID to ensure global uniqueness across distributed systems without a central counter.
  • Session tokens — UUID v4 for user session identifiers in web applications.
  • File and asset names — NanoID for short, URL-safe names in object storage (S3, GCS).
  • Correlation IDs — UUID v4 to trace requests across microservices in logs.
  • Idempotency keys — UUID v4 sent with payment or API requests to ensure the same request isn't processed twice.

Tips & Tricks

  • Bulk generate — set Count up to 100 to generate a list at once. Useful for seeding test databases.
  • Uppercase & no-hyphens — some databases (SQL Server) prefer uppercase UUIDs without hyphens. Toggle Uppercase and No hyphens to match.
  • Braces for Microsoft GUID format — enable Braces to wrap each ID in {...}, the Windows / .NET convention.
  • Pick ULID over UUID v4 for primary keys — ULIDs sort by creation time, which dramatically improves B-tree index locality vs random UUIDs.
  • NanoID for URLs — shorter (21 chars vs 36), URL-safe, equivalent entropy. Use for shareable links and slugs.

Related Tools

Is My Data Sent to a Server?

No. Every UUID, NanoID, and ULID is generated entirely in your browser using crypto.randomUUID() and crypto.getRandomValues() — the Web Crypto API backed by your operating system's cryptographic entropy pool. Nothing is transmitted to our servers, no IDs are logged, and closing the tab discards them all.