Micru Logo

UUID Generator

A complete suite of UUID tools for developers. Generate, validate, inspect, and convert Universally Unique Identifiers. All processing runs locally 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 used to uniquely identify information in computer systems. Standardised in RFC 9562 (which obsoletes RFC 4122), UUIDs are represented as 32 lowercase hexadecimal digits displayed in five groups separated by hyphens: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.

UUIDs are used everywhere in software - as primary keys in databases, identifiers in distributed systems, tracking tokens in event pipelines, file names for uploaded assets, and correlation IDs in log traces. Their core value is that they can be generated independently on any machine without coordination, and the probability of a collision is effectively zero.

UUID Versions at a Glance

v1 - Time + MAC

Encodes a 60-bit timestamp from the Gregorian calendar epoch (October 15, 1582) plus a node identifier derived from a MAC address or random bytes. Useful for audit logs where chronological ordering matters, but leaks timing information.

v4 - Random

122 bits of cryptographically random data. The simplest and most widely used UUID version. No time component, no MAC address. Suitable for any situation where uniqueness without ordering is sufficient.

v5 - Name-based (SHA-1)

Deterministic: derived by hashing a namespace UUID and a name string with SHA-1. The same inputs always produce the same UUID, making v5 ideal for content-addressable IDs, canonical identifiers for external resources, and stable references.

v7 - Unix Time + Random

The modern replacement for v1. Uses the Unix millisecond timestamp in the high bits followed by random data. Because the timestamp is in the most significant bits, v7 UUIDs sort chronologically - a critical advantage for database index locality and B-tree performance.

Choosing the Right UUID Version

  • New database primary keys: Use v7. Monotonically increasing timestamps keep index pages full and reduce page splits in B-tree databases like PostgreSQL and MySQL.
  • General-purpose IDs (session tokens, file names, API keys): Use v4. Maximum randomness, widely supported across every language and framework.
  • Stable IDs for named resources (URLs, domain names, email addresses): Use v5. The same input always maps to the same UUID, enabling idempotent ID generation across systems.
  • Audit logs where timestamp recovery matters: Use v1. The embedded Gregorian timestamp can be decoded to recover when the UUID was generated, useful in forensic and compliance contexts.

UUID Structure Decoded

Every RFC 4122 / RFC 9562 UUID carries two fields in fixed positions regardless of version:

Version field

Bits 4-7 of the third group (characters 13-16 in the canonical string). The single hex digit 4 in xxxxxxxx-xxxx-4xxx-... indicates version 4. Current versions are 1 through 8.

Variant field

The top 2-3 bits of the fourth group indicate the UUID layout. RFC 4122 UUIDs use variant 10xx (the digit is 8, 9, a, or b). Microsoft GUIDs use variant 110x.