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. Standardized as RFC 4122 (IETF 2005) and later updated by RFC 9562 (2024), the format is 32 hexadecimal digits arranged in five groups separated by hyphens:
xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxxThe M digit encodes the version (1–8) 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.
UUID Versions
| Version | Generation method | Sortable? | Use case |
|---|---|---|---|
| v1 | Timestamp + MAC address + clock sequence | Yes (by creation time) | Database PKs with high write throughput |
| v3 | MD5 hash of name + namespace | No | Deterministic IDs from names (legacy) |
| v4 | 122 bits of cryptographic randomness | No | General use, API IDs, session tokens |
| v5 | SHA-1 hash of name + namespace | No | Deterministic IDs from names (preferred over v3) |
| v7 | Unix millisecond timestamp + random bits | Yes (ms precision) | Database PKs (RFC 9562, PostgreSQL 17+ native) |
| v8 | Custom data in user-defined format | Depends | Vendor-specific extensions |
How to Use the UUID Generator
- Open the UUID Generator
- Select UUID v4 (random) or UUID v1 (timestamp-based)
- Set the count to 1–100 to generate multiple UUIDs at once
- Enable Uppercase to output A–F in capitals (GUID style)
- Click Generate — all UUIDs appear instantly
- Click Copy All to copy newline-separated output to clipboard
UUID v1 vs UUID v4 — Comparison
| 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 creation time; node can reveal MAC address | No information leaked |
| 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 IDs, session tokens, general purpose |
Using UUIDs as Database Primary Keys
Why developers use UUIDs over auto-increment integers
Auto-incrementing integers are sequential — exposing them in URLs (/orders/1042) reveals your record count and enables enumeration attacks. UUID-based URLs (/orders/a1b2c3d4-…) are opaque and carry no information about neighboring records.
UUIDs also enable distributed ID generation: multiple application servers or microservices can generate IDs independently without coordinating with a central database sequence. Each node generates locally and inserts without collision risk.
Index performance and UUID v4 fragmentation
The main drawback of UUID v4 as a primary key is B-tree index fragmentation. Databases store primary keys in sorted order inside index pages. A random UUID lands somewhere in the middle of an existing page, forcing page splits. Over millions of rows this causes significant write amplification.
Solutions:
- UUID v1 — time-ordered; new inserts append near the end of the index
- UUID v7 (RFC 9562) — millisecond-precision timestamp in the high bits; standardized and supported natively in PostgreSQL 17+
- ULID — URL-safe, time-ordered, gaining adoption as a UUID replacement
- SQL Server
NEWSEQUENTIALID()— generates sequential GUIDs to minimize fragmentation
Storage format in SQL databases
| 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 / Node.js
// Browser or Node.js 15+
const id = crypto.randomUUID();
// → "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"
// Older Node.js — use the 'uuid' package
const { v4: uuidv4, v1: uuidv1, v7: uuidv7 } = require('uuid');
const id = uuidv4();
const ordered = uuidv7(); // time-ordered, recommended for DB keysPython
import uuid
# UUID v4 (random)
id = uuid.uuid4()
print(str(id)) # "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"
# UUID v1 (timestamp)
ordered_id = uuid.uuid1()
# UUID v5 (deterministic — SHA-1 hash)
name_based = uuid.uuid5(uuid.NAMESPACE_URL, "https://example.com")Go
import "github.com/google/uuid"
id := uuid.New() // v4
idStr := id.String() // "a1b2c3d4-..."
// v7 (time-ordered, recommended for DB keys)
idV7, err := uuid.NewV7()
fmt.Println(idV7.String())SQL
-- PostgreSQL 13+
INSERT INTO users (id, name) VALUES (gen_random_uuid(), 'Alice');
-- PostgreSQL 17+ (UUID v7, time-ordered)
INSERT INTO users (id, name) VALUES (uuidv7(), 'Alice');
-- MySQL 8+
INSERT INTO users (id, name) VALUES (UUID(), 'Alice');
-- SQL Server
INSERT INTO users (id, name) VALUES (NEWID(), 'Alice');
-- Or sequential: NEWSEQUENTIALID() for better index performanceAdvanced Workflows
Bulk generation for test data
Set the count to 100 and generate 100 UUIDs in one click. The newline-separated output pastes directly into SQL seed scripts or JSON fixtures. For a test database: generate 50 user IDs, 100 product IDs, and 200 order IDs without leaving the browser.
Idempotency keys for payment APIs
Stripe, Adyen, and other payment processors accept an idempotency key with each 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, store it with the pending transaction record, and send it as the Idempotency-Key header.
Deterministic UUIDs with v5
UUID v5 generates the same UUID for the same input every time (SHA-1 hash of a namespace + name). Use this when you need a stable ID derived from a known value:uuid5(NAMESPACE_URL, “https://example.com/products/widget”)always produces the same UUID for that URL, without storing a mapping.
Common Questions
Can two UUIDs ever be the same?
UUID v4 has 2¹²² ≈ 5.3 × 10³⁶ possible values. Generating a duplicate requires roughly 2.7 × 10¹⁸ UUIDs — far beyond any practical system. Add a UNIQUE constraint as a safety net, but collision is not a realistic concern for applications generating fewer than hundreds of billions of records.
Is UUID the same as GUID?
Yes — GUID is Microsoft's term for the same concept. The format is identical; GUIDs are sometimes displayed in uppercase with surrounding braces:{A1B2C3D4-E5F6-4A7B-8C9D-0E1F2A3B4C5D}. The uppercase toggle in the tool handles the formatting difference.
What is the difference between UUID and ULID?
ULID (Universally Unique Lexicographically Sortable Identifier) encodes the timestamp in the first 10 characters using Crockford Base32, making ULIDs sort in creation order and URL-safe (no hyphens). Unlike UUID v1, the timestamp is always in the most-significant bits. ULIDs are gaining adoption as a database-friendly alternative to UUID v4, though UUID v7 (RFC 9562) now provides a standardized time-ordered UUID option.
Generate UUIDs Free Online
UUID v4, v1, bulk up to 100, uppercase GUID style — all browser-based, no signup required.
Open UUID Generator