/uuid

UUID generator

Generate UUID v4 (and NIL/max), one or many at a time.

 

How it works

UUID v4 are random 128-bit identifiers, generated with the browser’s cryptographically secure randomness (crypto.randomUUID). They are practically guaranteed to be unique.

About this tool

A UUID (Universally Unique Identifier), also called GUID, is a 128-bit identifier that is practically guaranteed to be globally unique, without any central authority. The format is 32 hexadecimal digits grouped as `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`. The most common variant is UUID v4, which is pure randomness (122 bits), the odds of collision are so small that you could generate a billion per second for 85 years before you’d expect one duplicate. This tool creates v4 UUIDs using `crypto.randomUUID()`, the browser’s cryptographically secure API, and also produces the NIL UUID (`0…0`) and max UUID (`f…f`) on demand.

How to use it

  1. Click "Generate" for one new UUID v4, copy to clipboard with a single click.
  2. Toggle bulk mode to generate hundreds of UUIDs at once.
  3. Use the NIL UUID (`00000000-0000-0000-0000-000000000000`) as an "empty"/sentinel value when `null` isn’t an option.
  4. Use the max UUID (`ffffffff-ffff-ffff-ffff-ffffffffffff`) as an "infinite"/end sentinel for sorting.
  5. All UUIDs are generated locally with `crypto.randomUUID()`, never sent over the network.

Examples

Typical UUID v4
Outputa3f5c8e2-4b7d-4e91-9c6f-8b1a2c3d4e5f
The "4" after the third hyphen indicates version 4 (random). The first character of the fourth group ("9") shows the variant (RFC 4122).
NIL UUID
Output00000000-0000-0000-0000-000000000000
All zeros. Often used as a "none" value in systems where the column doesn’t allow `NULL`.
Bulk generation
Inputcount = 5
Outputf1e2d3c4-b5a6-4798-9231-a1b2c3d4e5f6 a7b8c9d0-e1f2-4a3b-8c4d-5e6f7a8b9c0d … (5 rows in total)
Handy for seeding databases or test fixtures. Each UUID is generated independently of the others.

Common use cases

  • Primary keys in databases where you want to avoid exposing sequential IDs.
  • Distributed systems where multiple nodes must generate IDs without coordination.
  • Idempotency keys in API requests (Stripe, payment processors).
  • Trace IDs in logging and distributed tracing (OpenTelemetry).
  • File names for uploads or temporary files where name collisions must be avoided.
  • Session identifiers in cookies or URLs (that must not be guessable).
  • Correlation IDs for messages in queues (RabbitMQ, Kafka, SQS).

Frequently asked questions

What is the difference between UUID and GUID?
They’re the same thing. "GUID" is Microsoft’s term (mostly used in .NET and Windows), while "UUID" comes from RFC 4122 and is the official standard. The format is identical.
Is UUID v4 truly unique?
Not absolutely, but practically. There are 2¹²² ≈ 5.3 × 10³⁶ possible v4 UUIDs. To have a 50 % chance of collision, you’d need to generate ~2.7 × 10¹⁸ (2.7 quintillion). For comparison: every atom in your body has more UUIDs available than you’ll ever generate.
Should I use UUIDs as database primary keys?
Pros: can be generated without a DB round-trip, doesn’t leak row counts, safe to expose in URLs. Cons: 16 bytes vs 8 for bigint, fragments B-tree indexes (since v4 is random). Consider UUID v7 (timestamp-based) if you want uniqueness plus sort order. For high-performance OLTP with billions of rows, bigint is often better.
What is UUID v7 and should I use it?
UUID v7 (adopted in RFC 9562, 2024) combines a Unix millisecond timestamp with 74 random bits. Benefit: newer v7 IDs sort naturally by creation time, making them far friendlier for database indexes than v4. Use v7 for new systems where you want UUIDs and good DB performance; v4 is still fine for tokens, nonces, or when timestamp leakage is undesired.

Technical background

The UUID format is defined in RFC 4122 (2005) and updated in RFC 9562 (2024). A UUID is 128 bits total, of which 4 bits identify the version (1–8) and 2–3 bits identify the variant. UUID v1 is based on MAC address + timestamp (leaks hardware identity), v3 and v5 are name-based hashes (MD5/SHA-1), v4 is pure randomness, v6/v7/v8 are newer variants from 2024. `crypto.randomUUID()` is available in all modern browsers and Node.js since 2021 and uses the OS’s secure entropy source.