Free Online GUID / UUID Generator

Generate UUID v4, v7, ULID or NanoID. Custom formatting, Base64, bulk up to 1,000. Secure random, no signup, instant.

Format:
Encoding:
    

Fast, reliable, and built for developers. We don't store the UUIDs you generate.

new Bug fixed: wasn't generating GUIDs Sunday afternoon for ~15 minutes. Sorry.
Click "Generate" for a UUID tip or fun fact.


Understanding UUIDs and GUIDs

What Is a UUID?

A UUID (Universally Unique Identifier) is a 128-bit identifier used in software development, database management, APIs, distributed systems, and microservices to uniquely identify records, objects, and resources. A UUID is normally represented as 32 hexadecimal characters separated into five groups, such as 550e8400-e29b-41d4-a716-446655440000. Unlike auto-incrementing integers, UUIDs can safely be generated independently, without contacting a central database for the next available ID.

UUID vs. GUID: What is the Difference?

UUID (Universally Unique Identifier) and GUID (Globally Unique Identifier) generally refer to the same 128-bit identifier. GUID is the terminology historically associated with Microsoft technologies, while UUID is the terminology used by modern standards. In .NET, the System.Guid type represents a UUID-compatible identifier. For practical purposes, UUID and GUID are interchangeable terms.

How Unique Is a UUID?

UUIDs are not mathematically guaranteed to be unique. They are designed to make accidental collisions extremely unlikely.

A UUID version 4 (v4) reserves 6 bits for the version and variant, leaving 122 random bits. This provides approximately 5.3 × 10^36 possible random values.

The probability of a collision increases as more UUIDs are generated, but the available space makes accidental UUID v4 collisions extraordinarily unlikely for normal applications.

The quality of the random number generator matters. UUIDs should be generated using an appropriate random or cryptographically secure random source.

UUID Versions

UUID versions define different ways of generating and structuring UUIDs. A newer version is not automatically better; each version has a different purpose.

Version Description
UUID version 1 (v1) Timestamp and node-based
UUID version 3 (v3) Name-based, MD5 - deterministic
UUID version 4 (v4) Random - 122 random bits
UUID version 5 (v5) Name-based, SHA-1 - deterministic
UUID version 6 (v6) Reordered timestamp-based - sortable
UUID version 7 (v7) Timestamp and random data - time-ordered, sortable
UUID version 8 (v8) Application-defined - custom format

For most new applications, UUID v4 and UUID v7 are the versions developers are most likely to consider.

UUID v3 and v5 are useful when deterministic UUIDs are required. UUID v6 provides a reordered timestamp-based format, while UUID v8 provides space for application-defined UUID layouts.

UUID v4: The Most Common UUID

UUID version 4 (v4) is the most common choice for generating random UUIDs.

UUID v4 contains 122 random bits, with the remaining bits identifying the UUID version and variant.

UUID v4 is a good general-purpose choice when an application needs a unique identifier without a timestamp or ordering requirement. It is commonly used for database records, API resources, users, orders, transactions, files, test data, and distributed applications.

If you simply need a random UUID, UUID v4 is usually the best starting point.

UUID v7: A Modern UUID Standard

UUID version 7 (v7) is a modern UUID format defined by RFC 9562. It combines a Unix timestamp with random data.

Unlike UUID v4, UUID v7 values are generally sortable by creation time. This makes UUID v7 useful when an application wants independently generated UUIDs while also benefiting from chronological ordering.

UUID v7 is particularly useful for database primary keys, indexed values, event IDs, logs, and other applications where chronological ordering is useful.

Because the timestamp is part of a UUID v7, it can reveal the approximate time an identifier was generated.

UUID v4 vs UUID v7

UUID v4 UUID v7
Primary characteristic Random Time-ordered, sortable
Random data 122 bits 74+ random bits + timestamp
Timestamp No Yes - Unix millisecond
Creation-time ordering No Yes - chronological
Best use General-purpose IDs Time-ordered IDs, database keys

Choose UUID v4 when you primarily need a random identifier.

Choose UUID v7 when chronological ordering is useful, particularly for database keys, indexed values, event IDs, and other applications where creation-time ordering matters.

