Blog
TechnicalMay 18, 2026

UUID v4 Explained

UUID v4 generates 128-bit identifiers from random numbers. The format is 8-4-4-4-12 hex digits (e.g. f47ac10b-58cc-4372-a567-0e02b2c3d479). Version 4 means random generation — no timestamp or MAC address embedded.

Why Use UUIDs?

UUIDs can be generated independently on any machine without coordination. Ideal for distributed databases, offline-first apps, test data, and trace IDs. Collision probability is negligible even at billions of IDs.

Best Practices

Use UUID v4 for public-facing IDs to avoid enumeration attacks. For database primary keys, consider UUID v7 (time-ordered) for better index performance in some databases.

Generate test UUIDs with WaiHub's UUID Generator — batch mode, uppercase, and braceless formats supported.