Portugal código postal validator
How the código postal format works
- Format
- 7 digits, written as 0000-000
- Example
- 1000001
Things to watch for
- Format-only check — does not confirm the código postal actually exists
- 7 digits total; normally written with a hyphen after the first 4 digits (0000-000)
^[0-9]{7}$A Portuguese código postal is the 7-digit postcode CTT uses to route mail, written as four digits, a hyphen, then three more — for example 1000-001 for central Lisbon. The first four digits are a legacy of Portugal’s original 4-digit system; the trailing three-digit suffix was added in the early 1990s to sharpen precision down to a specific street or large building. Anyone validating a Portuguese shipping address or a checkout form needs the code in that exact 7-digit shape before it’s useful downstream.
Because the hyphen sits in a fixed spot — after the fourth digit — a code that’s missing it, or has digits shifted across that boundary, produces a string that clearly doesn’t match the expected shape, well before anyone checks whether the specific code is in use.
How this validator works
This tool checks that the input is exactly 7 digits, accepted with or without the customary hyphen after the fourth digit, entirely in your browser, with nothing sent to a server.
What a pass doesn’t tell you
A código postal carries no check digit, so matching the 7-digit shape is the most a client-side tool can confirm — not that CTT has assigned it to a real street or building. Confirming that requires CTT’s own postal code lookup.
Scope: this page and tool cover format validation only — not address lookup, street matching, or confirming a code is currently in use.
código postal FAQ
Why does the Portuguese código postal have 7 digits instead of 4?
It didn't always. CTT originally used a 4-digit code, but in the early 1990s appended a 3-digit suffix after a hyphen to sharpen precision down to individual streets or large buildings, giving the 7-digit shape used today. The extension was a response to the original 4-digit zones becoming too coarse as address volumes grew.
Do I need to type the hyphen?
No — this validator accepts the code with or without the hyphen after the fourth digit (e.g. '1000001' or '1000-001'). The hyphen is a writing convention; the underlying code is still 7 digits.
Does a correctly formatted código postal mean it actually exists?
No. This tool only confirms the string is 7 digits in the right shape — it doesn't check it against CTT's actual assignment list. Confirming a code is real, and seeing which street it covers, requires CTT's own postal code lookup.