Developer guide · Yula Studios guide

UUID and GUID: How Unique Identifiers Work

A UUID is a standard format for identifying an object across systems without asking one central service to assign every value. It is useful for records and messages, but it is still an identifier—not a password, permission, or proof of identity.

What a UUID is

A universally unique identifier is a 128-bit value represented in a standardized textual form. The familiar form has hexadecimal groups separated by hyphens, such as 550e8400-e29b-41d4-a716-446655440000. The groups make the value easier to read; they do not turn it into a human-friendly label. The current UUID specification is RFC 9562, which defines the format and several versions with different generation properties.

A UUID can be created in one system and later stored or exchanged by another. This is useful for API resources, database records, event identifiers, and test fixtures. A UUID does not tell you what the record means. Keep a separate display name or domain-specific key when people need to recognize an item.

UUID versions have different properties

The version is part of the UUID format and describes how its value is formed. UUID v4 is based on random or pseudorandom data, with some bits reserved by the format. It is a common choice for identifiers when you do not need the value to encode a creation time or a name. Other versions have different inputs or ordering behavior, so choose based on the system contract instead of treating every UUID as interchangeable.

A UUID v4 collision is extraordinarily unlikely when a suitable random source is used, but it is not mathematically impossible. If a collision would damage data, enforce a unique constraint in the database and handle a conflict by generating another value. The generator creates a candidate; the application remains responsible for enforcing its own data rules.

UUID, GUID, and application identifiers

GUID is a widely used name for a globally unique identifier in some software ecosystems. Many GUID representations are compatible with UUID formats, but code can differ in byte ordering, braces, capitalization, or accepted versions. Check the exact format expected by the library, database, API, or file format you are integrating. Do not compare two strings after casually removing punctuation unless the receiving system defines that normalization.

A database may use a UUID as a primary key, a public API identifier, or a correlation ID for logs. Those uses have different operational needs. A primary key needs an index and uniqueness policy; a public ID should not expose internal data; and a correlation ID should be propagated consistently across the relevant requests. Measure storage and index behavior for the database you use rather than assuming one UUID version is always the fastest.

An identifier is not a security secret

Do not treat an unpredictable-looking UUID as authorization. Knowing an account or document identifier should not grant access to it. Every protected request needs an authorization check for the current user and resource. Likewise, do not use a UUID as a password, API key, session token, or reset token unless a security design explicitly specifies that role and the value is generated, stored, delivered, and expired appropriately.

Identifiers can also appear in URLs, logs, analytics, screenshots, and support tickets. Decide whether a value can be public before including it in those places. A UUID that contains no personal information can still connect events or records, so follow your data-minimization and retention rules.

Generate and use UUIDs carefully

Before generating a value, confirm whether your application expects a UUID, a GUID in a particular representation, a short random ID, or another key type. Generate a small sample and test parsing, serialization, database storage, and API round trips. For distributed writes, test the unique constraint and conflict path as well as the normal case. Keep an example from the target system's documentation nearby when debugging format mismatches.

YulaTools can generate UUID v4 values and NanoIDs for development and test workflows. A NanoID is a different compact identifier format, so use it only where the receiving system accepts it. Copy a generated value into a test record first; do not replace a production key scheme until migrations, references, and uniqueness behavior have been planned.