UUID Generator Online: Generate v4, v7, and Bulk UUIDs
Everything about UUIDs — what they are, v4 vs v7, when to use each, and how to generate them for free.
What is a UUID?
A UUID (Universally Unique Identifier) is a 128-bit identifier formatted as 32 hex characters in 5 groups:
550e8400-e29b-41d4-a716-446655440000 UUIDs are used as primary keys in databases, session tokens, request IDs, and anywhere you need a globally unique identifier without a central coordinator.
UUID v4 vs UUID v7
| UUID v4 | UUID v7 | |
|---|---|---|
| Generation | Random | Time-ordered + random |
| Sortable | No | Yes (monotonically increasing) |
| Database performance | Worse (random inserts) | Better (sequential inserts) |
| Use case | General purpose | Database primary keys |
| Standard | RFC 4122 | RFC 9562 (2024) |
When to Use UUID v7
UUID v7 is the modern choice for database primary keys. Because it's time-ordered, new rows are always inserted at the end of the index — dramatically better performance than v4's random inserts which cause page splits.
Use v7 for:
- Database primary keys (PostgreSQL, MySQL, SQLite)
- Event IDs and log entries
- Any ID that benefits from chronological ordering
Use v4 for:
- Session tokens (unguessable, non-sequential)
- One-time codes
- Cases where ordering leaks timing information
Generate UUIDs in Different Languages
# JavaScript (browser)
crypto.randomUUID() // v4
# Node.js
const { v4: uuidv4 } = require('uuid');
uuidv4();
# Python
import uuid
str(uuid.uuid4())
# Go
import "github.com/google/uuid"
uuid.New().String()
# PostgreSQL
SELECT gen_random_uuid(); -- v4
SELECT uuid_generate_v4(); -- v4 (requires uuid-ossp) Bulk UUID Generation
Our UUID Generator supports bulk generation — generate 1 to 100 UUIDs at once and copy them all. Useful for seeding databases, generating test data, or creating batch identifiers.
UUID v7 Generator
We also have a dedicated UUID v7 Generator that uses the uuidv7 library to generate properly formatted time-ordered UUIDs. Copy one or generate a batch.
Related Tools