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

# Binary number (`binary_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 2 with the digits 0 and 1, with or without the prefix 0b that programming languages use. A decimal number made of zeros and ones also matches when the prefix is missing, so use the field name or context.

- 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[bB])?[01]+$
```

## Examples

- `0b1011` — 11 with the prefix
- `101010` — 42 without the prefix
- `1021` (invalid example) — The digit 2

## Translations

- ru: Число в двоичной записи

## Quality

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

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