UUID Generator

Formatting
Left UUID List
Right JSON Array
Ready. Generate UUID v4 values and copy or download them.
UUID v4 • 100% client-side

About UUID Generator

Generate single or multiple UUID v4 values for databases, tests, configuration files and more. Get a plain list on the left and a ready-to-use JSON array on the right.

UUID Generator

UUIDs (Universally Unique Identifiers) are 128-bit values used to create stable, collision-resistant IDs without centralized coordination. They are ideal for distributed systems, event tracking, and database primary keys where multiple services generate IDs independently. This UUID generator produces random UUIDs instantly in your browser, so you can copy them into tests, payloads, or docs without installing any libraries. It is fast, reliable, and runs locally to keep your data private.

What a UUID is and why it exists

A UUID is a standardized identifier defined by RFC 4122. It is designed to be globally unique across machines, processes, and time. The most common type is UUIDv4, which is randomly generated and extremely unlikely to collide. UUIDs are useful when you cannot rely on an auto-incrementing database sequence or when you need to generate IDs client-side before data is stored. They also make it easier to merge data from multiple sources without reassigning keys.

Where UUIDs are used

  • Databases: As primary keys or unique IDs in distributed systems.
  • Logs and tracing: Correlation IDs tie together logs across microservices.
  • APIs: Request IDs and idempotency keys prevent duplicate writes.
  • Event streams: Unique IDs for events in Kafka, RabbitMQ, or streaming pipelines.
  • Testing: Unique tokens for fixtures, mocks, and sample data.

How to generate a UUID

  1. Click Generate to create a new UUID.
  2. Copy the value and paste it into your payloads, test scripts, or database rows.
  3. Repeat as many times as needed for bulk test data.

Example UUID:

550e8400-e29b-41d4-a716-446655440000

UUIDv4 format explained

UUIDs have a standard format of 32 hexadecimal characters separated by hyphens in a 8-4-4-4-12 pattern. For UUIDv4, the third group starts with a 4 (the version), and certain bits in the fourth group indicate the variant. This format makes it easy to validate at a glance and ensures consistent parsing across tools.

Example workflow: request tracing

Suppose you are debugging a user checkout flow across several microservices. Generate a UUID and send it as a request header:

X-Request-Id: 8b624f5b-4f2e-4f77-a387-8bbd5a9f5b61

Each service logs the same ID, allowing you to trace the path of a request through the system and diagnose failures quickly.

Common errors and misunderstandings

  • Assuming order: UUIDv4 values are random and not sortable by time. Use UUIDv1 or ULIDs for time-ordered IDs.
  • Using UUIDs as secrets: UUIDs are not secret. They are identifiers, not access tokens.
  • Over-indexing: UUIDs can be slower as primary keys in some databases due to non-sequential inserts. Consider UUIDv7 or ULIDs if ordering matters.
  • Validation errors: A valid UUID must match the 8-4-4-4-12 format. Extra characters or missing hyphens will fail validation.
  • Mixing types: Some systems expect lowercase UUIDs. Normalize casing if needed.

Best practices

  • Use UUIDv4 when you need decentralised, random IDs.
  • Store UUIDs as 16-byte binary values if performance and storage are critical.
  • Include UUIDs in logs for consistent traceability.
  • Use validation checks on APIs to avoid malformed IDs.
  • Generate IDs client-side when you need to create records offline.

UUIDs in databases

UUIDs are common in PostgreSQL, MySQL, and NoSQL systems because they avoid single points of failure for ID generation. The tradeoff is index fragmentation, since random UUIDv4 values do not insert sequentially. If write performance is a concern, consider UUIDv7 or ULIDs, which preserve time order while staying unique. Some databases also allow storing UUIDs in binary format to reduce storage and improve index performance.

API design guidance

When designing APIs, UUIDs make great resource identifiers because they are stable and hard to guess. Use them in URLs like /users/550e8400-e29b-41d4-a716-446655440000. Make sure clients validate the format before sending requests to reduce error noise. For idempotency keys, a UUID prevents accidental duplication when retries occur.

Testing and fixtures

For test suites, UUIDs are valuable because they avoid collisions when tests run in parallel. You can generate a batch of UUIDs, insert them into fixture files, and use them consistently across environments. If you need deterministic IDs in tests, consider generating a fixed set and storing them in a test data file so your snapshots stay stable.

Security considerations

UUIDs are identifiers, not secrets. Do not rely on them for access control. If a resource should be protected, validate permissions on the server. If you worry about enumeration, UUIDs are still harder to guess than sequential IDs, but they are not a substitute for authorization.

UUID versions at a glance

UUIDv1 is time-based and includes a node identifier. UUIDv4 is random and the most common for general use. UUIDv5 is namespace-based and deterministic, useful when you want the same input to always map to the same UUID. Choosing the right version depends on your requirements: use v4 for simplicity, v5 for repeatability, and consider newer formats like UUIDv7 or ULIDs if you need chronological ordering.

Formatting tips

UUIDs are typically represented in lowercase with hyphens, but some systems accept uppercase or no hyphens. If you run into validation errors, check the expected format in the API documentation. When storing UUIDs in JSON, treat them as strings to avoid accidental numeric coercion or formatting changes.

Bulk generation

If you need multiple identifiers, generate them in batches and paste them into your fixtures or spreadsheets. This keeps your data consistent and avoids collisions when tests run in parallel across environments.

FAQs

Are UUIDs guaranteed unique? They are not mathematically guaranteed, but the probability of collision is astronomically low for UUIDv4.

Is a UUID the same as a GUID? In practice, yes. GUID is Microsoft’s term for the same standard.

Should I use UUIDs for URLs? Yes, UUIDs make good URL-safe identifiers, but they are long. If shorter URLs are needed, consider a base62 ID.

Can I generate UUIDs offline? Yes. This tool runs locally and does not require a network connection.

Do UUIDs contain personal data? UUIDv4 is random and does not embed timestamps or device information.

How do I validate a UUID? Use a regex or validator in your language, or check format with JSON Validator when it appears in JSON.