Computer ScienceMay 30, 20262 min read

UUID Generator: Free Instant UUID v4 Random Identifier

O
OIYO EditorialContributor

UUID Generator

A UUID (Universally Unique Identifier) is a 128-bit (32 hex character) standard format used in software to generate identifiers that are globally unique without requiring a central coordinator.


UUID Generator

UUID v4 (Random)

Count


UUID Version Comparison

VersionGeneration MethodBest For
v1Timestamp + MAC addressWhen sequential ordering is needed
v3MD5 hash (namespace-based)URL-derived unique IDs
v4Fully randomGeneral use (most widely used)
v5SHA-1 hash (namespace-based)More secure alternative to v3

UUID v4 format: xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx (4: version indicator; y: one of 8, 9, a, b).
Collision probability: generating 1 billion UUIDs gives a collision chance of roughly 1 in a billion.

Code Examples

// JavaScript (modern browser)
crypto.randomUUID()

// Node.js with uuid library
import { v4 as uuidv4 } from 'uuid';
uuidv4(); // '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d'
# Python
import uuid
str(uuid.uuid4())  # '110e8400-e29b-41d4-a716-446655440000'
-- PostgreSQL
SELECT gen_random_uuid();

UUID vs. ULID vs. NanoID

FormatLengthSortableReadabilityRecommended When
UUID v436 charsAverageGeneral purpose
ULID26 charsGoodDB primary keys, sort needed
NanoID21 charsGoodURLs, short IDs
O

OIYO Editorial

Editorial Desk

The OIYO editorial desk researches money, law, lifestyle, and self-understanding topics against primary sources and public statistics. Every piece carries source notes and is reviewed on a regular cycle for accuracy and usefulness.