UUID v4 remains the most common choice. UUID v7 is a modern option when time ordering is important.

Common UUID Uses

UUIDs are commonly used as database keys and application identifiers for users, customers, orders, transactions, files, and documents. They are also useful for event IDs, request IDs, job IDs, and correlation IDs, particularly in applications where identifiers are generated across multiple services or systems.

UUIDs in Databases

UUIDs are widely used as database primary keys and foreign keys because an application can generate an identifier before inserting a record. This is particularly useful when multiple servers, services, or applications create records independently.

UUIDs are supported by major database systems including PostgreSQL, MySQL, MariaDB, Microsoft SQL Server, Oracle Database, and SQLite. PostgreSQL provides a native uuid data type, while Microsoft SQL Server provides uniqueidentifier.

UUIDs require more storage than typical integer keys and can produce larger indexes. Random UUID v4 values also have no natural ordering, which can affect index insertion behavior on large tables. UUID v7 provides chronological ordering that can be useful for indexed data.

Whether a UUID or integer is the better database key depends on the database engine, schema, indexes, workload, and application architecture.

Who This Site Is For

Built primarily for software developers and IT professionals who need to generate, validate, or understand UUIDs and GUIDs. Whether you need a UUID for a SQL query, database record, API request, test data, application code, or debugging, our tools provide a quick way to work with UUIDs and GUIDs.

UUID and GUID Resources for Developers

GUIDs and UUIDs are fundamental building blocks in modern software development and database management. They provide a practical way to create identifiers that can be generated independently across applications, databases, servers, and services. Our tools let you generate, validate, and decode UUIDs, while our content covers practical topics for developers and database professionals. The site includes dozens of articles and guides, including our UUID Versions Guide, UUIDs in Databases resources, and Engineering Blog, covering UUID standards, database design, software development, and related engineering topics. Whether you need to generate a GUID for a database record, test an application, write a SQL query, or understand how UUIDs work, our tools and resources are here to help.

Frequently Asked Questions

What is the difference between a UUID and a GUID?

UUID (Universally Unique Identifier) and GUID (Globally Unique Identifier) refer to the same 128-bit identifier. GUID is the term historically used by Microsoft, while UUID is the modern standards term defined in RFC 9562. In practice, UUID and GUID are interchangeable. In .NET, the System.Guid type stores a UUID.

What is UUID v4 vs UUID v7?

UUID v4 is random with 122 random bits and no timestamp - best for general-purpose random IDs. UUID v7 is time-ordered with a 48-bit Unix timestamp in milliseconds plus 74+ random bits - best for database primary keys and sortable IDs. Use v4 when you need unpredictability, v7 when you need chronological sorting.

Is UUID v7 sortable?

Yes. UUID v7 is sortable by creation time. The first 48 bits contain a Unix timestamp, so newer UUIDs sort after older ones. This makes v7 ideal for database indexes, as it avoids the random insertion performance issue of UUID v4.

Are UUIDs guaranteed to be unique?

No, UUIDs are not mathematically guaranteed unique, but collisions are extremely unlikely. UUID v4 has 5.3 x 10^36 possible values. With a cryptographically secure random generator, the chance of a duplicate is negligible for normal applications. Use a secure generator, not Math.random().

Which UUID version should I use for database primary keys?

For new applications, use UUID v7 for primary keys if your database supports it. Its time-ordered nature improves index locality and insert performance compared to random v4. Use UUID v4 if you need maximum compatibility or don't need ordering. Avoid v1 due to privacy concerns with MAC addresses.

Is a GUID the same as UUID v4?

Often, but not always. When people say GUID they usually mean a random UUID v4. However, GUID is a generic term - a GUID could be any UUID version. On this site, GUID Generator creates UUID v4 by default, with options for v7, ULID, and NanoID.

More Information About UUID Versions

For a more detailed comparison of UUID versions, visit our Complete Guide to UUID Versions.

More Information About Standards

Globally Unique Identifier - Wikipedia, the free encyclopedia
GUID Structure - Microsoft.com
RFC 9562 (2024)
RFC 4122 (2005)