International zipcodes validator in Javascript, based on Regex for Node.js and the browser.
$ npm install i18n-zipcodes
- Download the script in the
dist
folder
i18nZipcodes(countryCode: string, zipCode: string): boolean
// countryCode param is case insensitive
// CommonJS Syntax
const i18nZipcodes = require('i18n-zipcodes');
// or ES Syntax
import i18nZipcodes from 'i18n-zipcodes';
i18nZipcodes('US', '90210'); // true
i18nZipcodes('fr', '5632'); // false
<script src="i18n-zipcodes.min.js"></script>
<script>
console.log(i18nZipcodes('fr', '75014')); // true
</script>
Country codes use the ISO 3166-1 format.
- ๐ฆ๐ฉ (
AD
) Andorra - ๐ฆ๐ฒ (
AM
) Armenia - ๐ฆ๐ท (
AR
) Argentina - ๐ฆ๐ธ (
AS
) American Samoa - ๐ฆ๐น (
AT
) Austria - ๐ฆ๐บ (
AU
) Australia - ๐ฆ๐ฟ (
AZ
) Azerbaijan
- ๐ง๐ฆ (
BA
) Bosnia and Herzegovina - ๐ง๐ฉ (
BD
) Bangladesh - ๐ง๐ช (
BE
) Belgium - ๐ง๐ฌ (
BG
) Bulgaria - ๐ง๐ฏ (
BJ
) Benin - ๐ง๐ฒ (
BM
) Bermuda - ๐ง๐ณ (
BN
) Brunei - ๐ง๐ท (
BR
) Brazil - ๐ง๐พ (
BY
) Belarus
- ๐จ๐ฆ (
CA
) Canada - ๐จ๐ญ (
CH
) Switzerland - ๐จ๐ณ (
CN
) China - ๐จ๐บ (
CU
) Cuba - ๐จ๐ฝ (
CX
) Christmas Island - ๐จ๐พ (
CY
) Cyprus - ๐จ๐ฟ (
CZ
) Czechia
- ๐ฉ๐ช (
DE
) Germany - ๐ฉ๐ฐ (
DK
) Denmark - ๐ฉ๐ฟ (
DZ
) Algeria
- ๐ช๐ช (
EE
) Estonia - ๐ช๐ธ (
ES
) Spain
- ๐ซ๐ฎ (
FI
) Finland - ๐ซ๐ฒ (
FM
) Micronesia - ๐ซ๐ด (
FO
) Faroe Islands - ๐ซ๐ท (
FR
) France
- ๐ฌ๐ช (
GE
) Georgia - ๐ฌ๐ซ (
GF
) French Guiana - ๐ฌ๐ฑ (
GL
) Greenland - ๐ฌ๐ต (
GP
) Guadeloupe - ๐ฌ๐ท (
GR
) Greece - ๐ฌ๐น (
GT
) Guatemala - ๐ฌ๐บ (
GU
) Guam - ๐ฌ๐ผ (
GW
) Guinea-Bissau
- ๐ญ๐ท (
HR
) Croatia - ๐ญ๐บ (
HU
) Hungary
- ๐ฎ๐จ (
IC
) Canary Islands - ๐ฎ๐ฉ (
ID
) Indonesia - ๐ฎ๐ช (
IE
) Ireland - ๐ฎ๐ฑ (
IL
) Israel - ๐ฎ๐ณ (
IN
) Inde - ๐ฎ๐ธ (
IS
) Iceland - ๐ฎ๐น (
IT
) Italy
- ๐ฏ๐ต (
JP
) Japan
- ๐ฐ๐ช (
KE
) Kenya - ๐ฐ๐ฌ (
KG
) Kyrgyzstan - ๐ฐ๐ท (
KR
) South Korea - ๐ฐ๐ผ (
KW
) Kuwait - ๐ฐ๐ฟ (
KZ
) Kazakhstan
- ๐ฑ๐ฎ (
LI
) Liechtenstein - ๐ฑ๐น (
LT
) Lithuania - ๐ฑ๐บ (
LU
) Luxembourg - ๐ฑ๐ป (
LV
) Latvia
- ๐ฒ๐ฆ (
MA
) Morocco - ๐ฒ๐ฉ (
MD
) Moldova - ๐ฒ๐ช (
ME
) Montenegro - ๐ฒ๐ฌ (
MG
) Madagascar - ๐ฒ๐ญ (
MH
) Marshall Islands - ๐ฒ๐ฐ (
MK
) North Macedonia - ๐ฒ๐ฒ (
MM
) Myanmar - ๐ฒ๐ณ (
MN
) Mongolia - ๐ฒ๐ต (
MP
) Northern Mariana Islands - ๐ฒ๐ถ (
MQ
) Martinique - ๐ฒ๐น (
MT
) Malta - ๐ฒ๐ป (
MV
) Maldives - ๐ฒ๐ฝ (
MX
) Mexico - ๐ฒ๐พ (
MY
) Malaysia - ๐ฒ๐ฟ (
MZ
) Mozambique
- ๐ณ๐ฑ (
NL
) Netherlands - ๐ณ๐ด (
NO
) Norway - ๐ณ๐ฟ (
NZ
) New Zealand
- ๐ต๐ญ (
PH
) Philippines - ๐ต๐ฐ (
PK
) Pakistan - ๐ต๐ฑ (
PL
) Poland - ๐ซ๐ท (
PM
) Saint Pierre and Miquelon - ๐ต๐ท (
PR
) Puerto Rico - ๐ต๐ธ (
PS
) Palestine - ๐ต๐น (
PT
) Portugal - ๐ต๐ผ (
PW
) Palau
- ๐ท๐ช (
RE
) Rรฉunion - ๐ท๐ด (
RO
) Romania - ๐ท๐ธ (
RS
) Serbia - ๐ท๐บ (
RU
) Russian Federation
- ๐ธ๐ฆ (
SA
) Saudi Arabia - ๐ธ๐ฉ (
SD
) Sudan - ๐ธ๐ช (
SE
) Sweden - ๐ธ๐ฌ (
SG
) Singapore - ๐ธ๐ฎ (
SI
) Slovenia - ๐ธ๐ฐ (
SK
) Slovakia - ๐ธ๐ฒ (
SM
) San Marino - ๐ธ๐ฟ (
SZ
) Swaziland
- ๐น๐ญ (
TH
) Thailand - ๐น๐ฏ (
TJ
) Tajikistan - ๐น๐ฒ (
TM
) Turkmenistan - ๐น๐ณ (
TN
) Tunisia - ๐น๐ท (
TR
) Turkey - ๐น๐ผ (
TW
) Taiwan
- ๐บ๐ฆ (
UA
) Ukraine - ๐ฌ๐ง (
UK
) United Kingdom - ๐บ๐ธ (
US
) United States of America - ๐บ๐พ (
UY
) Uruguay - ๐บ๐ฟ (
UZ
) Uzbekistan
- ๐ป๐ช (
VE
) Venezuela - ๐ป๐ฎ (
VI
) Virgin Islands (U.S.) - ๐ป๐ณ (
VN
) Viet Nam
- ๐ฝ๐ฐ (
XK
) Kosovo
- (
YU
) Yugoslavia
- ๐ฟ๐ฆ (
ZA
) South Africa - ๐ฟ๐ฒ (
ZM
) Zambia