UUID Generator Online — Free v1 & v4 GUID Tool
The free UUID Generator creates RFC 4122-compliant unique identifiers in your browser — no server, no signup. Choose UUID v4 for fully random IDs or UUID v1 for timestamp-ordered ones, and bulk-generate up to 100 at once with a single click.
What Is a UUID?
A UUID (Universally Unique Identifier) — also called a GUID (Globally Unique Identifier) by Microsoft — is a 128-bit number used to identify resources uniquely across distributed systems without a central authority. Every UUID is formatted as 32 hexadecimal digits arranged in five groups separated by hyphens:
xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxxThe M digit encodes the version (1 or 4 in common use) and the N digit encodes the variant (always 8, 9, a, or b for RFC 4122 UUIDs). The remaining 122 bits carry the actual unique data — either random bits for v4, or a timestamp plus node identifier for v1.
UUIDs are ubiquitous in software: database primary keys, REST API resource identifiers, file system entries, distributed tracing, session tokens, and anywhere a unique ID needs to be generated without coordination between systems.
How to Use the UUID Generator
- Open the UUID Generator.
- Select UUID v4 (random) or UUID v1 (timestamp-based) using the version toggle.
- Set the count to any number between 1 and 100 to generate multiple UUIDs at once.
- Optionally enable Uppercase to output A–F in capitals instead of lowercase.
- Click Generate — all UUIDs appear in the output area instantly.
- Click Copy All to copy the entire output to your clipboard as newline-separated values.
The tool uses the browser's native crypto.randomUUID() API for v4 generation, which is cryptographically secure and available in all modern browsers and Node.js 15+. No data leaves your browser at any point.
UUID v1 vs UUID v4
The two most commonly used UUID versions serve different purposes. Understanding the difference helps you choose the right one for your use case.
| Property | UUID v1 | UUID v4 |
|---|---|---|
| Generation method | Timestamp + clock sequence + node | 122 bits of cryptographic randomness |
| Time-ordered? | Yes — UUIDs generated later sort later | No — completely random order |
| Privacy | Encodes generation time; node can reveal MAC | No information leaked |
| Collision probability | Near-zero (timestamp + random node) | Near-zero (2¹²² possible values) |
| B-tree index performance | Good — sequential inserts avoid page splits | Poor at high volume — random splits cause fragmentation |
| Best for | Database PKs with high insert rates, logging | API resource IDs, session tokens, general use |
| Sortable by creation time? | Yes | No |
Using UUIDs as Database Primary Keys
Why developers choose UUIDs over auto-increment integers
Auto-incrementing integer IDs are sequential and predictable. Exposing them in URLs (e.g. /api/orders/1042) reveals your record count and enables enumeration attacks — an attacker can simply increment the number to access adjacent records if access control is weak. UUID-based URLs (/api/orders/a1b2c3d4-…) are opaque and provide no information about neighboring records.
UUIDs also work well in distributed systems where multiple application servers or microservices need to generate IDs independently without coordinating with a central database sequence. Each node can generate a UUID locally and insert it without risk of collision.
Index performance: the random UUID problem
The main drawback of UUID v4 as a primary key is B-tree index fragmentation. Relational databases store primary keys in sorted order inside index pages. When you insert a row with a random UUID, it lands somewhere in the middle of an existing index page, which may need to be split. Over millions of rows this causes significant write amplification and wasted page space.
Solutions include:
- UUID v1 — time-ordered, so new inserts append near the end of the index.
- ULID — a newer format that is both sortable and URL-safe, gaining traction as a UUID replacement.
- UUID v7 (RFC 9562) — standardises the time-ordered random UUID approach; supported natively in PostgreSQL 17+.
- PostgreSQL
gen_random_uuid()— generates UUID v4 natively; useuuid_generate_v1mc()from theuuid-osspextension for time-ordered keys.
For most web applications inserting a few hundred rows per second, UUID v4 fragmentation is imperceptible. At tens of thousands of inserts per second, switching to a time-ordered format makes a measurable difference.
Storage format in SQL
| Database | Native UUID type | Compact alternative |
|---|---|---|
| PostgreSQL | UUID (16 bytes) | Native type is already optimal |
| MySQL 8+ | CHAR(36) or UUID type | BINARY(16) saves 20 bytes per row |
| SQLite | No native type — store as TEXT | BLOB (16 bytes) for compactness |
| SQL Server | UNIQUEIDENTIFIER (16 bytes) | Use NEWSEQUENTIALID() for ordered inserts |
Generating UUIDs in Code
JavaScript and Node.js
Modern browsers and Node.js 15+ include a native UUID v4 generator in the Web Crypto API:
// Browser or Node.js 15+
const id = crypto.randomUUID();
// → "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"
// Older Node.js (< 15) — use the 'uuid' package
const { v4: uuidv4, v1: uuidv1 } = require('uuid');
const id = uuidv4();
const orderedId = uuidv1();Python
import uuid
# UUID v4 (random)
id = uuid.uuid4()
print(str(id)) # "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"
# UUID v1 (timestamp)
ordered_id = uuid.uuid1()
print(str(ordered_id))SQL — inserting with a UUID primary key
-- PostgreSQL 13+
INSERT INTO users (id, name, email)
VALUES (gen_random_uuid(), 'Alice', 'alice@example.com');
-- MySQL 8+
INSERT INTO users (id, name, email)
VALUES (UUID(), 'Alice', 'alice@example.com');
-- Pre-generate in application code and pass as parameter
INSERT INTO orders (id, user_id, total)
VALUES ('a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d', ..., 99.99);Advanced Workflows
Bulk generation for test data seeding
Set the count to 100 and click Generate to get 100 UUIDs in one shot. The newline-separated output pastes directly into a SQL seed script as a list of VALUES, or into a JSON fixture file. For a test database seed, you might generate 50 UUIDs for users, 100 for products, and 200 for orders — all without leaving the browser.
Postman and API testing environments
Generate a UUID and paste it into a Postman environment variable as {{resource_id}}. Use it in GET, PUT, and DELETE requests throughout a test collection. Because the ID is unique, your tests are isolated from any pre-existing data in the environment.
Environment variables and config files
UUIDs make good secrets for internal use — app instance identifiers, webhook signing keys, or feature flag namespaces. Generate one, drop it into your .env file, and commit the name (not the value) to source control. Every deployment gets its own unique value.
Idempotency keys for payment APIs
Stripe, Adyen, and other payment processors accept an idempotency key with each API request. If the request is retried due to a network error, the same key ensures the charge is only processed once. Generate a UUID v4 per payment attempt and store it alongside the pending transaction record before making the API call.
Common Questions
Can two UUIDs ever be the same?
UUID v4 has 2¹²² ≈ 5.3 × 10³⁶ possible values. Generating a duplicate by chance requires roughly 2.7 × 10¹⁸ UUIDs — far beyond any practical system. For production databases, add a UNIQUE constraint on the column as a safety net, but random UUID collision is not a realistic concern for any application generating fewer than hundreds of billions of records.
Is UUID the same as GUID?
Yes — GUID is Microsoft's term for the same concept, used in Windows APIs, .NET, and SQL Server. The format is identical; GUIDs are sometimes displayed in uppercase (A1B2C3D4-E5F6-4A7B-8C9D-0E1F2A3B4C5D) but the underlying value is the same. The uppercase toggle in the tool handles this formatting difference.
Are the UUIDs generated here cryptographically secure?
UUID v4 generation uses crypto.randomUUID(), which reads from the browser's cryptographically secure random number generator (CSPRNG) — the same source used for password generation and hash generation. This is appropriate for security-sensitive use cases like session IDs. UUID v1 uses the timestamp plus a random node — still highly unique, but not suitable as a secret because the generation time is recoverable from the value.
What is the difference between UUID and ULID?
ULID (Universally Unique Lexicographically Sortable Identifier) is a newer 128-bit format that encodes the timestamp in the first 10 characters, making ULIDs sort in creation order. Unlike UUID v1, ULIDs are URL-safe (no hyphens, Crockford Base32 encoding) and the timestamp is always in the most-significant bits. ULIDs are gaining adoption as a database-friendly alternative to UUID v4, though they are not yet an IETF standard.
Does this tool store the UUIDs I generate?
No. All generation happens in JavaScript running in your browser tab. No UUID, preference, or count setting is transmitted to any server. You can verify this by opening your browser's Network tab while generating — zero requests are made.
Generate UUIDs Free Online
UUID v4, UUID v1, bulk generation up to 100, uppercase option — all browser-based, no signup.
Open UUID Generator