Skip to main content
Toolsbase Logo

UUID/ULID Generator

Generate UUID v4, UUID v7, and ULID. Supports batch generation and various format options.

Last updated:

How to Use

Expand how to use
  1. 1

    Select format

    Choose the format you want to generate: UUID v4 (random), UUID v7 (timestamp-based), or ULID.

  2. 2

    Configure options

    Set uppercase/lowercase, with or without hyphens, and the number of IDs to generate (1-100).

  3. 3

    Generate and copy

    Click 'Generate' and then 'Copy' to copy the generated IDs to clipboard.

Settings

Integer from 1 to 100

Result

0 items

History

No history

About UUID/ULID Generator

UUID/ULID Generator produces universally unique identifiers for databases, APIs, and distributed systems, using the browser's built-in cryptographically secure random number generator (crypto.getRandomValues). Three formats are available: UUID v4 (122 bits of pure randomness, the most widely used format), UUID v7 (48-bit millisecond timestamp followed by random bits, standardized in RFC 9562 — time-sortable and B-tree-friendly), and ULID (26-character Base32 string with a 10-character timestamp prefix — lexicographically sortable and URL-safe). You can generate up to 100 IDs at once, toggle uppercase or lowercase output, and remove hyphens for use in URLs or filenames.

Key Features

  • UUID v4 generation (122 bits of random value, the most widely used format)
  • UUID v7 generation (timestamp + random, chronologically sortable)
  • ULID generation (timestamp + random, 26 characters, lexicographically sortable)
  • Batch generation (up to 100 IDs at once)
  • Uppercase/lowercase toggle and hyphen removal options

Common Use Cases

  • Generate primary keys for PostgreSQL or MongoDB
  • Create unique request IDs for API tracing
  • Generate correlation IDs for distributed systems
  • Create session tokens or nonce values
  • Batch-generate IDs for database seeding or testing

Frequently Asked Questions

What's the difference between UUID v4, UUID v7, and ULID?

UUID v4 is entirely random (122 bits), making it the simplest and most universally supported format. UUID v7 embeds a 48-bit millisecond timestamp in the high bits, so IDs generated later sort after earlier ones — this dramatically improves insert performance on B-tree indexes in PostgreSQL and MySQL. ULID also encodes a timestamp (10 Crockford Base32 characters) and is 26 characters long, shorter than UUID's 36, making it convenient for URLs and filenames.

Which format should I use for database primary keys?

UUID v7 or ULID is strongly recommended for database primary keys. Random UUIDs (v4) scatter across the B-tree index on every insert, causing page splits and fragmentation over time. Because UUID v7 and ULID are time-ordered, new rows are always appended near the end of the index, keeping it compact and insert performance high. For new projects, UUID v7 is the standard choice as it is defined in RFC 9562.

Is there a chance of UUID collision?

For UUID v4, the probability of collision is astronomically low — roughly 1 in 2^122 (about 5 × 10^36) unique values. Even generating 1 billion IDs per second continuously, you would expect to wait approximately 85 years before a collision. In practice, UUID v4 collisions are not a concern for any real-world application.

When should I use the no-hyphen option?

Use the no-hyphen option when hyphens cause problems in your context, such as in URL path segments, query parameters, filenames, or systems that treat hyphens as special characters. The resulting 32-character hex string is just as unique as the hyphenated form.

How is the randomness guaranteed?

This tool uses the browser's crypto.getRandomValues() API, which draws entropy from the operating system's cryptographically secure pseudorandom number generator (CSPRNG). This is fundamentally different from Math.random() and produces unpredictable, unbiased values suitable for security-sensitive uses such as session tokens.

Can I extract the generation time from a UUID v7?

Yes. The first 48 bits of a UUID v7 store a Unix millisecond timestamp, so you can recover the approximate creation time. This is useful for debugging and log analysis but means the ID reveals timing information. If you need to hide when an ID was generated, use UUID v4 instead.

Why use UUIDs instead of sequential integers?

Sequential auto-increment IDs require a central authority to assign the next number, which creates a bottleneck in distributed systems. UUIDs can be generated independently by any service or client without coordination. They also avoid exposing record counts or insertion order to external users, which is a minor but real security consideration.

Are the generated IDs sent to a server?

No. ID generation uses the browser's crypto.getRandomValues() API locally. Nothing is transmitted — you can generate IDs for internal use without any network activity.