UUID Generator

Generate RFC 4122 UUIDs instantly — v1 (time-based) or v4 (random).

Ad · 728×90
Version:
Count:
Click Generate to create UUIDs
Ad · Responsive

What is a UUID?

A UUID (Universally Unique Identifier), also called a GUID (Globally Unique Identifier), is a 128-bit label used to uniquely identify objects in computer systems. Defined in RFC 4122, UUIDs are formatted as 32 hexadecimal digits in five groups separated by hyphens: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.

They are used as primary keys in databases, session identifiers, file names, and anywhere a unique label is needed without a centralised authority assigning them. The probability of generating two identical v4 UUIDs is astronomically small — roughly 1 in 2¹²².


v1 vs v4 — Which to Use?

v4 (random) is the most common choice. It uses 122 bits of cryptographically random data and has no relationship to the generating machine or time. Use v4 when you want complete randomness and privacy — it reveals nothing about when or where it was generated.

v1 (time-based) encodes the current timestamp and a node identifier (in this browser implementation, a random node ID is used instead of a MAC address for privacy). v1 UUIDs are monotonically increasing, which can benefit database index performance. Use v1 when sortability matters.


Frequently Asked Questions

In practice, yes. A v4 UUID uses 122 random bits, giving 2¹²² possible values — about 5.3 × 10³⁶. If you generated one billion UUIDs per second, it would take roughly 85 years before the probability of a collision reached 50%. For virtually all real-world applications, UUID collisions are not a concern. The standard allows calling them "unique" without any coordination.

Nothing meaningful. GUID (Globally Unique Identifier) is Microsoft's term for the same concept. They use the same format and are interchangeable in practice. Microsoft's GUIDs are typically displayed in uppercase and wrapped in braces: {3F2504E0-4F89-41D3-9A0C-0305E82C3301}. This tool lets you generate both formats using the uppercase and format toggles.

It depends on your database and use case. UUIDs as primary keys have advantages: they can be generated client-side without a round-trip to the database, they don't expose record counts, and they work well in distributed systems. The downsides are storage size (16 bytes vs 4–8 for integers) and potential index fragmentation with random v4 UUIDs in MySQL InnoDB. For PostgreSQL, UUID primary keys perform well. For MySQL, consider UUID v7 (ordered) or ULID as alternatives if index performance is critical.

Related Tools

Ad · Responsive