---
id: "br_municipality_code_6"
kind: "pattern"
status: "draft"
is_pii: false
name: "Brazilian municipality code without the check digit (IBGE, six digits)"
regexp: "^(1[1-7]|2[1-9]|3[1-35]|4[1-3]|5[0-3])\\d{4}$"
categories: ["geo", "government"]
country: ["BR"]
langs: ["pt"]
quality: 90
url: "https://registry.apicrafter.io/datatype/br_municipality_code_6"
---

# Brazilian municipality code without the check digit (IBGE, six digits) (`br_municipality_code_6`)

> **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 first six digits of the IBGE code of a Brazilian municipality (br_municipality_code), without its check digit: the IBGE code of the state (35 São Paulo, 31 Minas Gerais) and four digits (355030 São Paulo, 310620 Belo Horizonte). The health information systems of DATASUS (SIM, SINASC, SINAN) and the tables built from them write the six-digit form (CODMUNRES, codmunocor), as do the crime statistics of Minas Gerais (municipio_cod) and many research datasets (codmun6, Cod6d). Exports through a spreadsheet or a statistics package add a decimal part (355030.0). Any six digits after a state code pass, so a value fits only in a field named for a municipality code.

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

## Detection

Regular expression (Python `re`):

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

## Examples

- `355030` — São Paulo (IBGE 3550308)
- `310620` — Belo Horizonte (IBGE 3106200)
- `530010` — Brasília (IBGE 5300108)
- `3550308` (invalid example) — the seven-digit code with its check digit (br_municipality_code)
- `995030` (invalid example) — 99 is no state code

## Metacrafter rules

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

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

## Supported by tools

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

## Translations

- pt: Código do município sem o dígito verificador (IBGE, seis dígitos)
- ru: Код муниципалитета Бразилии без контрольной цифры (IBGE, шесть цифр)

## Sources

- doc: <https://www.ibge.gov.br/explica/codigos-dos-municipios.php>
- doc: <https://datasus.saude.gov.br/>

## Quality

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

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