Skip to main content

Go Premium

No ads • Priority support • Export to PDF

100% Private

UUID Generator

UUID Validator

About UUID Versions

UUID v1

Based on timestamp and MAC address. Can reveal creation time but may expose device info.

UUID v4

Purely random. Most widely used. No embedded information, highly secure.

UUID v7

New standard (RFC 9562). Unix timestamp + random. Sortable and time-extractable.

UUID/GUID Generator - Create Unique Identifiers

Generate universally unique identifiers (UUIDs) also known as GUIDs (Globally Unique Identifiers). Our free UUID generator creates version 1 (timestamp-based) and version 4 (random) UUIDs that are guaranteed to be unique across all systems.

What is a UUID?

A UUID (Universally Unique Identifier) is a 128-bit number used to uniquely identify information. UUIDs are standardized by RFC 4122 and are designed to be unique without requiring a central registration authority. The format is: xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx (where M is the version and N is the variant).

UUID Versions

  • Version 1 (Time-based): Generated from the current timestamp and MAC address. Guarantees uniqueness and provides chronological ordering, but may expose the device's MAC address. Best for distributed systems needing sortable IDs.
  • Version 4 (Random): Generated using random or pseudo-random numbers. Provides excellent privacy as it contains no identifying information about the system or time. Most commonly used version. 122 random bits ensure uniqueness with negligible collision probability.

Common Uses for UUIDs

  • Database Primary Keys: Unique identifiers that work across distributed databases
  • API Request IDs: Track requests across microservices
  • Session Tokens: Generate unique session identifiers
  • File Names: Create unique names to avoid collisions
  • Message IDs: Uniquely identify messages in queuing systems
  • Resource Identifiers: Tag resources in cloud services

UUID Format Breakdown

A UUID is typically displayed as 32 hexadecimal digits in 5 groups separated by hyphens:

  • 8 characters - Time low (or random in v4)
  • 4 characters - Time mid (or random in v4)
  • 4 characters - Version + time high (or random in v4)
  • 4 characters - Variant + clock sequence (or random in v4)
  • 12 characters - Node/MAC address (or random in v4)

UUID Best Practices

  • Use version 4 for most applications (better privacy, simpler)
  • Use version 1 when you need sortable IDs or timestamp information
  • Store UUIDs as binary (16 bytes) in databases for better performance
  • Use lowercase for consistency (though UUIDs are case-insensitive)
  • Don't rely on UUIDs for security - they're identifiers, not secrets
  • Consider ULIDs or KSUIDs if you need lexicographically sortable IDs

UUID vs Other Identifiers

  • UUID: 128-bit, globally unique, no coordination needed, large size
  • Auto-increment IDs: Small, sequential, requires database coordination, predictable
  • Snowflake IDs: 64-bit, time-ordered, requires coordination service
  • ULID: 128-bit, time-ordered, more human-readable, lexicographically sortable

Collision Probability

For UUID v4, the probability of collision is extremely low. To have a 50% chance of a collision, you'd need to generate 2.71 quintillion (2.71 × 10¹⁸) UUIDs. For practical purposes, UUID collisions are so rare they can be considered impossible in normal use.

Performance Considerations

  • UUIDs as primary keys can slow down database inserts due to randomness
  • Consider clustered indexes on timestamp columns alongside UUID keys
  • Store as binary type (BINARY(16) in MySQL, UUID in PostgreSQL)
  • Version 1 UUIDs provide better insertion performance due to temporal ordering

Fun Facts About UUIDs

  • There are 2¹²⁸ (340 undecillion) possible UUIDs
  • Microsoft calls them GUIDs (Globally Unique Identifiers)
  • UUIDs are used in file systems, Bluetooth, and many web services
  • PostgreSQL has a native UUID data type
Sponsored

Premium Partner

Check out this recommended service.

Privacy First

Unlimited history • Encrypted backups