UUID Generator
Generate UUID v1, v4, v5, and v7 identifiers instantly in your browser.
What is a UUID?
A UUID (Universally Unique Identifier), also known as a GUID (Globally Unique Identifier), is a 128-bit label standardised by RFC 4122. It is formatted as 32 hexadecimal digits displayed in five groups separated by hyphens: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. UUIDs are designed to be unique across space and time without a central registration authority, making them ideal for distributed systems.
UUID v1 — Time-Based
UUID v1 encodes the current timestamp as the number of 100-nanosecond intervals since 15 October 1582 (the UUID epoch), combined with a clock sequence and a node identifier. Because the timestamp is embedded in the UUID, v1 UUIDs are sortable by creation time — but they also expose when they were created. In browsers, the node ID cannot be a real MAC address, so this tool uses a random 48-bit node with the multicast bit set as specified in RFC 4122 §4.5.
UUID v4 — Random
UUID v4 is generated using random or pseudo-random numbers via crypto.randomUUID(). It is the most widely used UUID variant because it requires no coordination between machines and has an astronomically low collision probability — approximately 1 in 5.3 × 1036. The 13th character is always 4 (version indicator), and the 17th character is always one of 8, 9, a, or b (variant indicator).
UUID v5 — Name-Based (SHA-1)
UUID v5 is deterministic: the same namespace and name always produce the same UUID. It works by SHA-1 hashing a well-known namespace UUID concatenated with your input name, then setting the version and variant bits. Standard namespaces are DNS, URL, OID, and X.500. Use v5 when you need a stable, reproducible identifier for a known value — for example, deriving a consistent UUID for a domain name or a product SKU without storing a mapping table.
UUID v7 — Time-Ordered
UUID v7 (RFC 9562) is the modern replacement for v1. It embeds the Unix timestamp in milliseconds into the most significant 48 bits, which means v7 UUIDs sort lexicographically in chronological order. This makes them excellent as database primary keys — they avoid the index fragmentation caused by random v4 UUIDs while still carrying no personally identifiable information unlike v1.
Common Uses for UUIDs
- Database primary keys — avoid sequential integer IDs that leak record counts and are hard to merge across databases.
- Distributed systems — generate IDs on any node without a central counter, enabling offline-first and multi-region architectures.
- File and asset naming — give uploaded files unique names to prevent collisions and avoid exposing original filenames.
- Session and correlation tokens — track requests across microservices or log aggregation systems.
- Testing and seeding — generate realistic-looking IDs for test fixtures and database seeds.
Which version should I use?
- v4 — default choice; random, no information leakage.
- v7 — best for database primary keys; time-ordered for index performance.
- v5 — when you need a stable ID derived from a known name (e.g. a domain, SKU, or URI).
- v1 — legacy systems or when you specifically need the embedded timestamp format.
Related Tools
- QR Code GeneratorGenerate a downloadable QR code from any text or URL.Open tool
- Colour Code ConverterConvert colours between HEX, RGB, HSL and HSV formats.Open tool
- Timestamp ConverterConvert Unix timestamps to human-readable dates and back.Open tool
- CRON Expression BuilderBuild and explain CRON schedule expressions visually.Open tool