What Is a UUID and How Is a UUID v4 Used?
Every row, every file, every record eventually needs a name that never repeats. UUIDs are a deceptively simple answer: a 128-bit identifier with a format so regular you will recognize it instantly. This article explains what they are, how the versions differ, and why so many systems reach for them.
What does a UUID actually look like?
A UUID is a 36-character string broken into groups by hyphens, like 550e8400-e29b-41d4-a716-446655440000. It represents 128 bits: 122 used for the identifier itself and a few reserved bits that describe the version and variant. Because the space is enormous, collisions are practically impossible.
What is the version field for?
The version is the digit embedded in the third group. v4 UUIDs are generated from cryptographically random bytes. v1 UUIDs embed a timestamp and node identifier, which makes them sortable by creation time but reveals the generating host. v7 is the modern timestamp-ordered alternative many new systems prefer.
Why is UUID v4 so popular?
UUID v4 needs no coordination: any machine can mint an identifier without asking a central server. That makes it perfect for offline-sync apps, distributed databases, and public identifiers that should not leak information. An attacker cannot guess the next value because it is random.
When should you prefer a different version?
If you need insertion-order-friendly primary keys for extremely large tables, a time-ordered version like v7 tends to keep indexes warm. If you need reproducibility or timestamp sorting, consider v1. For almost everything else, v4 is the default and safest choice.
What are the common real-world uses?
You will find UUIDs as primary keys, file names, session and token identifiers, event tracking keys, and database replication keys. Generate a batch for your next schema with the UUID generator, which supports v1, v4, bulk output, and configurable formatting.