We use cookies to understand how DevToolsHub is used and to improve your experience. You can choose which types of cookies to allow.
Generate UUIDs (v4, v7, v1) in bulk with format options.
Loading...
Loading...
A UUID Generator is a tool that creates Universally Unique Identifiers β 128-bit labels that are practically guaranteed to be unique without any central coordination. UUIDs (also known as GUIDs in the Microsoft ecosystem) are defined in RFC 4122 and are used everywhere in modern software: as database primary keys, session identifiers, file names, trace IDs in distributed systems, API request IDs, and anywhere you need a unique label without a central authority handing them out.
A UUID is represented as 32 hexadecimal digits grouped into five sections separated by hyphens, like 550e8400-e29b-41d4-a716-446655440000. The total number of possible UUIDs is 2128, which is approximately 3.4 Γ 1038. To put that in perspective: if you generated one billion UUIDs every second for 85 years, the probability of a single collision would still be roughly 50%. This is why UUIDs are considered βuniversally uniqueβ β the space is so vast that random collisions are astronomically unlikely.
There are several versions of UUIDs, each designed for different use cases. UUID v1is time-based, derived from the current timestamp and the machineβs MAC address. UUID v4 is the most popular version β it uses random or pseudo-random bytes for all 122 bits of randomness (6 bits are reserved for version and variant). UUID v7, added in RFC 9562, combines a 48-bit Unix timestamp with random bits, producing UUIDs that are both unique and sortable by time β ideal for databases that benefit from sequential inserts.
Common use cases for UUIDs include: database primary keys (especially in distributed databases like Cassandra, MongoDB, or PostgreSQL with uuid columns), session tokens and correlation IDs in web applications, file naming to avoid collisions in shared storage, trace IDs in microservices for distributed tracing (e.g., OpenTelemetry), idempotency keys in payment APIs to prevent duplicate charges, and anonymous user identifiers in analytics where you need a stable ID without PII. The collision probability of v4 UUIDs is so low that for any practical system, you can treat them as globally unique β the chance of a collision in 103 trillion v4 UUIDs is still less than one in a billion.
.txt file, or Clear to reset the output area.Version 1 UUIDs are derived from the current time (measured in 100-nanosecond intervals since October 15, 1582 β the start of the Gregorian calendar) and a node identifier (typically the machineβs MAC address). This makes v1 UUIDs sortable by creation time, but it also means they can leak the hostβs MAC address, which is a privacy concern. In this tool, we use a random node identifier instead of a real MAC address to protect your privacy. Use v1 when you need time-ordering and donβt mind that the timestamp is tied to the Gregorian epoch rather than Unix time.
Version 4 is the most widely used UUID version. All 122 bits of randomness (6 bits are fixed for version and variant) are filled with cryptographically secure random numbers from the Web Crypto API. This makes v4 UUIDs unpredictable and uniformly distributed across the entire UUID space. They are ideal when you need pure randomness with no ordering, such as session IDs, anonymous user IDs, or idempotency keys. If youβre unsure which version to use, v4 is the safe default.
Version 7, introduced in RFC 9562, is the modern choice for database primary keys. It combines a 48-bit Unix timestamp (millisecond precision since January 1, 1970) with 74 bits of randomness. Because the timestamp occupies the most significant bits, v7 UUIDs sort chronologically β making them ideal for B-tree indexes in databases like PostgreSQL and MySQL. Sequential insertion dramatically reduces index fragmentation and page splits compared to v4, which inserts randomly. Use v7 when you need UUIDs that are both unique and time-ordered, such as for event logs, audit trails, or any append-heavy table.
crypto.getRandomValues) for randomness, with a Math.random fallback for older browsers..txt file with one click.Loading...