LPH Digital Tools
Tools Consulting Portfolio Blog
Legal Login Register Free

UUID Generator

UUID v4, v7, ULID, Nano ID. Single or bulk. All client-side.



    

What is a UUID?

A UUID (Universally Unique Identifier) is a 128-bit number written as a string of letters and digits like 3a7f8c2e-5d1b-4e9a-b3c7-8f4d9e2a1c6b. It's designed to be effectively impossible to duplicate — even across different computers, different organisations, different countries, all generating them at the same time. The odds of two UUIDs ever colliding are astronomically small (you'd need to generate 2.7 quintillion per second for a century to have a 50% chance of one duplicate).

UUIDs are the standard way to give things a unique name in software without needing a central authority to hand out IDs. No database to ask, no server round-trip, no coordination needed — anyone can generate a new UUID and be confident it's unique. That makes them ideal for distributed systems, offline-first apps, and any time you need a durable identifier.

When would I use one?

  • Database primary keys — instead of auto-increment integers. Useful when you have multiple database shards, offline sync, or want IDs that don't leak "how many records do we have" to the world.
  • File names for uploads. Stop users clashing with each other's filenames. Rename every upload to a UUID.
  • API request IDs / correlation IDs. Attach a UUID to every incoming request so you can trace it through logs and microservices later.
  • Session tokens, invite codes, one-time magic links. Random, unguessable, safe to expose in URLs.
  • Distributed events / message IDs — events in a queue or event bus need unique IDs without coordination.
  • Client-side ID generation before data is saved — e.g., a mobile app creating a note offline, assigning it a UUID, then syncing to the server later without waiting for an ID from the backend.
  • Anything needing an ID that other people shouldn't be able to guess. UUID v4 is effectively unguessable — way more secure than sequential IDs like "1, 2, 3…"

The four formats here, decoded

UUID v43a7f8c2e-5d1b-4e9a-b3c7-8f4d9e2a1c6b
The classic. Pure random data, 122 bits of entropy, formatted as 8-4-4-4-12 hex groups separated by hyphens. This is what most people mean when they say "UUID" without specifying a version. Works everywhere. Default choice for most uses.

UUID v7018f1a2b-c3d4-7e9a-b3c7-8f4d9e2a1c6b
Looks like v4, but the first 48 bits are a millisecond timestamp. The remaining 74 bits are random. This makes v7 UUIDs sortable by creation time — earlier IDs sort before later ones — which is enormously helpful for database index performance. Use this for database primary keys in modern apps. Works in PostgreSQL, MySQL, SQL Server, MongoDB, etc. Standardised in 2024 (RFC 9562).

ULID01HX4K5MPJZQRSTVWXYZ0123456
Similar concept to UUID v7 but uses Crockford Base32 encoding (0-9, A-Z except I, L, O, U) instead of hex. The result: 26 uppercase characters, no hyphens, case-insensitive, URL-safe, slightly more compact than a UUID (26 chars vs 36). Like v7, it's time-sortable. ULIDs predate UUID v7 and remain popular in JavaScript/Elixir/Rust ecosystems. Pick ULID over v7 if you care about string length or Base32 readability.

Nano IDV1StGXR8_Z5jdHi6B-myT
Deliberately short (21 characters) for use in URLs, share links, invite codes. Not sortable, not time-based, just packed randomness in a URL-safe alphabet (A-Z, a-z, 0-9, _, -). Roughly the same uniqueness strength as UUID v4 but in 21 chars instead of 36. Use Nano ID for anything user-facing where short, clean URLs matter (think YouTube video IDs, "t.co/aBcD" style short links).

Quick-reference comparison

  • Need unguessable ID for a URL / token? → UUID v4 or Nano ID
  • Need a database primary key? → UUID v7 or ULID
  • Need a short share link or invite code? → Nano ID
  • Need compatibility with old systems that expect "UUID format"? → UUID v4
  • Need to sort records by creation time just using the ID? → UUID v7 or ULID
  • Not sure? → UUID v4 for anything user-facing, UUID v7 for database keys. You won't go wrong.

FAQ

Is "UUID" the same as "GUID"? Yes. GUID (Globally Unique Identifier) is Microsoft's name for the exact same thing. Same bits, same format, different brand. .NET, SQL Server, and Azure call them GUIDs; everywhere else calls them UUIDs. They're interchangeable.

Can two UUIDs ever collide? Theoretically yes, practically no. The probability of a collision with UUID v4 is so small that if you generate 1 billion UUIDs per second for 85 years, you'd have about a 50% chance of finding one duplicate. For any practical purpose, treat collisions as impossible.

Can I shorten a UUID? A UUID is already the shortest form of 128 bits in hex. You can re-encode it in Base64 (22 chars) or Base32 (26 chars) to save a few characters. But if you want short, just use Nano ID from the start.

Are these UUIDs safe to use? Yes — they're generated with crypto.getRandomValues(), the same cryptographically-secure RNG browsers use for HTTPS. Suitable for session tokens, invite codes, and anything where an attacker shouldn't be able to guess the next one.

Do UUIDs have personal information in them? v4 UUIDs are purely random — no info at all. v7 UUIDs and ULIDs contain a timestamp (so they reveal roughly when the ID was created) but nothing about who created it. Older UUID v1 includes the MAC address of the generating machine (don't use v1 for public-facing IDs — we don't offer it here because it's effectively deprecated for that reason).

Does this tool send anything to a server? No. Every UUID is generated in your browser using JavaScript and the browser's built-in cryptographic RNG. Nothing ever leaves your device. You can verify by opening browser DevTools → Network tab while clicking Generate — you'll see zero requests.

Can I use these commercially? Yes, unrestricted. UUIDs, ULIDs, and Nano IDs are public standards. Use them in any product, free or paid, without attribution.