Generate UUID Online

Create random UUID v4 identifiers with one click.

When to Use UUIDs

UUIDs (Universally Unique Identifiers) are 128-bit identifiers designed to be unique across time and space without a central authority. UUID v4 generates random identifiers using cryptographic randomness, making collision practically impossible — you'd need to generate 2.7 quintillion UUIDs for a 50% collision chance.

Common use cases include database primary keys (especially in distributed systems), correlation IDs for request tracing, idempotency keys for payment APIs (Stripe, PayPal), session identifiers, and unique filenames for uploads. Our generator uses crypto.randomUUID() for cryptographically secure randomness.

UUIDs are represented as 32 hexadecimal digits in 5 groups separated by hyphens: xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx. The 4 in the third group indicates version 4 (random). The first digit of the fourth group is always 8, 9, a, or b (RFC 4122 variant).

Tips

  • UUID v4 is the most widely used version. Use v7 (time-sortable) if your database benefits from sequential inserts.
  • In PostgreSQL, use the uuid type and gen_random_uuid() function for server-side generation.
  • UUIDs as primary keys can hurt B-tree index performance due to randomness. UUID v7 or ULID solve this with time-ordering.
  • Never generate UUIDs with Math.random() — it's not cryptographically secure. Use crypto.randomUUID().

Ready to get started?

Generate UUID

New tools every week

Get notified. No spam.