Crypto Tools
What It Does
Generates UUID v4 (random) and UUID v7 (time-ordered) identifiers.
How to Use It
- Select UUID version (v4 or v7).
- Click “Generate”.
- Copy the UUID.
Options Explained
| Option | Description |
|---|---|
| UUID v4 | Fully random — suitable for most identifier needs |
| UUID v7 | Time-ordered — sortable by creation time, ideal for database primary keys |
About UUIDs (Universally Unique Identifiers)
A UUID is a 128-bit identifier standardized by RFC 9562 (formerly RFC 4122), formatted as 32 hexadecimal digits separated by hyphens into five groups (8-4-4-4-12). UUIDs are designed so that any system can generate one independently with a negligible probability of collision, eliminating the need for a central coordinating authority.
UUID v4 fills 122 of the 128 bits with cryptographically random data (6 bits are reserved for version and variant fields). This makes v4 ideal when ordering does not matter. UUID v7 (introduced in RFC 9562) embeds a Unix-epoch millisecond timestamp in the most-significant 48 bits, followed by random bits. This gives v7 natural chronological ordering, significantly improving database index performance compared to fully random v4 values.
The collision probability of a v4 UUID is vanishingly small — generating one billion UUIDs per second for 86 years yields roughly a 50% chance of a single duplicate. For v7, the timestamp prefix further reduces collisions among IDs generated at different times.
Common Use Cases
- Primary keys in distributed databases without coordination (Cassandra, DynamoDB)
- Unique resource identifiers in REST and GraphQL APIs
- Correlation IDs for distributed tracing and log aggregation
- Session identifiers and CSRF tokens in web applications
- File and object naming in cloud storage (S3 keys, blob IDs)
- Idempotency keys for safe request retries in payment systems
What Is a UUID?
A UUID (Universally Unique Identifier) is a 128-bit value designed to be globally unique without requiring a central authority. UUIDs are represented as 32 hexadecimal digits grouped into five sections separated by hyphens (e.g.,550e8400-e29b-41d4-a716-446655440000). The most widely used version, UUID v4, is generated from cryptographically secure random bytes and has a collision probability so low (roughly 1 in 2¹²²) that duplicates are effectively impossible. UUID v7 is a newer variant that embeds a Unix millisecond timestamp, producing time-sortable identifiers that are friendly to database indexes while retaining randomness.
Frequently Asked Questions
What is the difference between UUID v4 and UUID v7?
UUID v4 is entirely random. UUID v7 encodes a millisecond timestamp in the most significant bits, making IDs chronologically sortable. Use v7 for database primary keys where index locality matters; use v4 when ordering is irrelevant.
Can two UUIDs ever collide?
In theory, yes, but the probability is astronomically low. For UUID v4, you would need to generate roughly 2.7×10¹⁸ UUIDs to have a 50% chance of a single collision. In practice, collisions do not occur.
Are UUIDs good for database primary keys?
Yes, especially UUID v7 whose time-sorted nature avoids the B-tree fragmentation caused by fully random v4 IDs. For distributed databases where auto-increment is impractical, UUIDs are the standard approach.
Are the generated UUIDs sent to a server?
No. All generation happens locally in your browser using the Web Crypto API. No identifiers are transmitted or stored.
All UUIDs are generated entirely in your browser using the Web Crypto API. No identifiers are sent to or stored on any server.