# Universally Unique Identifier (UUID)

> A 128-bit ID any computer can make. Two almost never match.

**Field:** Software Development  
**Category:** Files & Formats  
**Also known as:** UUID, GUID, Globally Unique Identifier

## Think of it like

Think of it like a name so long and odd that no one else has it.

## Definition

A UUID is a 128-bit number used as an ID that is unique everywhere. It is written as 32 hex digits in five groups joined by hyphens. Any computer can make one without asking a central list. The chance of two random UUIDs matching is tiny. Version 4 is fully random. Version 7 starts with the time, so newer IDs sort after older ones.

## Example

Lucy's notes app works offline on many phones. Each new note gets a UUID, so notes from every phone join up with no clash.

## Example code

```console
$ uuidgen
4149014e-eabb-4fab-a179-5177233cc0e5
```

A new random UUID. The 4 at the start of the third group marks version 4.

## Why it matters

Many computers can make IDs at once without a clash. Nobody has to hand out the next number.

## Common mistake

Using a UUID as a secret, like in a password reset link. Not every version is random, so some can be guessed.

## Three principles

- **128 bits.** Written as 32 hex digits.
- **No central list.** Every computer makes its own.
- **Versions differ.** Version 4 is random, version 7 starts with time.

## Related terms

- [Primary Key](https://learn.benibix.com/term/development/primary-key)
- [Unix Timestamp](https://learn.benibix.com/term/development/unix-timestamp)
- [Hexadecimal](https://learn.benibix.com/term/general/hexadecimal)
- [Database Index](https://learn.benibix.com/term/development/database-index)

## Taught in

- [UUIDs, Unix Time and ISO 8601](https://learn.benibix.com/learn/development-formats/uuids-unix-time-and-iso-8601): File Formats, 10/11

![On the top row, the number 1700000000, marked Unix timestamp, seconds since 1 January 1970 UTC, is joined by a dashed line marked same moment to 2023-11-14T22:13:20Z, marked ISO 8601, year first, T, then time, Z for UTC. Below, a lit-up box holds the UUID 4149014e-eabb-4fab-a179-5177233cc0e5, with a note that it has groups of 8, 4, 4, 4 and 12 hex digits and the 4 starting the third group means version 4.](https://learn.benibix.com/diagrams/dev2-time-ids.svg)

---

Source: https://learn.benibix.com/term/development/uuid
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-18
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
