---
id: "uuid_v4"
kind: "datatype"
status: "draft"
is_pii: false
categories: ["identifiers"]
langs: ["common"]
quality: 80
url: "http://registry.apicrafter.io/datatype/uuid_v4"
---

# Random UUID (version 4) (`uuid_v4`)

> **Draft.** Draft records have not been reviewed yet and may be incomplete or wrong; do not treat them as authoritative for legal or compliance decisions.

UUID of version 4 under RFC 9562. Apart from the version and variant bits, its 122 bits are random, so it carries no time or host information. It is the most common kind of UUID, made by functions such as uuid.uuid4() in Python, crypto.randomUUID() in JavaScript and gen_random_uuid() in PostgreSQL. The version digit, the first digit of the third group, is 4, and the first digit of the fourth group is 8, 9, a or b.

- Parent datatype: `uuid`
- Personal data (PII): no
- Categories: Universal unique identifiers (identifiers)
- Countries: global
- Languages: Common to most languages (common)
- Classification: identifier

## Detection

Regular expression (Python `re`):

```
^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-4[0-9A-Fa-f]{3}-[89ABab][0-9A-Fa-f]{3}-[0-9A-Fa-f]{12}$
```

## Examples

- `919108f7-52d1-4320-9bac-f847db4148a8` — UUIDv4 test vector of RFC 9562 (Appendix A.3)
- `16fd2706-8baf-433b-82eb-8c7fada847da` — uuid4() output in the Python uuid module documentation
- `C232AB00-9414-11EC-B3C8-9F6BDECED846` (invalid example) — UUIDv1
- `919108f7-52d1-4320-cbac-f847db4148a8` (invalid example) — Version 4 digit, but the variant digit c is not the RFC 9562 variant

## Translations

- ru: UUID версии 4 (случайный)

## Sources

- doc: <https://www.rfc-editor.org/rfc/rfc9562#name-uuid-version-4>

## Quality

Score 80/100. Missing: mapping (Wikidata, Schema.org, ...), detector coverage.

JSON: <http://registry.apicrafter.io/api/v1/datatypes/uuid_v4.json> · Edit: <https://github.com/apicrafter/metacrafter-registry/edit/main/data/datatypes/any/identifiers/uuid_v4.yaml>
