Create UUID v7 or ULID to maintain insert order in DBs.
What is a UUID?
A Universally Unique Identifier (UUID) is a 128-bit string of values used to uniquely identify resources. Unlike standard databases where identifiers are auto-incremented integers, UUIDs can be generated offline by separate clients and merged into databases without conflicts.
The canonical representation displays 32 hex digits grouped into five segments: 8-4-4-4-12. This yields a total string length of 36 characters (including hyphens). The structure represents various components including the timestamp, clock sequence, node identifier (MAC address), and UUID version bits.
Understanding UUID Layout
A standard UUID layout represents 128 bits mapped to hexadecimal groups as follows:
UUID v4 breakdown (example)
xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx
M β UUID Version (e.g. 1, 3, 4, 5, 7)
N β Variant (e.g. 8, 9, a, b)
Example UUID:
f81d4fae-7dec-41d0-a765-00a0c91e6bf6
ββ v4 random UUID
Version Examples
Explore different UUID variations
Select any version below, copy the sample UUID, or inspect its characteristics.
Sample Output Format
f81d4fae-7dec-11d0-a765-00a0c91e6bf6
π‘ Generates a fully random ID. Highly unlikely to ever collide. Best for general use cases.
Which UUID Version Should You Choose?
Selecting the wrong version can impact security, search performance, and scalability. Here is the breakdown.
Version
Algorithm
Best For
Standard
UUID v1
Timestamp + MAC Address
Distributed systems where generation sequence matters
RFC 4122
UUID v3
MD5 Hash of Namespace & Name
Deterministic lookup keys where input map is fixed
RFC 4122
UUID v4
Cryptographically Random
General-purpose IDs, session identifiers, APIs
RFC 4122
UUID v5
SHA-1 Hash of Namespace & Name
Same as v3, but uses a more secure SHA-1 hashing algorithm
RFC 4122
UUID v7
Time-ordered Epoch + Random
Primary keys in relational databases (PostgreSQL, MySQL)
Bulk generation up to 1000 unique keys in one click
Custom formats: optional hyphens, braces, and letter casing
Interactive analyzer: parses metadata, epoch timestamp, and location
Copy entire output batch or single key instantly to clipboard
Code snippets for JavaScript, Python, Go, Rust, Java, and C#
Fully sandboxed client-side JavaScript processing
No signup, no telemetry, no cookies, 100% free
UUID Security and Privacy Warning
While UUIDs are incredibly useful, you should be mindful of security implications. Standard UUID v1 and v6 expose the host MAC address. This means an attacker can trace which server generated the ID, and potentially determine its physical location.
For public-facing APIs, secure sessions, and user IDs, it is highly recommended to use:
UUID v4
For general random ID needs that do not leak internal server details.
UUID v7
For databases where sequential ordering is needed without MAC address leaks.
NanoID
For high-performance URL-safe keys where shorter characters are preferred.
π‘ If you need cryptographically secure keys, rely on a robust secure random source. This client-side tool uses standard cryptographically secure Web Crypto APIs.
Frequently Asked Questions
Common questions about UUIDs, sorting, collision rates, and developer best practices.
Related Developer Tools
Explore more free developer tools to speed up debugging, testing, and development.