UUID v4 Generator - Random UUID Online

Generate cryptographically random UUID v4 identifiers. Create single or multiple UUIDs at once with formatting options.

What Is a UUID?

A UUID (Universally Unique Identifier) is a 128-bit label used to uniquely identify objects in computer systems without requiring a central registry. Version 4 UUIDs are generated using random or pseudo-random numbers, making them the most widely used variant for general-purpose unique IDs.

A UUID v4 looks like this: 550e8400-e29b-41d4-a716-446655440000. The format is 8-4-4-4-12 hexadecimal characters separated by hyphens, totaling 36 characters (32 hex digits + 4 hyphens).

Common Use Cases for UUID v4

UUID v4 vs Other UUID Versions

VersionGeneration MethodBest For
v1Time + MAC addressTime-sortable IDs, audit logs
v3MD5 hash of namespace + nameDeterministic IDs (legacy)
v4Random numbersGeneral-purpose unique IDs
v5SHA-1 hash of namespace + nameDeterministic IDs from known inputs
v7Unix timestamp + randomTime-ordered, DB index friendly

How to Generate UUIDs in Code

JavaScript / Node.js

// Browser or Node.js 19+
const id = crypto.randomUUID();

// Node.js (any version)
import { v4 as uuidv4 } from 'uuid';
const id = uuidv4();

Python

import uuid
id = str(uuid.uuid4())
print(id)  # e.g. 550e8400-e29b-41d4-a716-446655440000

Go

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

Best Practices

Frequently Asked Questions

What is a UUID v4?

UUID v4 is a 128-bit identifier generated using cryptographically secure random numbers. It follows the format xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx. The "4" in the third group signals the version; the first bit(s) of the fourth group are fixed per the RFC 4122 variant specification.

Are UUIDs truly unique?

The probability of a collision between two random UUID v4 values is approximately 1 in 5.3 × 1036. To put that in perspective, you would need to generate about 103 trillion UUIDs to have even a 1-in-a-billion chance of a single collision.

When should I use UUID v4 vs other UUID versions?

Use v4 for most general-purpose IDs. Use v1 if you need time-sortable identifiers that embed a timestamp. Use v5 for deterministic IDs you can reproduce from a namespace + name input. Consider v7 for database primary keys that need good index locality.

Is this UUID generator safe for production use?

Yes. The tool uses crypto.randomUUID() (or crypto.getRandomValues() as a fallback) — the browser's cryptographically secure random number generator. Generation happens entirely in your browser. No UUIDs are transmitted or logged.

Related Generate Tools