raatools/

UUID Generator

Generate random v4 UUIDs (GUIDs) โ€” one or many.

1

What is a UUID?

A UUID (Universally Unique Identifier) is a 128-bit number used to identify information uniquely across distributed systems without requiring a central authority. UUIDs are standardized in RFC 4122 and are used everywhere โ€” from database primary keys and API request tracking to session management and file naming.

The standard UUID format is 36 characters with four hyphens: xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx, where M indicates the version (1โ€“5) and N indicates the variant. The most commonly used version is UUID v4, which generates identifiers using cryptographic randomness. This tool generates UUID v4 by default.

UUID v4 format

UUID v4 uses 122 random bits (the remaining 6 bits encode the version and variant). The format is xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx where every x is a random hex digit and y is one of 8, 9, A, or B. The 4 in the third group identifies it as version 4. Each UUID v4 is generated independently using cryptographic randomness.

How to use this tool

Click the generate button to create a new UUID v4. Each click produces a fresh, cryptographically random identifier. You can generate multiple UUIDs at once for batch operations. Click the copy button to copy the UUID to your clipboard for use in code, configurations, or databases.

Common UUID use cases

  • Database primary keys: UUIDs enable distributed systems to create records independently without key collisions, unlike auto-incrementing integers which require coordination.
  • API request IDs: Attach a UUID to every API request for end-to-end tracing across microservices.
  • Session tokens: Create unique session identifiers that are impossible to guess.
  • File names: Generate unique filenames to prevent collisions when multiple users upload simultaneously.
  • Idempotency keys: Use UUIDs in payment APIs to ensure the same transaction is not processed twice.

Collision probability

UUID v4 has 122 random bits, yielding 5.3 ร— 10ยณโถ possible values. The probability of generating two identical UUIDs is astronomically small. You would need to generate 2.71 ร— 10ยนโธ UUIDs (2.71 quintillion) before reaching a 50% probability of a single collision. In practical terms, collisions are not a realistic concern for any application.

Nil UUID

The nil UUID (00000000-0000-0000-0000-000000000000) is a special value defined in RFC 4122 as a placeholder or default. Some applications use it to represent "no value" or "unknown" in UUID-typed database columns, similar to how null works for other data types.

UUID versions comparison

UUID v1 uses the current timestamp and the device's MAC address โ€” fast but potentially leaks device information. UUID v3 and v5 generate deterministic UUIDs from a namespace and name using MD5 and SHA-1 respectively. UUID v4 uses pure randomness, offering the best combination of uniqueness, simplicity, and privacy. UUID v7 (draft standard) combines a timestamp prefix with randomness for time-sortable UUIDs.

Is my UUID secure?

Yes. Generation uses the browser's native crypto.randomUUID() API, which provides cryptographically secure randomness. All processing happens locally on your device. No UUIDs are logged, stored, or transmitted to any server.

Frequently asked questions

Should I use UUIDs or auto-incrementing IDs?

UUIDs are better for distributed systems, microservice architectures, and any scenario where records are created on multiple servers. Auto-incrementing IDs are simpler, smaller (4โ€“8 bytes vs. 16 bytes), and more efficient for database indexing. Choose based on your architecture โ€” centralized systems can use auto-increment, distributed systems benefit from UUIDs.

Do UUIDs need to be stored as strings in a database?

No. Most databases support a native UUID type that stores the value as 16 bytes instead of the 36-byte string representation. PostgreSQL has a UUID column type, MySQL can use BINARY(16), and MongoDB uses its own UUID binary subtype. Using native types saves storage space and improves query performance.