IBGE Municipality Code Lookup

Search for the official IBGE code of Brazilian state capitals and major cities — the 7-digit identifier used in government forms and APIs.

How to use

  1. Type a city name or a 7-digit IBGE code in the search field.
  2. The table filters to show matching municipalities with their official codes.
  3. Copy the code to paste into NF-e forms, eSocial, or any government system that asks for the municipality code.

About this tool

Every Brazilian municipality has a 7-digit code assigned by the IBGE — the Brazilian Institute of Geography and Statistics. This code is not the same as the postal code (CEP) or the area code (DDD): it identifies the municipality itself, and it is the one that appears on electronic invoices (NF-e), eSocial filings, government APIs, and any official form that asks for the municipality of origin or destination.

The first two digits identify the state (35 for São Paulo, 33 for Rio de Janeiro), the next four identify the municipality within the state, and the last digit is a check digit. The code is stable — municipalities that change their names keep the same number, and it is never reassigned. That stability is why APIs and government systems use it instead of the name, which can have accent variations, abbreviations, and outright typos.

This page covers state capitals and the largest cities. For the full list of 5,570 municipalities, the IBGE API at servicodados.ibge.gov.br is the authoritative source. Everything here runs in your browser — no request is made to the IBGE or any other server, and nothing you type is logged.

Frequently asked questions

Where do I need the IBGE code?

On electronic invoices (NF-e), eSocial payroll submissions, Simples Nacional declarations, and many government APIs. Any system that asks for "código do município" wants this number.

Is this the same as the postal code?

No. The CEP (postal code) identifies a street or a range of addresses. The IBGE code identifies the municipality as a whole. A city has one IBGE code and many CEPs.

Does this list include every municipality?

No — it covers state capitals and major cities. The full list of 5,570 municipalities is available from the IBGE API.

Does my search leave my browser?

No. The code table is embedded in the page and the search runs locally.

Related tools

Long links? Shorten them for free

Vai.la turns any URL into a short link with click statistics, QR Code and your own biolink.

Vai.la is not responsible for how the tools are used or for decisions made based on their results.