UtilityKit

500+ fast, free tools. Most run in your browser only; Image & PDF tools upload files to the backend when you run them.

UUID Generator

Generate random UUIDs v4

About UUID Generator

Universally Unique Identifiers are the backbone of distributed systems, databases, and APIs. Whether you are assigning primary keys to database rows, creating idempotency tokens for payment requests, naming S3 objects, or tracking analytics sessions, you need IDs that are unique across machines and time without requiring a central coordinator. UUID Generator lets you produce version 1 (time-based), version 4 (random), and version 5 (namespace + SHA-1 hash) identifiers directly in your browser. Format output as lowercase with hyphens for standard RFC 4122 compliance, strip hyphens for compact database storage, or switch to uppercase for legacy systems that require it. Bulk mode generates up to 100 UUIDs in one click so you can seed test databases or populate fixture files without scripting.

Why use UUID Generator

Three UUID Versions Supported

Generate v1 time-ordered, v4 cryptographically random, or v5 deterministic namespace-hashed UUIDs from a single tool without switching tabs.

Cryptographically Secure v4

Version 4 UUIDs are generated using the browser's Web Crypto API (crypto.getRandomValues), ensuring statistical uniqueness across distributed systems.

Bulk Generation Up to 100

Produce up to 100 UUIDs in one operation to seed test fixtures, populate database migration files, or batch-create identifiers for API testing.

Flexible Format Options

Strip hyphens for compact storage in MySQL CHAR(32) columns, or keep them for standard RFC 4122 format expected by most frameworks and ORMs.

Deterministic v5 UUIDs

Version 5 hashes a namespace UUID with a name string using SHA-1, so the same input always produces the same UUID — ideal for idempotent resource creation.

Fully Client-Side

All UUID generation runs in your browser using the Web Crypto API — no server round-trip means no latency, no logging, and no rate limits.

How to use UUID Generator

  1. Select the UUID version you need: v1 (time-based node+clock), v4 (random), or v5 (namespace + name hash).
  2. For v5, enter a namespace UUID and a name string — the same inputs always produce the same output UUID deterministically.
  3. Choose your format: with hyphens (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx) or without (32 hex characters compact).
  4. Toggle uppercase or lowercase hex output depending on your system's requirements.
  5. Set the quantity between 1 and 100 for bulk generation, then click Generate.
  6. Click Copy All to copy every generated UUID to your clipboard, or click the individual copy icon next to any single UUID.

When to use UUID Generator

  • When assigning primary keys to new database records before inserting them, avoiding a round-trip to fetch an auto-increment ID.
  • When building a REST API and needing unique idempotency keys for POST requests to prevent duplicate operations on retry.
  • When naming files or objects in cloud storage (S3, GCS) to avoid collisions without a central naming registry.
  • When seeding development or test databases with a batch of unique identifiers to populate fixture data.
  • When creating deterministic resource IDs from human-readable names using v5 so the same name always maps to the same UUID.
  • When prototyping a distributed system locally and needing valid UUID-format strings to paste into config files or environment variables.

Examples

v4 random UUID (standard format)

Input: Version: v4 | Format: with hyphens | Case: lowercase | Quantity: 1

Output: f47ac10b-58cc-4372-a567-0e02b2c3d479

v4 compact for MySQL CHAR(32) column

Input: Version: v4 | Format: no hyphens | Case: uppercase | Quantity: 1

Output: F47AC10B58CC4372A5670E02B2C3D479

Bulk v4 for test fixture seeding

Input: Version: v4 | Format: with hyphens | Case: lowercase | Quantity: 5

Output: 3d6f4e1a-9b2c-4a0d-8e7f-1c5b6a3d2e4f a1b2c3d4-e5f6-4789-abcd-ef0123456789 7c8d9e0f-1a2b-4c3d-5e6f-7a8b9c0d1e2f 4f5e6d7c-8b9a-4012-b3c4-d5e6f7a8b9c0 2a3b4c5d-6e7f-4801-9234-56789abcdef0

