devBylund.com

UUID Generator

Generate universally unique identifiers (UUIDs) in multiple formats

UUIDs are 128-bit identifiers used to uniquely identify information in computer systems. Generate version 1 (timestamp), version 4 (random), or version 5 (name-based) UUIDs.

Configuration
Choose UUID version and generation settings
Cryptographically Random
128-bit
RFC 4122
Generated UUIDs
0 V4 UUIDs generated
UUID Versions Explained

Version 1 (Timestamp-based)

Generated using timestamp and MAC address. Contains temporal information but may reveal the machine identity. Good for sorting by creation time.

Version 4 (Random)

Generated using cryptographically strong random numbers. Most commonly used as it provides good uniqueness without revealing information about the generator.

Version 5 (Name-based SHA-1)

Generated from a namespace UUID and a name using SHA-1 hash. Deterministic - same namespace and name always produce the same UUID.

Usage Examples

JavaScript

// Modern browsers (Version 4)
const uuid = crypto.randomUUID();
console.log(uuid); // e.g., "f47ac10b-58cc-4372-a567-0e02b2c3d479"

// Using in database
const user = {
  id: crypto.randomUUID(),
  name: "John Doe",
  created_at: new Date()
};

// React component key
{items.map(item => (
  <div key={crypto.randomUUID()}>{item.name}</div>
))}

Database Usage

-- PostgreSQL
CREATE TABLE users (
  id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  email VARCHAR(255) UNIQUE NOT NULL
);

-- MySQL
CREATE TABLE users (
  id CHAR(36) PRIMARY KEY,
  email VARCHAR(255) UNIQUE NOT NULL
);