CEP Generator
Generate Brazilian postal codes (CEP) by state for software testing. Numbers within the real postal code ranges per UF. For test use only.
What is a ZIP Code generator used for?
CEP, short for Brazilian Postal Code, is an 8-digit number the postal service uses to identify regions across Brazil, and each state occupies a specific range of those numbers.
It comes in handy when you need to test address forms, double-check shipping calculations or validate postal API integrations while developing.
The generated CEPs are within the real ranges per state but may not correspond to a real address.
How the Brazilian postal code (CEP) works
The CEP — Código de Endereçamento Postal is the eight-digit postal code created by the Brazilian Post Office (Correios) in 1971 through DEPLAN Standard nº 1/71. Originally it had five digits; in May 1992 the format was expanded to eight to support finer routing in large cities. The canonical notation is XXXXX-XXX, where the first five digits encode geography (region, sub-region, sector, sub-sector and divisor) and the three digits after the hyphen are the suffix — pointing to a specific street segment, block, building or post-office customer.
Geographic layout
The very first digit splits Brazil into ten postal regions:
- 0 — São Paulo (capital and metropolitan area)
- 1 — São Paulo state, interior
- 2 — Rio de Janeiro and Espírito Santo
- 3 — Minas Gerais
- 4 — Bahia and Sergipe
- 5 — Pernambuco, Alagoas, Paraíba, Rio Grande do Norte, Ceará, Piauí, Maranhão
- 6 — Pará, Amazonas, Acre, Amapá, Rondônia, Roraima, Tocantins
- 7 — Distrito Federal, Goiás, Mato Grosso, Mato Grosso do Sul
- 8 — Paraná and Santa Catarina
- 9 — Rio Grande do Sul
The next digits narrow the location down: the second is the sub-region, the third the sector, the fourth the sub-sector and the fifth the divisor of sub-sector. Together these five digits identify a city, a district or a large block within a metropolitan area. The three digits after the hyphen — the suffix — pinpoint a street, a side of a street, a building or a post-office box range.
Special suffixes
-000— single CEP for an entire small town (no per-street resolution)-899— post-office boxes (caixas postais comunitárias)-900to-959— large customers (banks, ministries, universities with their own CEP)-970to-989— Correios service units
Looking up real addresses
Correios maintains the authoritative database through the SIGEP service and licenses it via DNE (Diretório Nacional de Endereços). Free community front-ends like ViaCEP and BrasilAPI wrap the same data with a friendlier REST API and are widely used by Brazilian e-commerce checkouts for address autocomplete.
Generate postal codes by state for testing
When you set out to test address forms, shipping integrations or logistics systems, grabbing any real postal code tends to give odd results. What you actually want is a code that fits the test. This generator creates postal codes by state, within each region's official ranges, built for people validating software.
You pick the state and the tool returns codes in that region's correct numeric ranges. Because they respect the link between postal code and state, they behave well in tests that check that correspondence. Use them to seed a development database, verify shipping calculations by region or sign off on address forms.
Nothing is looked up in an external database; it all comes straight from your browser. Bear in mind these are fictitious codes meant for testing, and they won't necessarily match a real existing address.
Frequently asked questions
How do I find the right CEP for an address?
Why does my neighborhood share one CEP while another has a unique CEP per street?
Are CEPs updated over time?
Can I use these generated CEPs in production?
Related Tools
Portugal Postal Code Generator (fake)
Generate Portuguese postal codes (####-### format, prefixes 1000–9999). For fixtures only — does not match real addresses.
CNH Generator
Generate mathematically valid Brazilian driver's license (CNH) numbers for testing. Follows the DETRAN algorithm. For test use only.
CPF Generator
Generate mathematically valid Brazilian CPF numbers for software testing and development. With or without formatting. For test use only.
PIN Generator
Generate random PINs (Personal Identification Numbers) with configurable length from 4 to 16 digits.
Person Data Generator
Generate complete fictitious person profiles: name, CPF, date of birth, CEP and phone number. Mathematically valid data for testing.
CNPJ Generator
Generate mathematically valid Brazilian CNPJ numbers for software testing. With or without formatting. For test use only.