String & Security

UUID Generator

Generate cryptographically secure Version-4 Universally Unique Identifiers (UUID v4) individually or in bulk.

How It Works & Methodology

A Universally Unique Identifier (UUID) is a 128-bit label used for information in computer systems. Version 4 UUIDs are generated using pseudo-random numbers with 122 bits of randomness, yielding 5.3 x 10^36 possible identifiers.

UUIDv4 format: xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx where 4 denotes version 4, and y is one of [8, 9, a, b] denoting the RFC 4122 variant. Entropy is sourced strictly from Web Crypto API (crypto.randomUUID() / crypto.getRandomValues()).
Key Assumptions & Scope:
  • Generated strictly via cryptographically secure random number generators (CSPRNG).
  • Supports batch generation from 1 up to 1,000 UUIDs per call.
  • Zero Math.random fallback to prevent predictability or collision vulnerabilities.

Frequently Asked Questions

What is the chance of two UUID v4 values colliding?

Negligible. You would need to generate approximately 1 billion UUIDs per second for 85 years to reach a 50% probability of a single collision.

Is this generator cryptographically secure?

Yes. Identifiers are generated using the browser native Web Crypto API CSPRNG, ensuring high statistical entropy suitable for database keys and session tokens.

How do I distinguish a Version 4 UUID?

Look at the third group: the first digit is always "4" (e.g. xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx), and the first digit of the fourth group is 8, 9, a, or b.