UUID Generator
Generate a random UUID v4. Copy to clipboard.
Generate a random UUID v4. A UUID (Universally Unique Identifier) is a 128-bit value that is almost always unique, even when created on different machines or at different times. UUIDs are widely used as primary keys in databases, resource IDs in APIs, and unique identifiers in config files and distributed systems.
This tool creates UUID version 4 values, which are based on random data. Click Generate to create a new UUID, then use Copy result to paste it into your application, database, or configuration. You can generate as many as you need. Each one will be different with extremely high probability.
Loading…
Examples
- Click Generate to get a new UUID v4
- Use Copy result to paste into your app or config
FAQ
What is a UUID?
A UUID (Universally Unique Identifier) is a 128-bit identifier, usually shown as 36 characters with hyphens (e.g. 550e8400-e29b-41d4-a716-446655440000). It is designed to be unique without needing a central authority to assign it.
What is UUID v4?
UUID version 4 is generated from random (or pseudo-random) data. 122 bits are random. The rest encode the version (4) and variant. It is the most common type for APIs, databases, and distributed systems when you need a random unique ID.
When should I use a UUID?
Use UUIDs when you need unique identifiers across systems without coordination: primary keys in databases, API resource IDs, file names, distributed systems, or any case where multiple parties might generate IDs independently.
Are these UUIDs cryptographically secure?
No. This tool uses the browser's Math.random(), which is not suitable for security-sensitive use (e.g. tokens or secrets). For that, use a cryptographically secure generator or generate UUIDs on the server.
What is the difference between UUID versions?
v1: time + MAC address (ordered but leaks machine info). v3: MD5 hash of namespace + name (deterministic). v4: random (most common). v5: SHA-1 hash of namespace + name (deterministic, preferred over v3). v7: Unix timestamp + random (time-ordered, excellent for databases — indexes well).
What is the difference between UUID and GUID?
GUID (Globally Unique Identifier) is Microsoft's name for UUID. GUIDs follow the UUID standard and are formatted identically. The terms are interchangeable; GUID is common in Windows/Microsoft ecosystems, UUID everywhere else.
What is the probability of a UUID collision?
Generating a duplicate UUID v4 is extraordinarily unlikely. After generating 1 billion UUIDs per second for 100 years, the probability of a single collision is about 50%. For practical purposes, UUIDs are unique.
How do I store UUIDs in a database?
Use a native UUID column if your database supports it (PostgreSQL, MySQL 8+, SQL Server). Otherwise use CHAR(36) for the formatted form or BINARY(16) to store the raw bytes and save space. BINARY(16) is about 37% smaller and faster to index.
What is UUID v7 and why is it better for databases?
UUID v7 embeds a Unix timestamp (milliseconds) in the first 48 bits, making UUIDs naturally sortable by creation time. This dramatically improves database index performance compared to random v4 UUIDs, which cause page splits on insertion.
What is the nil UUID?
The nil UUID is all zeros: 00000000-0000-0000-0000-000000000000. It is used as a null or default value in some APIs and protocols, similar to null in databases.
How do I generate UUIDs in different languages?
Python: import uuid; uuid.uuid4(). Node.js: import {randomUUID} from 'crypto'; randomUUID(). Java: UUID.randomUUID(). PostgreSQL: gen_random_uuid(). PHP: Str::uuid() (Laravel) or Ramsey/Uuid library.
How are UUIDs used in REST APIs?
UUIDs are common as resource identifiers in URLs: /users/550e8400-e29b-41d4-a716-446655440000. They allow clients to generate IDs before sending a request (optimistic creation), and they don't expose sequential IDs that reveal how many records exist.