ToolsleAll tools →
Dev Tools

Uuid generator

Generate v1 and v4 UUIDs instantly. Bulk generate up to 100 UUIDs, validate existing UUIDs, and download results as a text file.

FAQPage Schema
UUID Generator — Free Online Tool
InstantFreeNo signup
UUID version
Format

History

Generated UUIDs will appear here (last 10).

UUID Generator — Generate v1 and v4 UUIDs Instantly

Our free UUID generator creates version 1 and version 4 UUIDs instantly in your browser. Generate a single UUID or bulk generate up to 100 at once. Choose your preferred format — standard, uppercase, no hyphens, or with braces. Copy individual UUIDs, copy all at once, or download them as a text file.

What Is a UUID?

A UUID (Universally Unique Identifier) is a 128-bit identifier standardized by the Open Software Foundation and defined in RFC 4122. It is represented as 32 hexadecimal characters displayed in five groups separated by hyphens, following the pattern 8-4-4-4-12:

Example: 550e8400-e29b-41d4-a716-446655440000

UUIDs are designed to be unique across space and time without requiring a central authority to coordinate assignment. This makes them ideal for distributed systems, databases, and any situation where globally unique identifiers are needed.

UUID Versions Explained

VersionGeneration MethodUse CasePrivacy
v1Timestamp + MAC addressTime-ordered records, loggingLow — reveals host and time
v2Timestamp + MAC + POSIX UIDDCE Security (rare)Low — rarely used
v3MD5 hash of namespace + nameName-based, reproducibleMedium — deterministic
v4Random numbersGeneral purpose, databasesHigh — no identifying info
v5SHA-1 hash of namespace + nameName-based, reproducibleMedium — deterministic

UUID v4 — The Most Common Choice

UUID v4 is the most widely used UUID version because it requires no coordination, contains no identifying information, and is effectively guaranteed to be unique. The format is:

xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx

Where x is any random hexadecimal digit, 4 is the version indicator, and y is one of 8, 9, a, or b (the variant indicator). With 122 bits of randomness, the probability of two v4 UUIDs colliding is so small it is effectively impossible in practice.

UUID Formats

FormatExampleUsed In
Standard (lowercase)550e8400-e29b-41d4-a716-446655440000Most systems, databases
Uppercase550E8400-E29B-41D4-A716-446655440000Windows, some enterprise systems
No hyphens550e8400e29b41d4a716446655440000URLs, compact storage
With braces{550e8400-e29b-41d4-a716-446655440000}Windows registry, COM objects
URN formaturn:uuid:550e8400-e29b-41d4-a716-446655440000XML, URN namespaces

Common Uses for UUIDs in Software Development

Database Primary Keys

UUIDs are widely used as primary keys in relational databases like PostgreSQL, MySQL, and SQL Server. Unlike auto-incrementing integer IDs, UUID primary keys can be generated on the client side before inserting into the database, work across multiple database instances without coordination, and do not expose record counts or creation order to end users.

Distributed Systems

In microservices and distributed architectures, multiple services may create records independently. UUIDs allow each service to generate unique IDs without communicating with a central ID issuer, eliminating a potential bottleneck and single point of failure.

Session and Token Identifiers

UUIDs are used as session IDs, API tokens, request trace IDs, and correlation IDs in web applications. Their randomness makes them difficult to guess, adding a layer of security compared to sequential identifiers.

File and Asset Naming

Uploaded files, generated documents, and media assets are often renamed with UUIDs to prevent filename collisions and avoid exposing original filenames in public-facing URLs.

UUID vs Other ID Formats

ID TypeExampleLengthSortableCollision RiskCommon Use
UUID v4550e8400-e29b-41d4-a716-44665544000036 charsNoNegligibleGeneral purpose
UUID v16ba7b810-9dad-11d1-80b4-00c04fd430c836 charsYes (time-ordered)NegligibleTime-ordered records
ULID01ARZ3NDEKTSV4RRFFQ69G5FAV26 charsYesNegligibleSortable unique IDs
Nano IDV1StGXR8_Z5jdHi6B-myT21 charsNoNegligibleURLs, compact IDs
CUIDcjld2cyuq0000t3rmniod1foy25 charsYesNegligibleClient-side generation
MongoDB ObjectId507f1f77bcf86cd79943901124 charsYesNegligibleMongoDB primary keys
Auto-increment int1, 2, 3...VariableYesNoneSimple single-server DBs

How do I generate a UUID in JavaScript?

Modern browsers and Node.js 15+ support the native crypto.randomUUID() method which generates a v4 UUID. For older environments, you can use a template replace on 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { var r = Math.random() * 16 | 0; return (c === 'x' ? r : (r & 0x3 | 0x8)).toString(16); }) .

How do I generate a UUID in Python?

Python's standard library includes the uuid module. Use import uuid and then uuid.uuid4() to generate a random v4 UUID. The result is a UUID object that can be converted to a string with str(uuid.uuid4()).

How do I generate a UUID in Java?

Java's standard library provides UUID generation through java.util.UUID. Use UUID.randomUUID() to generate a v4 UUID and UUID.randomUUID().toString() to get it as a string.

What happens if two UUIDs collide?

The theoretical probability of generating two identical v4 UUIDs is approximately 1 in 5.3 undecillion (5.3 × 10³⁶). In practice, even generating billions of UUIDs per second for millions of years would not produce a collision. UUID collisions can be treated as practically impossible.

Are UUIDs case sensitive?

UUID comparison is case-insensitive by the RFC 4122 standard — lowercase and uppercase representations of the same UUID are considered equal. However, most systems store and display them in lowercase by convention.

Tips and common mistakes

  • Prefer v4 for public IDs — random UUIDs avoid leaking MAC addresses or timestamps (v1).
  • Use v5 when you need stable IDs — same namespace + name always yields the same UUID.
  • Index-friendly storage — UUID strings as primary keys fragment some databases; consider binary(16) columns.
  • Do not rely on UUIDs for security — they are identifiers, not secrets; use crypto tokens for session keys.

More Q&A lives in the Frequently Asked Questions section below (matches FAQPage structured data).

Guides & resources

  • What Is a UUID? When and Why Developers Use Them

    A UUID (Universally Unique Identifier) is a long string of letters and numbers used to uniquely identify something in a system, such as a user, file, or database record. It is designed to be unique across time and systems, so there is almost no chance of duplication. Developers use UUIDs when they need safe, reliable IDs that do not conflict, especially in distributed systems or databases.

FAQ

Frequently Asked Questions

Use crypto.randomUUID() in modern browsers. For older environments, use a v4 template with random hex digits.

Embed this tool on your site

Free to use on any website. Copy the code below and paste it into your page. A small “Powered by Toolsle” credit appears inside the embed.

↗ Preview embed · Full tool page

<iframe src="https://www.toolsle.com/embed/uuid-generator" width="100%" height="480" style="border:0;max-width:100%;" loading="lazy" title="Uuid generator — Toolsle"></iframe>