What is UUID Generator?
UUID Generator creates Universally Unique Identifiers (UUIDs) in versions 1, 4, 5, and 7 format. Generate a single UUID or bulk-generate up to 10,000 at once, with options to format the output in standard hyphenated format, without hyphens, in uppercase, or as a URN. The tool also validates pasted UUIDs and identifies their version and variant.
A UUID (Universally Unique Identifier) is a 128-bit value formatted as 32 hexadecimal digits in the pattern 8-4-4-4-12 (xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx). The M digit encodes the version; N encodes the variant. UUID v4 is the most widely used โ it is randomly generated with about 5.3 ร 10^36 possible values, making collisions astronomically unlikely in practice.
UUID v7 (finalized in RFC 9562) is a newer format that embeds a Unix timestamp in the first 48 bits, making UUIDs sortable by creation time. This is valuable in database primary keys where index fragmentation from random v4 UUIDs causes performance problems โ UUID v7 inserts at the end of the index like an auto-increment ID while still being globally unique.
How to Use
- Click 'Generate' to create a single UUID v4.
- Select the version (v1, v4, v5, or v7) from the version dropdown before generating.
- Enter a count (up to 10,000) in the 'Bulk' field for mass generation.
- Toggle format options: uppercase, no hyphens, or URN prefix (urn:uuid:).
- Paste an existing UUID to validate it and see its version, variant, and (for v1/v7) timestamp.
Examples
Single UUID v4
Result: f47ac10b-58cc-4372-a567-0e02b2c3d479 โ random, no timestamp embedded
UUID v7 (time-ordered)
Result: 018f3a2b-c5d1-7e23-9f45-12a3b4c5d6e7 โ first 48 bits are Unix timestamp in milliseconds โ sortable
UUID for database primary key (PostgreSQL)
Result: gen_random_uuid() for v4, or pgcrypto extension โ UUID v7 preferred for new tables to avoid index fragmentation
Frequently Asked Questions
What is the difference between UUID v4 and v7?
UUID v4 is entirely random โ 122 bits of randomness. UUID v7 embeds a Unix timestamp in the first 48 bits, making it lexicographically sortable by creation time. v7 is preferred for database primary keys because it preserves B-tree index locality; v4 fragments the index with each insert.
Can UUID v4 collide?
Theoretically yes, practically no. UUID v4 has 2^122 possible values (~5.3 ร 10^36). Generating 1 billion UUIDs per second for the lifetime of the universe would give a collision probability of about 0.00000000001%. You will never experience a collision in practice.
What is UUID v5?
UUID v5 is deterministic โ it generates a UUID from a namespace UUID and a name using SHA-1 hashing. The same namespace + name always produces the same UUID v5. This is useful for content-addressable identifiers: the URL 'https://example.com/page' always maps to the same UUID v5.
Should I use UUID or auto-increment IDs?
Auto-increment is simpler and more compact. UUIDs are better when: IDs must be generated without database coordination (offline-first, microservices), IDs should not reveal insertion order, or you are merging data from multiple databases. UUID v7 gives the best of both: globally unique and time-ordered.
What is a ULID and how does it compare?
ULID (Universally Unique Lexicographically Sortable Identifier) is an alternative to UUID with 48-bit timestamp + 80 bits of randomness, formatted as a 26-character Crockford Base32 string (no hyphens). It is sortable like UUID v7 but more compact in text form. Both are valid choices for time-ordered IDs.
Related Tools