Blog · UUID basics
What is a UUID?
UUID means universally unique identifier: a 128-bit value used to identify something in software. Think of it as a label for a record, file or event.
UUID meaning, explained with an example
Imagine an app that lets people create notes while offline. Each device needs to label new notes before it can contact the server. A UUID lets it create an ID locally, without asking a shared counter for the next number.
When those notes are synced, their IDs help the app tell them apart. The ID identifies a note; its title and contents live separately.
What does a UUID look like?
f47ac10b-58cc-4372-a567-0e02b2c3d479The usual text form has 32 hexadecimal digits separated by four hyphens, for 36 characters in an 8–4–4–4–12 pattern. The underlying value occupies 16 bytes.
This is an example, not a fresh ID for your application. Generate your own UUID or check an existing UUID.
Where are UUIDs used?
Common uses include database record IDs, API resource IDs, uploaded file names and event identifiers. An order and its payment can each have their own ID, while storing a reference that connects them.
For a small application, a sequential integer may also be a sensible choice. Choose an ID format to suit how your data is created, stored and shared.
UUID v4 and v7
UUID v4: random identifiers
Version 4 uses random data to create identifiers without an embedded creation timestamp.
UUID v7: time-ordered identifiers
Version 7 includes a timestamp and is useful when time ordering matters. Both use the familiar UUID text format. Read the detailed UUID v4 vs v7 comparison.
Is a UUID always unique?
Random UUID collisions are possible, although extremely unlikely with a correct generator. Applications that require uniqueness should also enforce it, for example with a database unique constraint.
Is a GUID the same as a UUID?
GUID stands for globally unique identifier. It is another name commonly used for UUIDs, particularly in Microsoft tooling.
Can a UUID replace a password?
No. A resource ID is not an access-control mechanism. Check permissions whenever a user requests a private record, even if its UUID looks hard to guess.
Further reading
The UUID specification is RFC 9562. For a quick format check, use the UUID Validator.