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

# Length (linear dimension) (`length`)

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

Size of an object measured along one dimension, such as the length of a cable, the depth of a shelf or the height of a person. Datasets store it as a number in millimetres, centimetres, metres, inches or feet, or in pixels for images and screen elements, with the unit either in the value or in the column name or metadata. The regular expression recognizes only values that carry one of these unit symbols. Height and width are narrower datatypes for the vertical and the horizontal dimension.

- Parent datatype: `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`):

```
^\d+(?:[.,]\d+)?\s?(?:mm|cm|m|in|ft|px)\.?$
```

## Examples

- `2.5 m` — metres
- `180 cm` — centimetres
- `1920px` — pixels without a space
- `6 ft.` — feet, abbreviation with a dot
- `cm` (invalid example) — unit without a number
- `72.5 kg` (invalid example) — unit of mass

## Mappings

- wikidata: `P2043`

## Translations

- ru: Длина

## Sources

- wikipedia: <https://en.wikipedia.org/wiki/Length>
- wikidata: <https://www.wikidata.org/wiki/Property:P2043>

## Quality

Score 90/100. Missing: detector coverage.

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