UUID Generator

Runs in browser

Generate UUIDs in all versions (v1, v3, v4, v5, v7, v8)

Randomly generated UUID (most common)

Generate 1-100 UUIDs at once

How to Use

Select version and copy generated UUIDs.

You will see:

  • UUID Output
  • Bulk Generation
  • Version Options (v1, v4, v7...)
  • One-click Copy
Generated UUIDs (0)

No UUIDs generated yet

Select a version and click Generate

About UUID Generator

UUID (Universally Unique Identifier) is a 128-bit identifier that's guaranteed to be unique across space and time. UUIDs are essential for distributed systems, database primary keys, and any scenario requiring unique identifiers without coordination.

UUID Format

550e8400-e29b-41d4-a716-446655440000

32 hexadecimal digits displayed in 5 groups separated by hyphens: 8-4-4-4-12

Total: 128 bits = 16 bytes = 32 hex characters + 4 hyphens = 36 characters

UUID Versions

Version 1 (Time-based)

Generated from timestamp and MAC address. Unique but reveals creation time and device. Not recommended for security-sensitive uses.

Version 4 (Random)

Generated using random/pseudo-random numbers. Most commonly used. 122 random bits provide 2¹²² possible UUIDs — collision probability is negligible.

Version 5 (Name-based SHA-1)

Generated from a namespace and name using SHA-1 hash. Same input always produces the same UUID. Useful for deterministic ID generation.

Version 7 (Unix Timestamp)

New standard with Unix millisecond timestamp prefix. Sortable by creation time, database-friendly. Recommended for new applications.

Common Use Cases

  • Database Primary Keys: Unique IDs without auto-increment conflicts in distributed databases
  • Session Tokens: Unpredictable identifiers for user sessions
  • File Names: Unique names for uploaded files to prevent conflicts
  • Distributed Systems: IDs that can be generated independently on multiple nodes
  • API Resources: URLs like /users/550e8400-e29b-41d4-a716-446655440000

UUID in Code

JavaScript

// Native (browsers and Node.js 19+)
crypto.randomUUID()

// Using uuid library
import { v4 as uuidv4 } from 'uuid';
uuidv4() // "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"

Python

import uuid

uuid.uuid4()  # Random UUID
uuid.uuid1()  # Time-based UUID

Go

import "github.com/google/uuid"

uuid.New()        // Random UUID
uuid.NewString()  // As string

UUID vs Other Identifiers

Type Pros Cons
Auto-incrementSimple, compactCentralized, predictable
UUID v4Decentralized, secureLarger size, not sortable
UUID v7Sortable, distributedLarger than integers
ULIDSortable, compactLess widely supported

💡 Pro Tips

  • Use UUID v4 for most use cases — it's simple and secure
  • Consider UUID v7 for databases that need sorted inserts
  • Store UUIDs as binary (16 bytes) in databases for efficiency
  • Don't rely on UUID ordering unless using v1 or v7
  • This generator uses cryptographically secure random numbers

Further Reading