UUID v4, also written UUID4 or UUIDv4, is a random 128-bit identifier. This generator uses the browser’s cryptographic random source. Copy a fresh UUID above, or choose Bulk to create up to 10,000 values for fixtures, imports and test data.
Key takeaways
- Best everyday choice for random identifiers.
- Good fit for APIs, file names, test records and distributed systems.
- Not a password, access token or authorization secret.
For implementation context, continue with UUID v7, Bulk UUIDs, and Collision Risk. These pages cover the closest generator, comparison, validation or storage decisions without repeating this guide.
How to generate a UUID v4 online
The UUID v4 tool creates a new random value after the page loads. Click Copy to use it, or Generate another for a fresh identifier. The initial HTML contains an example; interactive generation replaces it with a new value.
For multiple values, choose Bulk, select UUID v4, enter a count from 1 to 10,000 and generate the list. Download TXT for one UUID per line, CSV for imports, or JSON for a string array. Formatting options include uppercase, no hyphens, braces and URN.
When UUID v4 is the right choice
Use UUID v4 when you need an identifier that can be created independently by many machines without asking a central database for the next number. That makes it comfortable for API objects, background jobs, uploaded files, webhook events and test fixtures.
Version 4 is also a clean choice when you do not want the identifier to expose a timestamp. A customer ID, public resource ID or support ticket reference usually does not need to leak when it was created.
How UUID v4 is shaped
UUID v4 contains 122 random bits. Four bits identify version 4 and two identify the standard variant. The text form has 32 hexadecimal digits and four hyphens, for 36 characters total. The third group starts with 4; the fourth starts with 8, 9, a or b.
xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx
where y is 8, 9, a or b
Example: 4f8b1a9a-7c2d-4a59-9b9f-1c2d2f7e5a01Generate UUID v4 in JavaScript
In a modern browser on HTTPS or localhost, crypto.randomUUID() generates a UUID v4 without a package or a network request. Use the UUID as an opaque identifier and enforce access permissions separately.
const record = { id: crypto.randomUUID(), status: 'pending' };
console.log(record.id);Generate UUID4 in Python
Python’s standard uuid module exposes uuid.uuid4(). Convert the UUID object to a string when writing JSON or text. Generate identifiers in your application rather than making a request to an online generator for every record.
import uuid
record = {"id": str(uuid.uuid4()), "status": "pending"}
print(record["id"])Storage and formatting tips
For most applications, store UUID v4 values in lowercase hyphenated form because it is readable, familiar and supported by many libraries. If your database has a native UUID type, use it instead of plain text. Native UUID columns reduce formatting mistakes and often index more efficiently.
Normalize at the boundary. Accept uppercase, braces or URN input if your users paste them, but store one consistent format inside the application.
Common mistakes with random UUIDs
The biggest mistake is treating a UUID as a secret. A UUID can be hard to guess, but it is still just an identifier. If a URL grants access to private data, the server still needs authorization checks.
The second mistake is ignoring index behavior. Random UUIDs spread inserts across a B-tree index. That may be fine for smaller systems, but high-write tables often benefit from UUID v7 or another ordered identifier.