OnSumoTools

UUID Generator

This tool generates Universally Unique Identifiers (UUIDs) entirely in your browser using the Web Crypto API. Choose UUID v4 (random), UUID v7 (time-ordered), or UUID v1 (time-based with MAC address stub). Generate one at a time or in bulk. No identifiers are stored, logged, or sent to any server. The tool is free, requires no login, and works offline once the page loads.

Generated UUIDs

Validate UUID

How does the UUID Generator work step by step?

The UUID generator produces universally unique identifiers in RFC 4122 format across three versions. Version 1 derives the UUID from the current timestamp and MAC address, producing identifiers that sort chronologically but potentially fingerprinting the generating machine, which is not recommended for public-facing IDs. Version 4 uses cryptographically random bytes for all 122 random bits, producing identifiers with no structural relationship to each other or to the generating environment, making it the recommended default for database primary keys. Version 7 encodes a millisecond-precision Unix timestamp in the first 48 bits followed by random bits, producing identifiers that are both random and monotonically sortable by creation time, useful for database index efficiency without the privacy risk of V1. The tool generates 1-100 identifiers per request and outputs them in the standard 8-4-4-4-12 hyphenated format, in uppercase, lowercase, or without hyphens. All random generation uses the browser's window.crypto.getRandomValues, which is cryptographically secure. Key assumption: V1 generation in the browser approximates the MAC address with a random node value since browsers do not expose network interface hardware addresses. Edge case: UUID V4 collisions are theoretically possible but practically negligible: the probability of a duplicate in 1 trillion generated IDs is approximately 1 in a billion.

What does a typical UUID Generator result look like?

UUID v5 with the DNS namespace and name "example.com" always returns the same ID on every run. UUID v4 with quantity 10 gives ten different random IDs. Nil returns 00000000-0000-0000-0000-000000000000.

Related tools

Frequently asked questions

  • What is the difference between UUID v1, v4, and v7?

    UUID v1 encodes a timestamp and the generating machine's MAC address, which can reveal when and where it was created. UUID v4 is fully random, revealing nothing about its origin. UUID v7 encodes a millisecond-precision timestamp in the leading bits, making it time-sortable like v1 but without embedding MAC addresses. For new projects, use v4 for external IDs and v7 for database keys.

  • Are UUIDs truly unique?

    In practice, yes. UUID v4 has 2^122 possible values. The probability of generating two identical UUIDs is so small it is effectively zero for any real workload. The only practical exception is a broken random number generator, such as a virtual machine that restores from a snapshot and reuses the same PRNG state. This tool uses crypto.getRandomValues(), which draws from the OS entropy pool and is not subject to this problem.

  • Can I use a UUID as an API key?

    A UUID v4 provides 122 bits of randomness, which is sufficient entropy for an API key. However, API keys are typically longer (32+ characters base64url-encoded) to allow for a prefix scheme that helps with key rotation and auditing. If you need a simple high-entropy token and do not need key prefixes, UUID v4 works. For production API key generation, consider using a dedicated token library.

  • Does UUID v7 reveal when a record was created?

    Yes. The leading 48 bits of a UUID v7 encode a Unix timestamp in milliseconds. Anyone with access to the UUID can extract the creation time with millisecond precision. If your application should not expose record creation times (for example, in a privacy-sensitive context), use UUID v4 instead and store creation times in a separate column.

  • What is a ULID and how does it compare to UUID v7?

    ULID (Universally Unique Lexicographically Sortable Identifier) predates UUID v7 and serves a similar purpose: time-ordered, sortable unique IDs. ULIDs use a base32 encoding instead of hexadecimal, which produces 26-character strings instead of 36. UUID v7 is now part of the official RFC 9562 standard, which gives it broader ecosystem support. For new projects using standard UUID libraries, v7 is the better choice.

  • Should I store UUIDs as strings or as binary in the database?

    Binary storage (16 bytes) is more efficient than string storage (36 characters). Most databases support a native UUID type or a BINARY(16) column. MySQL's CHAR(36) UUID storage is 36 bytes, which is 2.25x larger than binary. In PostgreSQL, the uuid type stores 16 bytes. For high-volume tables, binary storage meaningfully reduces index size and scan speed.

What a UUID is

A UUID is a 128-bit identifier written as 32 hex characters split by hyphens, like 123e4567-e89b-12d3-a456-426614174000. You can create one without asking a central server, and the odds of two machines making the same one are tiny.

That's why they're everywhere: database keys, file names, session IDs, message IDs. Generate a single one or a whole batch here, copy it or download the list.

Which version do you need

Version 4 is the common pick. It's built from random numbers and carries no information about when or where it was made. Use it when you just need an ID.

Version 5 is derived from a name and a namespace using SHA-1. Give it the same inputs and you get the same UUID every time. That's useful when you want a stable ID for something like a URL.

Version 1 includes a timestamp and machine details. Version 7 is newer and starts with a timestamp too, so IDs sort by creation time. That helps database indexes, but it also means the ID reveals roughly when a record was created. Decide whether that's a privacy problem for your case.

The nil UUID is all zeros. Programs use it as an empty placeholder.

Output options

Switch to uppercase, remove the hyphens or wrap values in quotes. There's an SQL-ready format for pasting into an INSERT statement. A validator checks whether a string you already have is a proper UUID.

Are they really unique?

In practice, yes. A random v4 UUID has 122 random bits. You'd need to generate billions per second for years before a clash became likely. Not mathematically impossible, but practically not worth worrying about.

The catch is quality of randomness. This tool uses your browser's secure random source, which is the right way to do it.

Not an API key

Don't use a UUID as a secret. It's an identifier, not a credential. Some versions leak timestamps, and even random ones are often logged and shared in URLs. Generate API keys with a proper secret generator and treat them as secrets.

Storing them in a database

A UUID stored as text takes 36 characters. As binary it takes 16 bytes. Use your database's native UUID type if it has one, or a 16-byte binary column. It saves space and speeds up indexes. Random v4 values scatter across an index, which can slow writes on very large tables. Time-ordered options like v7 or ULID help there.

A ULID is similar in spirit to v7. It's sortable by time and uses a shorter text form. Pick whichever your stack supports well.