Tips

  • Use v4 for nearly all use cases — it requires no configuration and its 122 bits of randomness make collisions astronomically unlikely in any real-world system.
  • When inserting bulk UUIDs into a SQL migration file, generate the exact count you need here, copy all, then paste into your VALUES list with a single operation.
  • For v5 deterministic IDs, document your chosen namespace UUID in your project's README or constants file — losing it means you cannot regenerate the same UUIDs for existing names.
  • Uppercase UUIDs are functionally identical to lowercase; most modern databases and APIs are case-insensitive for UUID comparison, but adopt a consistent case convention across your codebase.
  • To test UUID-based routing in your app (e.g. /users/:id), generate a few v4 UUIDs here and paste them directly into your browser address bar or Postman without writing any generation code.

Frequently Asked Questions

What is the difference between UUID v1, v4, and v5?
v1 is time-based and encodes the current timestamp plus a MAC address, so it is sortable by creation time but leaks machine identity. v4 is fully random (122 random bits), making it the safest choice for most use cases. v5 hashes a namespace UUID together with a name string using SHA-1, always producing the same UUID for the same inputs — useful for deterministic ID generation.
Are the generated UUIDs truly unique?
v4 UUIDs have 122 bits of randomness. The probability of a collision between two randomly generated v4 UUIDs is approximately 1 in 5.3 × 10^36 — effectively zero for any practical application. v1 uniqueness relies on clock precision and node identity; v5 uniqueness is guaranteed for different name inputs within the same namespace.
Should I store UUIDs with or without hyphens in my database?
Both are valid. PostgreSQL's native UUID type stores them without hyphens internally and accepts either format. MySQL and MariaDB users often store UUIDs as CHAR(36) with hyphens or CHAR(32) without to save 4 bytes per row. Whichever you choose, apply it consistently across your schema.
What namespace should I use for v5 UUIDs?
RFC 4122 defines four standard namespaces: DNS (6ba7b810-...), URL (6ba7b811-...), OID (6ba7b812-...), and X.500 (6ba7b814-...). Use the DNS namespace when hashing domain-based names, the URL namespace for URL paths, or generate a custom namespace UUID once and reuse it as the private namespace for your application.
Can I use UUID as a primary key in PostgreSQL?
Yes. PostgreSQL has a native UUID data type that stores the 128-bit value in 16 bytes (more efficient than VARCHAR(36)). Use gen_random_uuid() for server-side generation or supply client-generated v4 UUIDs. Be aware that random v4 UUIDs cause index fragmentation on B-tree indexes at high insert rates — consider UUIDv7 (sequential) for write-heavy tables.
Is UUID v4 safe to use as a public-facing identifier in URLs?
Yes. v4 UUIDs are statistically unguessable with 122 bits of entropy, making them safe for URLs that should not be enumerable. They are used by services like Stripe, Twilio, and GitHub for resource IDs in public APIs precisely because they cannot be guessed or iterated.
What is the performance impact of UUID primary keys vs. auto-increment integers?
Auto-increment integers are more cache-friendly because sequential values fill B-tree index pages linearly. Random v4 UUIDs cause page splits and fragmentation over time. For most applications the difference is negligible; for tables with millions of rows and high write throughput, consider sequential UUID formats (v1 or UUIDv7) or use UUIDs only as alternate keys alongside an integer primary key.
How do I generate UUIDs in code without a browser tool?
In Node.js 14.17+, use crypto.randomUUID() from the built-in crypto module. In older Node or browsers, the 'uuid' npm package provides v1/v3/v4/v5 with the same RFC 4122 compliance. In Python, use the standard library uuid module: import uuid; str(uuid.uuid4()).

Explore the category

Glossary

UUID (Universally Unique Identifier)
A 128-bit label used to identify information in computer systems. Standardized by RFC 4122, it is represented as 32 hexadecimal digits in the format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.
RFC 4122
The IETF standard defining the UUID format and generation algorithms for versions 1 through 5. It specifies bit layout, variant field, and version field positions within the 128-bit structure.
GUID (Globally Unique Identifier)
Microsoft's term for UUID, used throughout the Windows API, COM, and .NET ecosystems. GUIDs are structurally identical to RFC 4122 UUIDs.
Namespace UUID
A fixed UUID used as a seed for v3 and v5 generation. The namespace scopes the name, so the same name in different namespaces produces different output UUIDs.
Entropy
A measure of randomness in a generated value. UUID v4 has 122 bits of entropy (6 bits are fixed for version/variant), making each UUID statistically unique without central coordination.
Web Crypto API
A browser-native JavaScript API (window.crypto) that provides cryptographically secure random number generation via crypto.getRandomValues(), used to generate UUID v4 in client-side tools.