1001Ferramentas
📮Generators

Portugal Postal Code Generator (fake)

Generate Portuguese postal codes (####-### format, prefixes 1000–9999). For fixtures only — does not match real addresses.


  

Portuguese postal codes (Código Postal): format and history

Portugal's postal code system is administered by CTT — Correios de Portugal, the national postal operator. The current format is NNNN-NNN — four digits, a hyphen, and three more digits — totalling seven digits. The first block (4 digits) identifies a broad geographic distribution area, while the second block (3 digits) refines the location down to a street segment, building or even a specific lot. There are roughly 200,000 valid postal codes covering the entire country, including the autonomous regions of Madeira and the Azores.

The original system, introduced in 1978, used only four digits and covered postal districts. In 1998, CTT expanded it to the current 4+3 format to support address-level routing and automated sorting. This makes it more precise than systems like the French five-digit code, and roughly comparable to the UK's outward+inward postcode (e.g. SW1A 1AA), although the UK version is alphanumeric.

Regional prefixes

The first digit of the four-digit block roughly identifies the region of mainland Portugal and the islands:

  • 1xxx — Lisbon metropolitan area (e.g. 1000 Lisbon centre)
  • 2xxx — Setúbal and Santarém districts
  • 3xxx — Centro region (e.g. 3000 Coimbra)
  • 4xxx — Porto and the north (e.g. 4000 Porto centre)
  • 5xxx — Trás-os-Montes and Alto Douro
  • 6xxx — Beira Interior
  • 7xxx — Alentejo
  • 8xxx — Algarve (e.g. 8000 Faro)
  • 9xxx — Madeira and Azores (e.g. 9000 Funchal, 9500 Ponta Delgada)

PT postal code vs BR CEP

Both countries use hyphenated postal codes, but the structure differs. The Brazilian CEP has 8 digits in the NNNNN-NNN (5+3) format, while the Portuguese Código Postal has 7 digits in NNNN-NNN (4+3). Validating an international form that accepts both requires two regex branches — never assume a Lusophone customer's postal code has 8 digits.

Use cases for generated codes

Generated codes are valuable for QA pipelines that exercise international address forms, for seeding mock e-commerce databases that ship to Portugal, for validating regex parsers (^\d{4}-\d{3}$) and for distinguishing Portuguese customers from other Lusophone markets — Brazil uses 8 digits, Angola and Mozambique use 4-digit codes without a hyphen.

FAQ

Can I use a generated postal code to actually send a parcel to Portugal? No. The tool produces syntactically valid codes (right format, plausible regional prefix), but they are not guaranteed to correspond to a real address. For real shipments, look up the recipient's code on the CTT website or Google Maps.

Does the generator cover the Azores and Madeira? Yes. Codes starting with 9 are reserved for the autonomous regions — 9000-9499 for Madeira and 9500-9999 for the Azores.

How can I find the correct postal code for a specific Portuguese address? Use the CTT lookup service (pesquisaCodigoPostal endpoint), Google Maps PT, or the official paper code book — they map street segments to the exact 7-digit code.

What is this useful for? Mock data for e-commerce stores expanding to Portugal, automated tests for international address forms, distinguishing Lusophone customers (PT vs BR vs Angola/Mozambique, which use 4-digit codes), and load-testing logistics integrations against CTT-style payloads.

Related Tools