What Is a UUID?
A Universally Unique Identifier (UUID), sometimes called a GUID, is a 128-bit label used to identify resources without a central authority. The canonical string representation is 32 hexadecimal digits split into five groups by hyphens, for example 550e8400-e29b-41d4-a716-446655440000. RFC 9562 (the current standard, superseding RFC 4122) defines eight versions, each with different trade-offs between randomness, time ordering, and collision resistance.
The reason UUIDs are ubiquitous is coordination-free uniqueness. Two machines that have never communicated can mint IDs simultaneously with effectively zero chance of collision. That makes them the default primary key for distributed databases, event sourcing, offline-first apps, and any pipeline where waiting for a central ID server would be a bottleneck.
▶UUID v4 vs v7 — Which Should You Generate?
Version 4 UUIDs are 122 bits of random data plus 6 fixed bits identifying the version and variant. Because modern browsers expose a cryptographically secure RNG via crypto.getRandomValues(), v4 UUIDs are effectively unguessable and collision-free for all practical purposes. Use v4 when you want non-sortable, fully random identifiers — for example, public-facing resource IDs where you do not want anyone to infer creation order.
Version 7 is a newer timestamp-prefixed UUID standardised in RFC 9562 (2024). The first 48 bits are a Timestamp-style Unix millisecond counter, followed by 74 bits of randomness and the required version and variant bits. The result is a globally unique ID that also sorts by creation time — perfect for database indexes, where random v4 UUIDs cause B-tree fragmentation. PostgreSQL, MySQL 8, and SQL Server all recommend v7 for primary keys.
This tool generates both. Pick v7 for database primary keys, event IDs, log correlation, and any workload where insertion locality or temporal sorting matter. Pick v4 for everything else. Version 1 UUIDs (which encode a MAC address) are no longer recommended and are not supported here.
▶When Should You Use UUIDs?
Reach for UUIDs when IDs must be unique across systems you do not control (user IDs shared between a web app and a mobile app, event IDs crossing service boundaries, file IDs in an object store) or when you want to mint IDs offline without a server round-trip. They are also a privacy win: unlike auto-increment integers, UUIDs don't leak how many users or orders you have.
Skip UUIDs when a cheap monotonically-increasing integer will do and you don't need distribution: single-instance apps, internal numeric codes, or high-volume analytics tables where 16 bytes per row matters. If database insert performance is critical and you still need UUIDs, use v7 to get index locality back.
How to Generate a UUID
- 1Pick the version. Choose v4 for random identifiers or v7 for time-ordered IDs that sort by creation time — ideal for database primary keys.
- 2Set the count. Generate a single UUID or up to 1000 at once with the counter.
- 3Select output format. Plain text, quoted strings, a JSON array, or SQL VALUES tuples — the result updates instantly.
- 4Copy the result. Copy a single UUID with the inline button or copy the whole batch. Nothing is sent to any server.
▶Code Examples
▶JavaScript / TypeScript
// Modern browsers and Node.js 19+
const id = crypto.randomUUID();
console.log(id); // '550e8400-e29b-41d4-a716-446655440000'
// Bulk
const ids = Array.from({ length: 10 }, () => crypto.randomUUID());▶Python
import uuid
# v4 (random)
id4 = uuid.uuid4()
print(str(id4))
# v7 — requires uuid6 package (PyPI)
# pip install uuid6
import uuid6
id7 = uuid6.uuid7()▶Go
// Requires github.com/google/uuid
import "github.com/google/uuid"
id, _ := uuid.NewRandom() // v4
fmt.Println(id.String())
// v7 requires uuid v1.6+
id7, _ := uuid.NewV7()▶Bash
# Linux / macOS (util-linux uuidgen)
uuidgen | tr 'A-Z' 'a-z'
# Pure bash via /proc/sys/kernel/random/uuid
cat /proc/sys/kernel/random/uuid▶Frequently Asked Questions
▶What is a UUID?
A UUID (Universally Unique Identifier) is a 128-bit label used to identify resources across distributed systems without a central authority. A standard UUID looks like 550e8400-e29b-41d4-a716-446655440000.
▶What is UUID v4?
UUID v4 generates identifiers using cryptographically secure random numbers. The collision probability is about 1 in 5.3 x 10^36 — virtually impossible.
▶When should I use UUIDs vs auto-increment IDs?
Use UUIDs when you need globally unique IDs without database coordination, such as in distributed systems, microservices, or offline-first apps. Auto-increment IDs are simpler but require a central database.
▶Can I generate UUIDs in bulk?
Yes. Set the quantity you need and click Generate. This tool can create hundreds of UUIDs at once, with one-click copy for the entire batch.