---
id: "hex_number"
kind: "pattern"
status: "draft"
is_pii: false
categories: ["values", "common"]
langs: ["common"]
quality: 65
url: "https://registry.apicrafter.io/datatype/hex_number"
---

# Hexadecimal number (`hex_number`)

> **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.

Non-negative integer written in base 16 with the prefix 0x, as in programming languages, memory addresses and error codes. The pattern requires the prefix, because without it a value cannot be told from a hash, a colour or an identifier.

- Pattern of: `numeric`
- Personal data (PII): no
- Categories: All measurable values (percentage, amount and e.t.c) (values), Common (common)
- Countries: global
- Languages: Common to most languages (common)

## Detection

Regular expression (Python `re`):

```
^0[xX][0-9A-Fa-f]+$
```

## Examples

- `0xFF` — 255
- `0x1f4` — 500
- `FF` (invalid example) — The prefix is missing

## Translations

- ru: Число в шестнадцатеричной записи

## Quality

Score 65/100. Missing: source link, mapping (Wikidata, Schema.org, ...), detector coverage.

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