UtilVox
Tutorials

What is a UUID and How to Generate One Free Online

U
UtilVox Team
May 22, 20267 min read
What is a UUID and How to Generate One Free Online

What is a UUID and How to Generate One Free Online

Every database, every API, every distributed system eventually faces the same problem: how do you create a unique identifier that will never collide with any other identifier, anywhere, ever — without a central server handing them out?

The answer engineers have relied on for decades is the UUID (Universally Unique Identifier). If you have ever seen a string like 550e8400-e29b-41d4-a716-446655440000 inside a database or API response, that is a UUID.

This guide explains exactly what UUIDs are, the critical differences between v1, v4, and v7, when to use each, and how to generate them instantly using UtilVox UUID Generator — no code, no libraries, no setup required.


What Is a UUID?

A UUID is a 128-bit number displayed as 32 hexadecimal characters split into five groups by hyphens:

xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx
  • The M position indicates the version (1, 4, or 7)
  • The N position indicates the variant
  • Everything else is determined by the version's rules

The full UUID spec is defined in RFC 4122 and the newer RFC 9562 which adds v7. There are approximately 5.3 × 10³⁶ possible UUIDs — a number so large that generating a billion per second for 85 years still gives less than a 50% chance of a single collision.


UUID v1 vs v4 vs v7 — Key Differences

Not all UUIDs are created the same way. Choosing the wrong version creates real problems in production.

FeatureUUID v1UUID v4UUID v7
Based onTime + MAC addressPure randomTime + random
SortableYes (by creation time)NoYes (chronological)
Exposes device infoYes (MAC address)NoNo
Database index efficiencyPoor (non-sequential insert)Poor (random insert)Excellent
When introduced1998 (RFC 4122)1998 (RFC 4122)2024 (RFC 9562)
Recommended for new projectsNoSometimesYes

UUID v1 — Time and MAC Based

UUID v1 encodes the current timestamp (in 100-nanosecond intervals since October 1582) and your machine's MAC address. This makes it sortable but also means it leaks your network card's hardware address — a privacy problem. It is also not sequential in practice because the timestamp bits are reordered in the UUID layout, which hurts database index performance.

Avoid v1 for new applications.

UUID v4 — Pure Random

UUID v4 is 122 bits of cryptographic randomness with 6 fixed version and variant bits. It is the most widely used UUID version today. Every major programming language generates these natively. The downside is that random UUIDs inserted as database primary keys cause severe B-tree index fragmentation at scale — every insert goes to a random position in the index rather than appending to the end.

Use v4 when simplicity matters more than database performance.

UUID v7 — Time-Ordered Random (The Modern Standard)

UUID v7 uses a Unix millisecond timestamp in the most significant bits followed by random data. This means UUIDs sort chronologically and insert into database B-tree indexes in order — the same efficiency as auto-increment integers, but globally unique with no coordination required.

Use v7 for all new projects, especially database primary keys.


How to Generate a UUID Online — Step by Step

You do not need to install Node.js, Python, or any library to generate UUIDs. UtilVox UUID Generator runs entirely in your browser using the Web Crypto API.

Step 1 — Open the tool

Go to utilvox.com/tools/uuid-generator. The tool loads instantly with no login required.

Step 2 — Choose your version

Select v4 for general use or v7 if you are generating primary keys for a database. v1 is available for legacy compatibility.

Step 3 — Set the quantity

Enter how many UUIDs you need — from 1 to hundreds. This is useful for database seeding, generating test data, or pre-generating IDs for a batch of records.

Step 4 — Copy and use

Click Generate and then Copy All to copy every UUID to your clipboard at once. Paste directly into your SQL seed script, config file, or API payload.

Security note: All UUIDs are generated using crypto.getRandomValues() — the browser's cryptographically secure random number generator. They are safe to use as database keys, session tokens, and API identifiers.


When Should You Actually Use a UUID?

UUIDs shine in specific situations and are overkill in others.

Use UUIDs when:

  • Building a distributed system — Multiple servers or services need to create records simultaneously without a central ID coordinator. Auto-increment integers require a single database sequence; UUIDs do not.
  • Exposing IDs in URLs or APIs — Auto-increment IDs leak business information (your 1,000th customer has ID 1000). UUIDs reveal nothing.
  • Merging data from multiple sources — Importing records from two databases with integer primary keys creates collisions. UUIDs never collide.
  • Generating IDs on the client before the server confirms — Mobile apps and SPAs often need to create a record locally and sync later. A UUID generated on the client is guaranteed unique when it reaches the server.

Stick with auto-increment integers when:

  • You have a simple, single-database application with no scaling concerns
  • The table will grow to billions of rows and you need maximum index efficiency (though UUID v7 largely solves this)
  • The ID will never be exposed externally

UUID in Practice — Code Examples

Even though UtilVox UUID Generator handles the generation for you, here is how UUID v4 works across common languages for reference:

JavaScript / Node.js

// Built into Node 14.17+ and all modern browsers
const id = crypto.randomUUID(); // UUID v4

Python

import uuid
id = str(uuid.uuid4())  # UUID v4

PostgreSQL

-- Built-in function
SELECT gen_random_uuid(); -- UUID v4

PHP

// Laravel helper
$id = Str::uuid(); // UUID v4

Common Questions About UUIDs

Are two UUIDs ever the same?

In theory, yes — any random system can produce the same value twice. In practice, the probability is so vanishingly small that UUID v4 collisions are treated as impossible for all real-world applications. You are far more likely to be struck by lightning twice.

Can I use a UUID as a URL slug?

Technically yes, but it is ugly and hard to type. Use a UUID as the internal database primary key and a readable slug (generated from the title) as the public-facing URL identifier. UtilVox Slug Generator can help with that.

What is the difference between a UUID and a GUID?

Nothing. GUID (Globally Unique Identifier) is Microsoft's term for the same concept. A GUID and a UUID are identical — the names are interchangeable.

Is UUID v7 widely supported?

UUID v7 was standardised in RFC 9562 in 2024. Library support is growing rapidly — the uuid npm package (v10+), Python's uuid-utils, and PostgreSQL via the pg_uuidv7 extension all support it. For new projects, the library support is sufficient to use v7 today.


Summary

UUIDs are one of the most useful tools in any developer's toolkit — once you understand the difference between versions, the choice is straightforward: use v7 for database primary keys, v4 for everything else, and avoid v1 entirely in new code.

Generate UUIDs instantly with UtilVox — choose v1, v4, or v7, generate in bulk, and copy with one click. No account, no installation, works in any browser.

#uuid#uuid generator#guid#unique id#developer tools

You might also like