---
id: "de_state_code"
kind: "pattern"
status: "draft"
is_pii: false
categories: ["geo", "government"]
country: ["DE"]
langs: ["common"]
quality: 80
url: "http://registry.apicrafter.io/datatype/de_state_code"
---

# German state code (ISO 3166-2:DE) (`de_state_code`)

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

Two-letter code of a German state from ISO 3166-2:DE, such as BY (Bayern), NW (Nordrhein-Westfalen) or BE (Berlin), alone or after the country code as in DE-BY.

- Pattern of: `de_state`
- Personal data (PII): no
- Categories: Geographic identifiers (geo), Government related (government)
- Countries: Germany (DE)
- Languages: Common to most languages (common)
- Classification: categorical

## Detection

Regular expression (Python `re`):

```
^(?:DE-)?(?:BB|BE|BW|BY|HB|HE|HH|MV|NI|NW|RP|SH|SL|SN|ST|TH)$
```

## Examples

- `DE-BY` — Bayern
- `NW` — Nordrhein-Westfalen
- `DE-HH` — Hamburg
- `DE-BR` (invalid example) — Draft code for Brandenburg, replaced by DE-BB in ISO 3166-2:1998
- `DE-NS` (invalid example) — Niedersachsen is NI

## Translations

- de: Kürzel des Bundeslandes (ISO 3166-2:DE)
- ru: Код земли Германии (ISO 3166-2:DE)

## Sources

- wikipedia: <https://de.wikipedia.org/wiki/ISO_3166-2:DE>
- wikipedia: <https://en.wikipedia.org/wiki/ISO_3166-2:DE>

## Quality

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

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