Dev Tools

UUID Generator

Generate UUID v4, UUID v7, ULID, and nanoid identifiers. Bulk generate up to 100 at once with format options.

Quick Answer

A UUID (Universally Unique Identifier) is a 128-bit label used to identify resources without a central authority. UUID v4 uses pure randomness, UUID v7 adds a sortable timestamp, ULID offers compact sortable IDs, and nanoid provides short URL-safe identifiers. All formats have near-zero collision probability.

UUID v4 Generator

Random — 122 bits of randomness, universally supported

Format Details: UUID v4

Example: 550e8400-e29b-41d4-a716-446655440000
Entropy: 122 random bits
Sortable: No
Length: 36 chars (with hyphens)

About This Tool

The UUID Generator is a comprehensive tool for creating unique identifiers in four widely-used formats: UUID v4, UUID v7, ULID, and nanoid. Every identifier is generated entirely in your browser using the Web Crypto API, ensuring cryptographic-quality randomness without sending any data to a server. Whether you are building a distributed system, designing a database schema, or prototyping an API, this tool gives you production-ready identifiers in seconds.

UUID v4: The Universal Standard

UUID v4 is the most commonly used UUID version. Defined in RFC 4122, it fills 122 of its 128 bits with cryptographic randomness (the remaining 6 bits encode the version and variant). The result is a 36-character string in the format xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx, where y is one of 8, 9, A, or B. UUID v4 is supported natively in virtually every programming language and database system, making it the safest default choice for unique identifiers. Its primary drawback is that it is not naturally sortable — inserting random UUIDs as primary keys can fragment B-tree indexes in relational databases, leading to write amplification and slower queries over time.

UUID v7: Time-Sortable UUIDs

UUID v7, proposed in the newer RFC 9562 (formerly the uuid6 draft), solves the index fragmentation problem by embedding a Unix millisecond timestamp in the first 48 bits. The remaining bits are filled with random data. Because the timestamp portion increases monotonically, UUID v7 values created later always sort after earlier ones. This makes them excellent primary keys for databases like PostgreSQL, MySQL, and CockroachDB, where sequential inserts are significantly faster than random ones. UUID v7 retains full backward compatibility with the UUID format, so any system that accepts UUID v4 also accepts UUID v7.

ULID: Compact and Sortable

ULID (Universally Unique Lexicographically Sortable Identifier) encodes 128 bits as 26 characters using Crockford Base32. The first 10 characters encode a millisecond timestamp, and the remaining 16 characters encode 80 bits of randomness. ULIDs are case-insensitive, avoid ambiguous characters (I, L, O, U), and sort lexicographically in creation order. At 26 characters versus 36 for a UUID, ULIDs are more compact — useful in URLs, filenames, and log lines where space matters.

Nanoid: URL-Safe and Tiny

Nanoid generates identifiers of customizable length (default 21 characters) from a 64-symbol URL-safe alphabet. With 21 characters, a nanoid carries roughly 126 bits of entropy — comparable to a UUID v4 — but in a much shorter string. Nanoid is popular in frontend applications, shortened URLs, and anywhere a compact, human-copyable identifier is needed. Because it uses only URL-safe characters (letters, digits, underscore, and hyphen), nanoid values can be embedded directly in URLs without encoding.

Choosing the Right Format

If you need maximum compatibility across systems and languages, use UUID v4. If your identifiers will be used as database primary keys and query performance matters, choose UUID v7 or ULID for their time-sortable properties. If you need short, URL-safe identifiers and don't require timestamp ordering, nanoid is the best fit. All four formats provide sufficient entropy to make collisions virtually impossible in any realistic application.

Bulk Generation and Formatting

This tool lets you generate up to 100 identifiers at once, copy them individually or all at once, and toggle between uppercase and lowercase output. For UUID v4 and v7, you can also remove hyphens to get a compact 32-character hex string — useful for database columns stored as CHAR(32) or BINARY(16). All generation happens client-side with zero network requests, so the tool works offline and never exposes your identifiers to any server.

Frequently Asked Questions

What is the difference between UUID v4 and UUID v7?
UUID v4 is entirely random — all 122 bits (after version and variant markers) are generated from a cryptographic random source. UUID v7 embeds a Unix millisecond timestamp in the first 48 bits, making it time-sortable. This means UUID v7 values created later always sort after earlier ones, which dramatically improves database index performance compared to v4.
What is a ULID and why would I use it instead of a UUID?
A ULID (Universally Unique Lexicographically Sortable Identifier) is a 128-bit identifier encoded as 26 Crockford Base32 characters. Like UUID v7, it contains a timestamp for natural sort ordering. ULIDs are more compact (26 vs 36 characters), use a case-insensitive alphabet that avoids ambiguous characters (I, L, O), and are easier to copy-paste. They are ideal when you want sortable IDs with a more compact representation.
What is nanoid and when should I use it?
Nanoid generates compact, URL-friendly unique identifiers using 21 characters from an alphabet of 64 symbols (A-Z, a-z, 0-9, underscore, hyphen). It provides roughly 126 bits of entropy, making collisions virtually impossible. Use nanoid when you need short, URL-safe IDs — for example, in shortened URLs, file names, or client-side identifiers where a full UUID would be unnecessarily long.
Are these generated IDs cryptographically secure?
Yes. All generators on this page use the Web Crypto API (crypto.getRandomValues) for their random components. This is a cryptographically secure pseudo-random number generator (CSPRNG) provided by your browser or operating system. The random bits are suitable for security-sensitive applications such as session tokens and API keys.
How many UUIDs can I generate before getting a collision?
UUID v4 has 122 random bits, giving approximately 5.3 x 10^36 possible values. You would need to generate about 2.7 x 10^18 (2.7 quintillion) UUIDs before having a 50% probability of a single collision. In practical terms, if you generated one billion UUIDs per second, it would take about 85 years to reach that threshold. For all practical purposes, UUID collisions do not happen.
Can I remove hyphens from UUIDs for use in databases?
Yes. Use the 'Without hyphens' option to generate UUIDs as plain 32-character hex strings. Many databases store UUIDs more efficiently without hyphens as a BINARY(16) or CHAR(32) column. PostgreSQL and MySQL both have native UUID types that handle formatting automatically, so you can store them either way.