UUID Generator
Free UUID v4 generator — create cryptographically-secure random UUIDs one at a time or bulk generate up to 100 at once. Works offline in your browser with copy-all, no tracking, no signup.
How to Generate a UUID
- Enter how many UUIDs you need (1–100).
- Click Generate. Every UUID is produced in your browser using the Web Crypto API's
crypto.randomUUID()— nothing is sent to a server. - Click Copy All to copy the list to your clipboard, or click individual UUIDs to copy a single value.
What Is a UUID?
A UUID (Universally Unique Identifier), also called a GUID in Microsoft contexts, is a 128-bit label used to identify records, sessions, and resources without a central authority. The canonical string form is 36 characters: xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx, where M encodes the UUID version (1, 4, 7, etc.) and N encodes the variant.
UUID Versions Compared
- UUID v1 — Built from a timestamp + MAC address. Predictable, leaks hardware info. Rarely used today.
- UUID v4 — Fully random (122 bits of entropy). The default for most modern apps. Generated by this tool.
- UUID v6 — Rearranged v1 that sorts chronologically. Good for databases but less common.
- UUID v7 — Time-ordered UUID with a millisecond timestamp prefix. Excellent for database primary keys because inserts stay sequential.
If you need sortable IDs for a B-tree index, consider ULID or UUID v7. If you just need "give me a unique value", v4 is the right choice.
UUID v4 in Code
In most modern stacks you don't need a library — the runtime has a built-in:
// JavaScript / TypeScript (browser & Node 19+) const id = crypto.randomUUID(); // Python 3.x import uuid id = str(uuid.uuid4()) // Go import "github.com/google/uuid" id := uuid.NewString() // Rust use uuid::Uuid; let id = Uuid::new_v4().to_string(); // PostgreSQL SELECT gen_random_uuid(); // Swift let id = UUID().uuidString
When to Use a UUID
- Distributed primary keys — when multiple services need to mint IDs without talking to a central database.
- Session and request IDs — trace a request across microservices without collisions.
- Idempotency keys — pass a UUID in API requests so retries don't double-charge a user.
- File and object names — using a UUID as the filename (e.g.
9f1c…d3a2.jpg) avoids naming conflicts in S3, R2, or disk storage. - Invite tokens — v4's 122 bits of entropy make UUIDs unguessable enough for short-lived tokens.
Are UUIDs Really Unique?
UUID v4 has 122 random bits, so you would need to generate roughly 2.71 quintillion (2.71 × 10¹⁸) UUIDs before hitting a 50% chance of a single collision. At 1 billion UUIDs per second, that takes ~85 years. For every practical purpose, v4 UUIDs are unique.
Related Tools
Need unique IDs that are shorter or time-ordered? Generate strong random strings with the password generator, hash values with the hash generator, or encode binary data with the Base64 encoder.
Frequently Asked Questions
What is UUID v4?
UUID v4 (Universally Unique Identifier version 4) is a 128-bit identifier built from 122 random bits. The "4" in position 13 of the string identifies the version. Format: xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx where y is one of 8, 9, a, or b.
Can two UUIDs ever be the same?
Theoretically yes, but practically no. With 122 random bits, you would need to generate about 2.71 quintillion UUIDs to have a 50% chance of a single collision. For all practical purposes, UUID v4 values are unique.
Is this UUID generator cryptographically secure?
Yes. It uses crypto.randomUUID() from the Web Crypto API, which is backed by your operating system's secure random number generator. Every UUID is generated locally in your browser — nothing is logged, sent, or stored on our servers.
Should I use UUIDs as database primary keys?
UUIDs work well as primary keys in distributed systems where sequential IDs are impractical. The trade-off is larger storage (16 bytes vs 4–8 bytes for integers) and slower B-tree locality with random v4. If you want UUIDs and fast inserts, use UUID v7, which is time-ordered.
What is the difference between a UUID and a GUID?
They are the same thing. "GUID" (Globally Unique Identifier) is the name Microsoft uses in Windows, .NET, and SQL Server. "UUID" is the name used by the IETF specification (RFC 4122 / RFC 9562) and everyone else. The binary layout is identical.
Is a UUID secure enough to use as a token?
A UUID v4 has 122 bits of entropy — unguessable for email invites, password reset links, or short-lived tokens. For long-lived bearer tokens, prefer 256-bit random strings or JWTs with proper signing.
How big is a UUID?
128 bits (16 bytes) in binary form, 36 characters when formatted as a hex string with hyphens, or 32 characters without. In PostgreSQL the uuid type stores it as 16 bytes; in MySQL you typically store it as BINARY(16) to avoid the overhead of CHAR(36).