DevBolt
Processed in your browser. Your data never leaves your device.

How do I generate a UUID online?

Click Generate to create a cryptographically random UUID v4 instantly. You can generate UUIDs in bulk (up to 500 at once), choose between uppercase and lowercase, and copy all results with one click. UUIDs are generated in your browser using the native crypto API.

Generate a single UUID v4
Input
1 UUID
Output
f47ac10b-58cc-4372-a567-0e02b2c3d479
← Back to tools

UUID Generator

Generate random UUID v4 identifiers. Bulk generation supported.

Tips & Best Practices

Pro Tip

Use UUIDv7 for database primary keys, not UUIDv4

UUIDv4 is fully random, which causes B-tree index fragmentation and slower INSERT performance in databases. UUIDv7 (RFC 9562, ratified 2024) embeds a Unix timestamp in the first 48 bits, making IDs time-sortable and index-friendly. PostgreSQL 17+ and most ORMs now support UUIDv7 natively.

Common Pitfall

UUID collision risk is real in browser crypto

UUID v4 uses 122 random bits — collision probability is astronomically low with a good PRNG. However, some older browsers and embedded environments have weak crypto.getRandomValues() implementations. Always verify your runtime uses a cryptographically secure random source, especially in IoT or embedded JavaScript.

Real-World Example

UUIDs vs auto-increment IDs: a practical trade-off

Auto-increment IDs leak information (total record count, creation rate) and cause merge conflicts in distributed systems. UUIDs solve both problems but use 128 bits vs 32-64 bits, increasing index size by 2-4x. For most web apps under 10M rows, this trade-off is worth it. For analytics tables with billions of rows, consider ULID or Snowflake IDs.

Security Note

UUIDv1 leaks your MAC address

UUID version 1 embeds the machine's MAC address and creation timestamp. This means anyone with a v1 UUID can identify the machine that generated it and when. Never use UUIDv1 for user-facing identifiers. Stick with v4 (random) or v7 (time-sortable random).

Frequently Asked Questions

What is a UUID and when should I use one?
A UUID (Universally Unique Identifier) is a 128-bit identifier formatted as 32 hexadecimal digits in 5 groups separated by hyphens (e.g., 550e8400-e29b-41d4-a716-446655440000). UUIDs are used as database primary keys, API resource identifiers, session tokens, distributed system correlation IDs, and file names that must be globally unique. The key advantage is that UUIDs can be generated independently on any machine without a central authority and are virtually guaranteed to be unique — the probability of collision for UUID v4 is astronomically low (1 in 2^122).
What is the difference between UUID v4 and UUID v7?
UUID v4 is randomly generated using 122 random bits, making it unpredictable but unordered. UUID v7 (RFC 9562, 2024) embeds a Unix timestamp in the first 48 bits followed by random bits, making it both unique and time-sortable. UUID v7 is better for database primary keys because its time-ordering means sequential inserts maintain B-tree index locality, dramatically improving write performance in PostgreSQL, MySQL, and other databases. UUID v4 is better when unpredictability matters, like security tokens. For most new applications, UUID v7 is the recommended choice.
Can two UUID v4 values ever be the same?
Theoretically yes, but practically no. UUID v4 uses 122 random bits, giving 5.3 × 10^36 possible values. To have a 50% chance of one collision, you would need to generate approximately 2.7 × 10^18 UUIDs — that is 2.7 quintillion. Generating one billion UUIDs per second, it would take 86 years to reach that threshold. For all practical purposes, UUID v4 collisions do not happen. However, the randomness quality depends on your system's cryptographic random number generator (CSPRNG). DevBolt uses the Web Crypto API which provides cryptographically strong randomness.

Related Generate Tools