Irreva logo
Explore Irreva
DeveloperMarch 7, 2026· 5 min read· Updated June 10, 2026

How to Generate a UUID Online Free

Hasanur Rahman

Written by Hasanur Rahman

Founder & Full-Stack Developer · Irreva · Rangpur, Bangladesh

UUIDs — Universally Unique Identifiers — are 128-bit values formatted as a string of hexadecimal digits like 550e8400-e29b-41d4-a716-446655440000. They're used as unique identifiers for database rows, API resources, session tokens, and message IDs in distributed systems. The appeal is that they can be generated independently by different systems without coordination and still be unique. Here's everything you need to know.

UUID versions — which one should you use

UUIDs come in several versions, each generated differently. Version 1 is based on the current timestamp and MAC address. This guarantees uniqueness but leaks the generating machine's MAC address, which is a privacy concern. Version 4 is randomly generated using a cryptographically secure random number generator. It's the most commonly used version for general-purpose identifiers.

Version 5 generates a deterministic UUID by hashing a namespace UUID and a name using SHA1. The same namespace and name always produce the same UUID, which is useful for generating consistent IDs from known input. Version 7 (a newer addition) is time-ordered, which improves database index performance — sequential UUIDs reduce B-tree fragmentation compared to random UUIDs.

For most applications — assigning IDs to new records, generating tokens, or identifying resources — UUID v4 is the right choice. If database insert performance at scale is a concern, consider UUID v7.

  • UUID v1: timestamp + MAC address — unique but leaks device info
  • UUID v4: cryptographically random — the standard choice
  • UUID v5: deterministic hash from namespace + name
  • UUID v7: time-ordered random — better for database indexes

What a UUID looks like

A UUID is written as five groups of hexadecimal digits separated by hyphens: 8-4-4-4-12 characters. For example: 6ba7b810-9dad-11d1-80b4-00c04fd430c8. The total is 32 hex characters = 128 bits.

In databases, UUIDs can be stored as a 36-character string or as a 16-byte binary value (more efficient). PostgreSQL has a native uuid type. MySQL/MariaDB store them as CHAR(36) or BINARY(16). Most ORMs handle this transparently.

UUIDs are case-insensitive — lowercase and uppercase hex characters are equivalent. By convention, UUIDs are usually written in lowercase.

Generating UUIDs in code and online

The Irreva UUID Generator creates v4 UUIDs using the browser's crypto.randomUUID() API, which is part of the Web Crypto API and uses a cryptographically secure random source. You can generate one at a time or in bulk.

In JavaScript/Node.js: crypto.randomUUID() (built-in Node 14.17+) or the uuid npm package. In Python: import uuid; str(uuid.uuid4()). In Java: UUID.randomUUID().toString(). In Go: google/uuid or github.com/gofrs/uuid.

For testing and development, having a handful of pre-generated UUIDs is useful for hardcoding in fixtures, seeds, and test cases. The bulk generator on Irreva lets you generate dozens at once.

Frequently Asked Questions

Can two UUIDs ever be the same?

Theoretically yes, but the probability is negligible. A UUID v4 is 122 random bits, giving about 5.3×10^36 possible values. The birthday problem probability of a collision in a billion UUIDs is roughly 6×10^-10 — effectively impossible in any realistic system.

Should I use UUIDs or sequential integer IDs?

Sequential integers are simpler, smaller, and faster for database lookups. UUIDs are better when you need IDs generated without a database (client-side, distributed systems), when you don't want to expose the number of records, or when merging data from multiple sources. Many systems use integers internally and UUIDs in public APIs.

Why do some UUIDs have specific characters at fixed positions?

UUID v4 has '4' at position 13 (the version indicator) and one of 8, 9, a, or b at position 17 (the variant indicator). These are required by the UUID standard. All other characters are random.

Is a UUID safe to use as a URL slug?

Yes. UUID characters (hex digits and hyphens) are all URL-safe. A URL like /resources/6ba7b810-9dad-11d1-80b4-00c04fd430c8 is valid. However, UUIDs are not human-readable, so for user-facing URLs a slug like /blog/my-post-title is better for SEO and usability.

What is a GUID?

GUID stands for Globally Unique Identifier and is essentially the same thing as a UUID. The term GUID is used primarily in Microsoft technologies (.NET, Windows). GUID v4 is identical to UUID v4.

Hasanur Rahman

About the author

Hasanur Rahman

Founder & Full-Stack Developer · Irreva · Rangpur, Bangladesh

Hasanur Rahman is the founder of Irreva and a full-stack developer based in Rangpur, Bangladesh. He builds all of Irreva's tools with a focus on privacy-first, browser-based processing.