UUID Generator Online — Free UUID v4 & v7 Generator

Tools 閲覧

What Is a UUID?

A UUID (Universally Unique Identifier) is a 128-bit identifier formatted like this:

550e8400-e29b-41d4-a716-446655440000

It consists of 32 hexadecimal characters separated by hyphens. UUIDs are designed to be unique across space and time without requiring a central authority. The odds of generating a duplicate UUID at random are astronomically low.

Common Uses for UUIDs

  • Database primary keys: Replace auto-increment IDs to avoid conflicts in distributed systems
  • API resource identifiers: Identify users, orders, files, etc. in REST APIs
  • Session tokens: Generate unpredictable session IDs for improved security
  • File naming: Assign unique names to uploaded files to prevent collisions
  • Distributed tracing: Track requests across microservices

UUID v4 vs UUID v7: What's the Difference?

FeatureUUID v4UUID v7
GenerationFully randomTimestamp + random
SortableNoYes (by creation time)
DB performancePoor (random inserts fragment indexes)Good (ordered inserts, less B-tree fragmentation)
Embeds timestampNoYes (creation time extractable)
Best forSimple unique IDsDatabase primary keys needing order

Recommendation: Prefer UUID v7 for new projects — better database write performance. UUID v4 is fine for simple unique identifiers where ordering doesn't matter.

Generate a UUID for Free

Use tool.tl's UUID generator:

  1. Go to tool.tl/uuid-generator
  2. Choose version: v4 (random) or v7 (time-ordered)
  3. Set the quantity for batch generation
  4. Click generate and copy results with one click

Generating UUIDs in Code

# Python
import uuid
print(uuid.uuid4())  # v4

# JavaScript / Node.js
import { v4 as uuidv4, v7 as uuidv7 } from 'uuid';
console.log(uuidv4());
console.log(uuidv7());

# Go
import "github.com/google/uuid"
id := uuid.New()

# SQL (PostgreSQL)
SELECT gen_random_uuid();  -- v4

Frequently Asked Questions

Are UUIDs truly unique?

In practice, yes. The probability of generating a duplicate UUID v4 is roughly 1 in 5.3 × 10³⁶. You'd need to generate billions of UUIDs before a collision becomes statistically plausible.

What's the difference between UUID and GUID?

GUID (Globally Unique Identifier) is Microsoft's implementation of the UUID standard — they're the same thing. The term GUID is used in Windows/SQL Server ecosystems; UUID is used everywhere else.

Is UUID a good database primary key?

UUID v4 causes B-tree index fragmentation due to random ordering, hurting write performance at scale. UUID v7 solves this with time-ordered values — it's the recommended choice for database primary keys today.