A Netherlands postcode validator that checks every structural rule the Dutch postal authority (PostNL) enforces — digit range, letter alphabet, and reserved suffix exclusions — entirely in your browser, with no data ever sent to a server.
How Dutch postcodes work
A Dutch postcode (Dutch: postcode) is a six-character alphanumeric code introduced by PTT in 1978 and maintained today by PostNL. The canonical written form is 4 digits + space + 2 uppercase letters, for example 2500 GH (The Hague area) or 1017 AB (Amsterdam canal belt).
The four-digit numeric part identifies a delivery area — roughly a group of streets in a town or district. These numbers run from 1000 (greater Amsterdam) up to 9999 (Delfzijl, Groningen). No Dutch postcode starts with zero; a leading zero immediately flags the input as invalid.
The two-letter suffix narrows the area to a specific street or part of a street. Not all 676 possible letter combinations (26 times 26) are in use. PostNL deliberately removed six letters from the suffix alphabet — F, I, O, Q, U and Y — because they are too easily confused with digits or with each other in handwriting and early OCR. Any suffix containing one of these letters is invalid regardless of the numeric part.
Reserved suffix combinations
Three two-letter suffixes are permanently excluded across the entire postcode space: SA, SD and SS. After World War II, the Dutch government withdrew these abbreviations because they matched the names of Nazi paramilitary organisations (SA, SS) and the intelligence branch (SD). They were removed from PTT’s allocation tables and have never been reassigned. An address claiming one of these suffixes is either a data-entry error or pre-dates the withdrawal.
Validation algorithm
- Strip whitespace and convert to uppercase.
- Confirm the pattern is exactly four digits followed by two letters (tolerating an optional single space between them).
- Check the digit value is between 1000 and 9999 inclusive.
- Check each letter in the suffix is drawn from the 20-letter PostNL alphabet (A B C D E G H J K L M N P R S T V W X Z).
- Check the two-letter suffix is not one of the reserved combinations (SA, SD, SS).
- If all five steps pass, output the canonical format
1234 ABand an approximate delivery region.
Worked example
Suppose you are validating the postcode 2500 GH:
- Strip and uppercase:
2500GH - Pattern match:
2500(digits) +GH(letters) — format correct - Digit range: 2500 is between 1000 and 9999 — passes
- Letter alphabet: G and H are both in the valid 20-letter set — passes
- Reserved suffix: GH is not in the reserved list — passes
- Result: valid; canonical form
2500 GH; area: The Hague / Den Haag (Zuid-Holland)
Now try 1234 SS:
- Pattern match, digit range, alphabet — all pass
- Reserved suffix: SS is permanently withdrawn — invalid
And try 1234 FO:
- Letter alphabet: F and O are both excluded — invalid
Every check runs locally; nothing is uploaded or logged.
| Postcode | Valid? | Reason |
|---|---|---|
1017 AB | Yes | Amsterdam canal belt |
2500 GH | Yes | The Hague / Den Haag |
9999 AA | Yes | Delfzijl area |
0123 AB | No | Starts with 0 |
1234 SS | No | Reserved WWII suffix |
5678 FO | No | F and O excluded from alphabet |
1234 AB | Yes | Trailing space stripped automatically |