---
id: "br_state_ibge_code"
kind: "datatype"
status: "draft"
is_pii: false
name: "IBGE code of a Brazilian state (federative unit)"
regexp: "^(1[1-7]|2[1-9]|3[1-35]|4[1-3]|5[0-3])$"
categories: ["geo", "government"]
country: ["BR"]
langs: ["pt"]
quality: 90
url: "https://registry.apicrafter.io/datatype/br_state_ibge_code"
---

# IBGE code of a Brazilian state (federative unit) (`br_state_ibge_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.

The two-digit code IBGE gives each of the 27 federative units of Brazil: the first digit is the region (1 Norte, 2 Nordeste, 3 Sudeste, 4 Sul, 5 Centro-Oeste) and the second the state in it (11 Rondônia, 29 Bahia, 35 São Paulo, 43 Rio Grande do Sul, 53 Distrito Federal). It begins the municipality, district and census tract codes (br_municipality_code, br_municipality_code_6, br_census_tract_code). Tables give it as uf, cod_uf, coduf, CD_UF or UF_Cod, and spreadsheet exports as 35.0; the letter abbreviation (SP) is br_state_code.

- Parent datatype: [`id`](https://registry.apicrafter.io/datatype/id.md)
- Personal data (PII): no
- Categories: Geographic identifiers (geo), Government related (government)
- Countries: Brazil (BR)
- Languages: Portuguese (pt)
- Classification: categorical

## Detection

Regular expression (Python `re`):

```
^(1[1-7]|2[1-9]|3[1-35]|4[1-3]|5[0-3])$
```

## Examples

- `35` — São Paulo
- `31` — Minas Gerais
- `53` — Distrito Federal
- `34` (invalid example) — not assigned (the Sudeste has 31, 32, 33 and 35)
- `SP` (invalid example) — the abbreviation (br_state_code)

## Metacrafter rules

1 rules: 1 match the field name, 0 match values.

- `brstateibgecodebyname` (field, `br/br_geo.yaml`)

## Supported by tools

- [`metacrafter`](https://registry.apicrafter.io/tool/metacrafter.md)

## Translations

- pt: Código IBGE da unidade da federação
- ru: Код штата Бразилии (IBGE)

## Sources

- doc: <https://www.ibge.gov.br/explica/codigos-dos-municipios.php>
- wikipedia: <https://pt.wikipedia.org/wiki/Unidades_federativas_do_Brasil>

## Quality

Score 90/100. Missing: mapping (Wikidata, Schema.org, ...).

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