Skip to content

UUID Generator

Generate UUIDs v1 and v4 online with bulk generation support. Free UUID generator for unique identifiers in databases and APIs.

About UUID

UUID (Universally Unique Identifier), also known as GUID, is a 128-bit identifier that is guaranteed to be unique across all devices and time.

This tool generates UUID version 4, which uses random or pseudo-random numbers. The format is: xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx

UUIDs are commonly used as database primary keys, session identifiers, and anywhere unique IDs are needed.

How to Use UUID Generator

1

Choose UUID version

Select v4 (random, default) for general use, v1 (timestamp-based) when you need to extract creation time, or v7 (sortable timestamp) for database primary keys requiring sequential access.

2

Choose quantity

Generate one UUID at a time, or batch-generate multiple at once (10, 50, 100) when seeding databases, creating bulk import data, or testing systems requiring many IDs.

3

Click Generate

Each generation produces fresh, unique UUIDs using cryptographically secure randomness. Click again for new ones — each generation is independent.

4

Copy to use

Click Copy to put the UUID(s) on your clipboard. Use them as database primary keys, API request IDs, file names, session tokens, or anywhere you need a globally unique identifier.

When to Use UUID Generator

Database primary keys in distributed systems

When multiple services or database shards generate records concurrently, sequential auto-increment IDs cause conflicts. UUIDs eliminate coordination — each service generates IDs independently with no risk of collision. Pair v7 UUIDs with index-friendly databases for both uniqueness and good index locality.

Public-facing entity identifiers

Sequential IDs in URLs (yoursite.com/order/12345) leak business metrics — competitors know order volume, scrapers can iterate through your data. UUIDs in URLs (yoursite.com/order/550e8400-...) reveal nothing. Use UUIDs for orders, users, posts, and any entity exposed to the outside world.

Idempotency keys for API requests

When making non-idempotent API calls (POST creating resources, payment requests), include an Idempotency-Key header with a UUID. Servers use this to deduplicate retried requests — if a network failure causes a retry, the server recognizes the same idempotency key and returns the original response instead of creating duplicates.

Session tokens and request tracing

Generate UUIDs for session IDs (when not using stateless JWT auth), request correlation IDs that trace requests across microservices, distributed transaction IDs, file upload IDs that avoid filename collisions, and trace IDs in observability platforms like OpenTelemetry, Datadog, and Honeycomb.

UUID Generator Examples

UUID v4 (random)

Input
Version: 4 (random)
Output
550e8400-e29b-41d4-a716-446655440000

Standard random UUID. The '4' in the third group ('41d4') indicates version 4. The first character of the fourth group is 'a-b-8-9' indicating the standard variant (RFC 4122). All other bits are pure random — this is the most common UUID type, used everywhere from databases to APIs.

UUID v7 (sortable timestamp)

Input
Version: 7 (timestamp + random)
Output
0190e7c4-7e4d-7000-8a3b-9c2d4e5f6a7b

Newer UUID v7 starts with a Unix timestamp in milliseconds (0190e7c4-7e4d represents the timestamp). UUIDs generated chronologically sort correctly by their string representation — solving a key downside of v4 in databases where index locality matters. Adopted by many modern systems for primary keys.

Bulk generation

Input
Quantity: 5, version: 4
Output
fb1d4b3e-...
7a8c2e1f-...
d9b6e8a3-...
2f0c1e9d-...
c4b8a7f6-...

Bulk generation produces multiple independent UUIDs at once — useful when seeding test databases, creating bulk import CSVs, or generating many session tokens simultaneously. Each is independently random; no relationships between them. Copy as a list and paste directly into your application or database query.

Tips & Best Practices for UUID Generator

  • 1.Use UUID v4 for general purposes. Use v7 when you need database primary keys with sequential index access patterns. Avoid v1 in new code — it leaks the generating machine's MAC address (a privacy issue) and creation time, which can fingerprint your infrastructure.
  • 2.Store UUIDs as native UUID type in your database (PostgreSQL has UUID, MySQL has BINARY(16) or CHAR(36)) rather than VARCHAR strings. Native types are 16 bytes vs. 36 for string representation, faster to compare, and indexable more efficiently.
  • 3.When using UUIDs in URLs, the hyphenated format is standard. Don't strip hyphens to save 4 characters — most languages and parsers expect the standard format. If you need shorter URL-safe IDs, consider Base62 (Stripe-style) or NanoID instead of UUIDs.
  • 4.Don't use Math.random()-based UUID generators. They produce predictable IDs that an attacker can guess for sensitive operations (session hijacking, token brute-forcing). This generator and all production UUID libraries use crypto.getRandomValues — verify your library does too.
  • 5.For idempotency keys, generate UUIDs client-side and reuse them on retries. The server uses the key to deduplicate — same key = same operation = same response. Critical for payment APIs, order creation, and any non-idempotent POST request that might be retried over flaky networks.
  • 6.When migrating from sequential IDs to UUIDs, plan for the doubled ID size (4-8 bytes → 16 bytes), potential index size growth, and any URL-encoding considerations. New systems should adopt UUIDs from day one; migrating existing systems can be done in phases (add UUID column alongside int ID, gradually transition references).

Frequently Asked Questions

A UUID (Universally Unique Identifier), also called a GUID (Globally Unique Identifier) in Microsoft systems, is a 128-bit number used to identify entities. It's typically displayed as 32 hexadecimal characters in 5 groups separated by hyphens, like '550e8400-e29b-41d4-a716-446655440000'. UUIDs are designed to be unique across space and time without coordination between systems.