What is UUID v7?
UUID v7 is a new UUID standard (RFC 9562, published 2024) that combines timestamp with randomness. Unlike v4 (random), v7 IDs are sortable by time, making them ideal for databases and distributed systems.
- Time-sortable (K-sortable)
- Better for database indexing
- Extractable timestamp
- Newer standard (2024)
- Fully random and unpredictable
- Universal support
- No timing information leaked
- Established standard
What is UUID Generator Online?
A UUID (Universally Unique Identifier) is a 128-bit identifier standard defined in RFC 9562 that guarantees uniqueness across space and time without requiring a central coordination authority. UUID v7 (the 2024 standard) embeds a Unix millisecond timestamp in the first 48 bits, producing identifiers that are both unique and chronologically sortable. That is a significant advantage for database indexing. UUID v4 uses pure cryptographic randomness, producing IDs that reveal no timing information. Both versions have collision probabilities so low they can be treated as zero for all practical purposes.
How to Use
- Choose the UUID version: v7 (time-ordered, recommended for most uses) or v4 (fully random).
- Set how many UUIDs to generate in a single batch (1 to 100).
- Click Generate to create the identifiers.
- UUID v7 results display the embedded timestamp for each ID.
- Copy individual UUIDs by clicking the copy icon, or copy all at once with the Copy All button.
- Use the generated UUIDs as database primary keys, API request IDs, or distributed system identifiers.
Why Use This Tool?
Tips & Best Practices
- Use UUID v7 for database keys because they insert in chronological order and maintain B-tree efficiency
- The UUID v7 timestamp is milliseconds since the Unix epoch, stored in the first 48 bits
- Use UUID v4 for security tokens and session IDs where you do not want any timing information visible
- UUID v7 is now the recommended default per RFC 9562 (published 2024)
- Both versions have astronomically low collision probability, so you can safely use them without duplicate checking
- Store UUIDs as 36-character strings or as 16-byte binary depending on your database and performance needs
Frequently Asked Questions
What is UUID v7 and why should I use it?
UUID v7 (RFC 9562, published 2024) embeds a Unix millisecond timestamp in the first 48 bits, making IDs naturally sortable by creation time. This solves the database indexing problem with random UUID v4: v7 IDs inserted in chronological order maintain B-tree efficiency, reducing page splits and write amplification. They are ideal for logs, events, and time-series data.
How do I extract the timestamp from a UUID v7?
The first 12 hexadecimal characters (48 bits) of a UUID v7 contain the Unix timestamp in milliseconds. Parse those characters as a hexadecimal number and convert to a date. This generator displays the extracted timestamp automatically next to each v7 UUID for verification.
When should I use UUID v4 instead of UUID v7?
Use UUID v4 when you need fully unpredictable identifiers, such as security tokens, session IDs, or any scenario where revealing the creation time would be a privacy or security concern. Use UUID v7 for database keys, event IDs, and logs where chronological ordering and index efficiency matter. For most application primary keys, v7 is the better choice.
When should I NOT use UUIDs?
Avoid UUIDs when you need human-readable identifiers (use slugs or sequential numbers instead), when storage size is critical (UUIDs are 36 chars as text or 16 bytes as binary vs 4 bytes for a 32-bit integer), or when you need strictly sequential IDs for regulatory requirements. Also avoid client-generated UUIDs when you need the database to be the single source of truth for ID assignment.
Is my generated UUID data kept private?
Yes. All UUID generation runs entirely in your browser using the Web Crypto API and local JavaScript. No generated identifiers, timestamps, or usage patterns are sent to any server, API, or third-party service. Your UUIDs are created and exist only on your device.
Are the generated UUIDs cryptographically secure?
Yes. The generator uses the browser crypto.getRandomValues() API for all random bits, which provides cryptographically strong randomness suitable for security-sensitive applications. This is significantly more secure than Math.random(). However, UUIDs are designed as identifiers, not as encryption keys or passwords. Use a dedicated key derivation function for those purposes.
Real-world Examples
Using UUID v7 as a Database Primary Key
Replace auto-incrementing integer primary keys with UUID v7 to enable distributed inserts without coordination, while maintaining chronological sort order for efficient B-tree indexing.
Version: v7, Count: 5
0192a3b4-c5d6-7e8f-9a0b-c1d2e3f4a5b6 (2025-06-15T10:30:00.000Z) 0192a3b4-c5d6-7e90-1234-567890abcdef (2025-06-15T10:30:00.001Z) ...
Generating Session Tokens with UUID v4
Generate UUID v4 tokens for user sessions where unpredictability matters more than sort order. The random nature prevents attackers from guessing valid session IDs.
Version: v4, Count: 3
f47ac10b-58cc-4372-a567-0e02b2c3d479 7c9e6679-7425-40de-944b-e07fc1f90ae7 550e8400-e29b-41d4-a716-446655440000