Web Content & Formats

What is a UUID?

A Universally Unique Identifier, a 128-bit value formatted as 32 hex digits with hyphens, used as a globally unique key without coordination between systems.

Also known as: Universally Unique Identifier, GUID

A UUID looks like f47ac10b-58cc-4372-a567-0e02b2c3d479. The 128-bit space is large enough that a system can mint UUIDs locally and trust they will never collide with another system's, no central registry required. That property is why UUIDs are the default primary key in most distributed systems and event-driven architectures.

There are several versions. v4 is random and the most common: 122 bits of entropy, generated from a CSPRNG. v1 embeds a timestamp and MAC address; v7 (newer) embeds a unix timestamp at the front so the IDs sort in time order, which plays better with B-tree indexes. v5 derives a UUID deterministically from a name plus a namespace, useful for stable IDs derived from external keys.

For APIs and brand data, UUIDs are the workhorse identifier for resources: every brand, every logo asset, every webhook delivery gets one. The tradeoff vs auto-incrementing integers is size (16 bytes vs 4 or 8) and index locality (random UUIDs hurt B-tree performance under heavy insert load), which is why v7 / ULIDs / KSUIDs exist as time-ordered alternatives.

In the wild

  • A REST API returning resources keyed by id: "f47ac10b-58cc-4372-a567-0e02b2c3d479"
  • An idempotency key generated as a UUIDv4 by the client to dedupe retries
  • Postgres tables using uuid columns as primary keys to allow sharding without ID collisions

How Brand.dev uses uuid

Endpoints in the Brand.dev API where this concept comes up directly.

FAQ

UUID v4 vs v7?

v4 is fully random; v7 puts a millisecond timestamp at the front and is otherwise random. v7 sorts in time order and is more index-friendly. Most new systems pick v7 if their language has a stable implementation.

UUID vs ULID vs KSUID?

All are time-ordered 128-bit identifiers. UUIDv7 is the most standardized; ULID has a lexicographically sortable Crockford-base32 string form; KSUID is 160-bit with a 32-bit timestamp. Pick whichever your stack already supports cleanly.

Is a UUID truly unique?

For random UUIDs, the collision probability is so low it is treated as zero in practice (you would need to generate 1 billion UUIDs per second for ~85 years to have a 50% chance of one collision).

Related terms

Ship an agent that actually knows things.

Free tier, 10-minute integration, and the same API powering agents at Mintlify, daily.dev, and Propane. No credit card to start.