Phone Regex

Phone number regex for different countries.

Usage

  1. You can import in your js file es6 (modules,vue,react,...)
import { RX_PHONE_IR } from "helping-js/core/phones-regex"; // Check URL

const value = "+98123456789";
if (RX_PHONE_IR.test(value)) {
    console.log("Valid Phone");
} else {
    console.log("Invalid Phone");
}
  1. You can import in your js file es5 (nodejs)
const { RX_PHONE_IR } = require("helping-js/core/phones-regex"); // Check URL

const value = "+98123456789";
if (RX_PHONE_IR.test(value)) {
    console.log("Valid Phone");
} else {
    console.log("Invalid Phone");
}
  1. You can usage from CDN (only modules)
import { RX_PHONE_IR } from "https://unpkg.com/browse/helping-js/core/phones-regex.js";

const value = "+98123456789";
if (RX_PHONE_IR.test(value)) {
    console.log("Valid Phone");
} else {
    console.log("Invalid Phone");
}

Countries

TitleConstRegexSampleDescription
ARRX_PHONE_AR/^(?:+54|0)?(11|[1-9][1-9])\d{8}$/+541122345678Argentina phone number format
AURX_PHONE_AU/^(?:+61|0)[2-478](?:[ -]?[0-9]){8}$/+61412345678Australia phone number format
BRRX_PHONE_BR/^(?:+55|0)[1-9][1-9][0-9]{8,9}$/+55123456789Brazil phone number format
CARX_PHONE_CA/^(?:+1[-.●]?)?(?([2-9][0-8][0-9]))?[-.●]?([2-9][0-9]{2})[-.●]?([0-9]{4})$/+1-234-567-8901Canada phone number format
CNRX_PHONE_CN/^(?:+86)?1[3-9][0-9]{9}$/+8612345678901China phone number format
EGRX_PHONE_EG/^(?:+20|0)?1[0125]\d{8}$/+201234567890Egypt phone number format
FRRX_PHONE_FR/^(?:+33|0)[1-9](?:[ .-]?[0-9]{2}){4}$/+33123456789France phone number format
DERX_PHONE_DE/^(?:+49|0)[1-9][0-9]{1,4}[ -]?[0-9]{3,14}$/+4912345678901Germany phone number format
INRX_PHONE_IN/^(?:+91|0)?[6-9][0-9]{9}$/+911234567890India phone number format
IDRX_PHONE_ID/^(?:+62|0)[2-9]\d{7,11}$/+6212345678901Indonesia phone number format
ITRX_PHONE_IT/^(?:+39)?\s?3[1-9]\d{8}$/+393123456789Italy phone number format
JPRX_PHONE_JP/^(?:+81|0)[6-9]0[0-9]{8}$/+8190123456789Japan phone number format
MXRX_PHONE_MX/^(?:+52)?(1)?\s?\d{10}$/+521234567890Mexico phone number format
NGRX_PHONE_NG/^(?:+234|0)?[789]\d{9}$/+2348123456789Nigeria phone number format
RURX_PHONE_RU/^(?:+7|8)?[489][0-9]{9,10}$/+79123456789Russia phone number format
SARX_PHONE_SA/^(?:+966|0)?5\d{8}$/+966512345678Saudi Arabia phone number format
ZARX_PHONE_ZA/^(?:+27|0)[6-8][0-9]{8}$/+27812345678South Africa phone number format
KRRX_PHONE_KR/^(?:+82|0)?1[0-9]{9,10}$/+8210123456789South Korea phone number format
ESRX_PHONE_ES/^(?:+34)?\s?(6\d{1}|7[1-9])\d{7}$/+34612345678Spain phone number format
TRRX_PHONE_TR/^(?:+90|0)?5\d{9}$/+905123456789Turkey phone number format
UKRX_PHONE_UK/^(?:+44|0)7\d{9}$/+447123456789UK phone number format
USRX_PHONE_US/^(?:+1[-.●]?)?(?([2-9][0-8][0-9]))?[-.●]?([2-9][0-9]{2})[-.●]?([0-9]{4})$/+1-234-567-8901US phone number format
AFRX_PHONE_AF/^(?:+93|0)?[7-9]\d{8}$/+93712345678Afghanistan phone number format
ALRX_PHONE_AL/^(?:+355|0)?6\d{8}$/+35561234567Albania phone number format
DZRX_PHONE_DZ/^(?:+213|0)?[5-7]\d{8}$/+213612345678Algeria phone number format
ADRX_PHONE_AD/^(?:+376)?\d{6}$/+376123456Andorra phone number format
AORX_PHONE_AO/^(?:+244)?[29]\d{7,8}$/+244912345678Angola phone number format
AGRX_PHONE_AG/^(?:+1-268)?[0-9]{7}$/+1-2681234567Antigua and Barbuda phone number format
AMRX_PHONE_AM/^(?:+374|0)?(77|99|55|98|44)\d{6}$/+37477123456Armenia phone number format
ATRX_PHONE_AT/^(?:+43|0)?6\d{1,3}\d{6,10}$/+436123456789Austria phone number format
AZRX_PHONE_AZ/^(?:+994|0)?(50|51|55|70|77)\d{7}$/+994501234567Azerbaijan phone number format
BHRX_PHONE_BH/^(?:+973)?\d{8}$/+97312345678Bahrain phone number format
BDRX_PHONE_BD/^(?:+880|0)?1[3-9]\d{8}$/+8801312345678Bangladesh phone number format
BBRX_PHONE_BB/^(?:+1-246)?[0-9]{7}$/+1-2461234567Barbados phone number format
BYRX_PHONE_BY/^(?:+375|0)?(25|29|33|44)\d{7}$/+375291234567Belarus phone number format
BERX_PHONE_BE/^(?:+32|0)?4\d{8}$/+32412345678Belgium phone number format
BZRX_PHONE_BZ/^(?:+501)?[0-9]{7}$/+5011234567Belize phone number format
BJRX_PHONE_BJ/^(?:+229)?[0-9]{8}$/+22912345678Benin phone number format
BTRX_PHONE_BT/^(?:+975|0)?1[6789]\d{7}$/+97517123456Bhutan phone number format
BORX_PHONE_BO/^(?:+591|0)?[67]\d{7}$/+59161234567Bolivia phone number format
BARX_PHONE_BA/^(?:+387|0)?6\d{7,8}$/+38761234567Bosnia and Herzegovina phone number format
BWRX_PHONE_BW/^(?:+267)?[2-9]\d{7}$/+26771234567Botswana phone number format
BNRX_PHONE_BN/^(?:+673)?[2-9]\d{6,7}$/+6737123456Brunei phone number format
BGRX_PHONE_BG/^(?:+359|0)?8[7-9]\d{7}$/+359871234567Bulgaria phone number format
BFRX_PHONE_BF/^(?:+226)?[0-9]{8}$/+22612345678Burkina Faso phone number format
BIRX_PHONE_BI/^(?:+257)?[0-9]{8}$/+25712345678Burundi phone number format
KHRX_PHONE_KH/^(?:+855|0)?[1-9]\d{7,8}$/+85512345678Cambodia phone number format
CMRX_PHONE_CM/^(?:+237)?[2368]\d{8}$/+237612345678Cameroon phone number format
CVRX_PHONE_CV/^(?:+238)?[2-9]\d{6}$/+2389123456Cape Verde phone number format
CFRX_PHONE_CF/^(?:+236)?[2-7]\d{7}$/+23621234567Central African Republic phone number format
TDRX_PHONE_TD/^(?:+235)?[6-9]\d{7}$/+23561234567Chad phone number format
CLRX_PHONE_CL/^(?:+56|0)[2-9]\d{8}$/+56212345678Chile phone number format
CORX_PHONE_CO/^(?:+57|0)?[1-9]\d{7,9}$/+5712345678Colombia phone number format
KMRX_PHONE_KM/^(?:+269)?[3-7]\d{6}$/+2693123456Comoros phone number format
CRRX_PHONE_CR/^(?:+506)?[2-8]\d{7}$/+50621234567Costa Rica phone number format
HRRX_PHONE_HR/^(?:+385|0)?9[1-9]\d{6,7}$/+38591234567Croatia phone number format
CURX_PHONE_CU/^(?:+53|0)?[5-9]\d{7}$/+5351234567Cuba phone number format
CYRX_PHONE_CY/^(?:+357|0)?[9-9]\d{7}$/+35791234567Cyprus phone number format
CZRX_PHONE_CZ/^(?:+420)?[2-9]\d{8}$/+420212345678Czech Republic phone number format
DKRX_PHONE_DK/^(?:+45)?[2-9]\d{7}$/+4521234567Denmark phone number format
DJRX_PHONE_DJ/^(?:+253)?[2-7]\d{6}$/+2532123456Djibouti phone number format
DMRX_PHONE_DM/^(?:+1-767)?[0-9]{7}$/+1-7671234567Dominica phone number format
DORX_PHONE_DO/^(?:+1-809|1-829|1-849)?[0-9]{7}$/+1-8091234567Dominican Republic phone number format
ECRX_PHONE_EC/^(?:+593|0)?[2-9]\d{7,8}$/+59321234567Ecuador phone number format
SVRX_PHONE_SV/^(?:+503)?[2-7]\d{7}$/+50321234567El Salvador phone number format
GQRX_PHONE_GQ/^(?:+240)?[222-229]\d{6}$/+240222123456Equatorial Guinea phone number format
ERRX_PHONE_ER/^(?:+291)?[1-8]\d{6}$/+2917123456Eritrea phone number format
EERX_PHONE_EE/^(?:+372)?[2-7]\d{7,8}$/+37221234567Estonia phone number format
SZRX_PHONE_SZ/^(?:+268)?[7-9]\d{7}$/+26871234567Eswatini (Swaziland) phone number format
ETRX_PHONE_ET/^(?:+251|0)?[1-9]\d{8}$/+251912345678Ethiopia phone number format
FJRX_PHONE_FJ/^(?:+679)?[3-9]\d{6}$/+6793123456Fiji phone number format
FIRX_PHONE_FI/^(?:+358|0)?[4-9]\d{8,9}$/+358412345678Finland phone number format
GARX_PHONE_GA/^(?:+241)?[2-7]\d{6}$/+2412123456Gabon phone number format
GMRX_PHONE_GM/^(?:+220)?[2-9]\d{6}$/+2202123456Gambia phone number format
GERX_PHONE_GE/^(?:+995|0)?(5[79]|7[0-4]|7[67]|790)\d{7}$/+995591234567Georgia phone number format
GHRX_PHONE_GH/^(?:+233|0)?[2-9]\d{8}$/+233212345678Ghana phone number format
GRRX_PHONE_GR/^(?:+30|0)?(6[89]|[27])\d{8}$/+306123456789Greece phone number format
GDRX_PHONE_GD/^(?:+1-473)?[0-9]{7}$/+1-4731234567Grenada phone number format
GTRX_PHONE_GT/^(?:+502)?[2-8]\d{7}$/+50221234567Guatemala phone number format
GNRX_PHONE_GN/^(?:+224)?[2-9]\d{7}$/+22421234567Guinea phone number format
GWRX_PHONE_GW/^(?:+245)?[5-9]\d{6}$/+2455123456Guinea-Bissau phone number format
GYRX_PHONE_GY/^(?:+592)?[2-9]\d{6}$/+5922123456Guyana phone number format
HTRX_PHONE_HT/^(?:+509)?[2-9]\d{7}$/+50921234567Haiti phone number format
HNRX_PHONE_HN/^(?:+504)?[2-9]\d{7,8}$/+50421234567Honduras phone number format
HURX_PHONE_HU/^(?:+36|0)?[1-9]\d{8}$/+36123456789Hungary phone number format
ISRX_PHONE_IS/^(?:+354)?[3-9]\d{6,7}$/+35431234567Iceland phone number format
IRRX_PHONE_IR/^(?:+98|0)?[1-9]\d{8,9}$/+98123456789Iran phone number format
IQRX_PHONE_IQ/^(?:+964|0)?7\d{9}$/+964712345678Iraq phone number format
IERX_PHONE_IE/^(?:+353|0)?[1-9]\d{8}$/+353123456789Ireland phone number format
ILRX_PHONE_IL/^(?:+972|0)?5[012345689]\d{7}$/+9725123456789Israel phone number format
JMRX_PHONE_JM/^(?:+1-876)?[0-9]{7}$/+1-8761234567Jamaica phone number format
JORX_PHONE_JO/^(?:+962|0)?7[789]\d{7}$/+962791234567Jordan phone number format
KZRX_PHONE_KZ/^(?:+7|8)?7\d{9}$/+79123456789Kazakhstan phone number format
KERX_PHONE_KE/^(?:+254|0)?7\d{8}$/+254712345678Kenya phone number format
KIRX_PHONE_KI/^(?:+686)?[2-9]\d{4}$/+68621234Kiribati phone number format
KWRX_PHONE_KW/^(?:+965)?[569]\d{7}$/+96551234567Kuwait phone number format
KGRX_PHONE_KG/^(?:+996|0)?7[0-6]\d{6}$/+996712345678Kyrgyzstan phone number format
LARX_PHONE_LA/^(?:+856|0)?[5-9]\d{7,8}$/+85691234567Laos phone number format
LVRX_PHONE_LV/^(?:+371)?2\d{7}$/+37121234567Latvia phone number format
LBRX_PHONE_LB/^(?:+961|0)?3[0-9]\d{6}$/+9613123456Lebanon phone number format
LSRX_PHONE_LS/^(?:+266)?[5-9]\d{6}$/+2665123456Lesotho phone number format
LRRX_PHONE_LR/^(?:+231)?[2-7]\d{6}$/+2312123456Liberia phone number format
LYRX_PHONE_LY/^(?:+218|0)?9\d{7,9}$/+218912345678Libya phone number format
LIRX_PHONE_LI/^(?:+423)?[1-9]\d{6,7}$/+4231234567Liechtenstein phone number format
LTRX_PHONE_LT/^(?:+370)?6\d{7,8}$/+37061234567Lithuania phone number format
LURX_PHONE_LU/^(?:+352)?[1-9]\d{8}$/+35212345678Luxembourg phone number format
MGRX_PHONE_MG/^(?:+261|0)?3[0-9]\d{7}$/+261321234567Madagascar phone number format
MWRX_PHONE_MW/^(?:+265|0)?[1-9]\d{8}$/+26512345678Malawi phone number format
MYRX_PHONE_MY/^(?:+60|0)?1[0-9]\d{7,8}$/+60123456789Malaysia phone number format
MVRX_PHONE_MV/^(?:+960)?[1-9]\d{6,7}$/+9601234567Maldives phone number format
MLRX_PHONE_ML/^(?:+223)?[1-9]\d{7,8}$/+22312345678Mali phone number format
MTRX_PHONE_MT/^(?:+356)?[1-9]\d{7,8}$/+35612345678Malta phone number format
MHRX_PHONE_MH/^(?:+692)?[1-9]\d{4,6}$/+692123456Marshall Islands phone number format
MRRX_PHONE_MR/^(?:+222)?[1-9]\d{6,7}$/+22212345678Mauritania phone number format
MURX_PHONE_MU/^(?:+230)?[1-9]\d{7}$/+2301234567Mauritius phone number format
FMRX_PHONE_FM/^(?:+691)?[1-9]\d{4,6}$/+6911234Micronesia phone number format
MDRX_PHONE_MD/^(?:+373|0)?[1-9]\d{7,8}$/+37312345678Moldova phone number format
MCRX_PHONE_MC/^(?:+377)?[1-9]\d{6,7}$/+3771234567Monaco phone number format
MNRX_PHONE_MN/^(?:+976|0)?[1-9]\d{7,8}$/+97612345678Mongolia phone number format
MERX_PHONE_ME/^(?:+382|0)?[1-9]\d{7,8}$/+38212345678Montenegro phone number format
MARX_PHONE_MA/^(?:+212|0)?[5-9]\d{8}$/+212612345678Morocco phone number format
MZRX_PHONE_MZ/^(?:+258|0)?[1-9]\d{7,8}$/+25812345678Mozambique phone number format
MMRX_PHONE_MM/^(?:+95|0)?[1-9]\d{8}$/+95123456789Myanmar phone number format
NARX_PHONE_NA/^(?:+264|0)?[1-9]\d{7,8}$/+26412345678Namibia phone number format
NRRX_PHONE_NR/^(?:+674)?[1-9]\d{4,6}$/+6741234Nauru phone number format
NPRX_PHONE_NP/^(?:+977|0)?[1-9]\d{7,8}$/+97712345678Nepal phone number format
NLRX_PHONE_NL/^(?:+31|0)?[1-9]\d{8,9}$/+31123456789Netherlands phone number format
NZRX_PHONE_NZ/^(?:+64|0)?[2-9]\d{7,9}$/+64212345678New Zealand phone number format
NIRX_PHONE_NI/^(?:+505)?[1-9]\d{7,8}$/+50512345678Nicaragua phone number format
NERX_PHONE_NE/^(?:+227)?[1-9]\d{7,8}$/+22712345678Niger phone number format
MKRX_PHONE_MK/^(?:+389|0)?[1-9]\d{7,8}$/+38912345678North Macedonia phone number format
NORX_PHONE_NO/^(?:+47)?[1-9]\d{7,8}$/+4712345678Norway phone number format
OMRX_PHONE_OM/^(?:+968)?[1-9]\d{7,8}$/+96812345678Oman phone number format
PKRX_PHONE_PK/^(?:+92|0)?3[0-9]\d{8}$/+923456789012Pakistan phone number format
PWRX_PHONE_PW/^(?:+680)?[1-9]\d{4,6}$/+6801234Palau phone number format
PARX_PHONE_PA/^(?:+507)?[1-9]\d{7,8}$/+50712345678Panama phone number format
PGRX_PHONE_PG/^(?:+675)?[1-9]\d{7,8}$/+67512345678Papua New Guinea phone number format
PYRX_PHONE_PY/^(?:+595|0)?[1-9]\d{7,8}$/+59512345678Paraguay phone number format
PERX_PHONE_PE/^(?:+51|0)?[1-9]\d{7,8}$/+5112345678Peru phone number format
PHRX_PHONE_PH/^(?:+63|0)?9[0-9]\d{7,8}$/+639123456789Philippines phone number format
PLRX_PHONE_PL/^(?:+48|0)?[1-9]\d{8,9}$/+48123456789Poland phone number format
PTRX_PHONE_PT/^(?:+351)?[1-9]\d{8,9}$/+351123456789Portugal phone number format
QARX_PHONE_QA/^(?:+974)?[1-9]\d{7,8}$/+97412345678Qatar phone number format
RORX_PHONE_RO/^(?:+40|0)?7[0-9]\d{8}$/+40712345678Romania phone number format
RWRX_PHONE_RW/^(?:+250)?[1-9]\d{7,8}$/+25012345678Rwanda phone number format
KNRX_PHONE_KN/^(?:+1-869)?[0-9]{7}$/+1-8691234567Saint Kitts and Nevis phone number format
LCRX_PHONE_LC/^(?:+1-758)?[0-9]{7}$/+1-7581234567Saint Lucia phone number format
VCRX_PHONE_VC/^(?:+1-784)?[0-9]{7}$/+1-7841234567Saint Vincent and the Grenadines phone number format
WSRX_PHONE_WS/^(?:+685)?[1-9]\d{5,7}$/+6851234567Samoa phone number format
SMRX_PHONE_SM/^(?:+378)?[1-9]\d{5,7}$/+3781234567San Marino phone number format
STRX_PHONE_ST/^(?:+239)?[1-9]\d{6,7}$/+23912345678Sao Tome and Principe phone number format
SNRX_PHONE_SN/^(?:+221)?[1-9]\d{7,8}$/+221123456789Senegal phone number format
RSRX_PHONE_RS/^(?:+381|0)?6[0-9]\d{6,7}$/+38161234567Serbia phone number format
SCRX_PHONE_SC/^(?:+248)?[1-9]\d{6,7}$/+2481234567Seychelles phone number format
SLRX_PHONE_SL/^(?:+232)?[1-9]\d{6,7}$/+2321234567Sierra Leone phone number format
SGRX_PHONE_SG/^(?:+65)?[1-9]\d{7,8}$/+6512345678Singapore phone number format
SKRX_PHONE_SK/^(?:+421|0)?[1-9]\d{8,9}$/+421212345678Slovakia phone number format
SIRX_PHONE_SI/^(?:+386|0)?[1-9]\d{7,8}$/+38612345678Slovenia phone number format
SBRX_PHONE_SB/^(?:+677)?[1-9]\d{5,7}$/+6771234567Solomon Islands phone number format
SORX_PHONE_SO/^(?:+252)?[1-9]\d{7,8}$/+25212345678Somalia phone number format
LKRX_PHONE_LK/^(?:+94|0)?7[0-9]\d{7}$/+94712345678Sri Lanka phone number format
SDRX_PHONE_SD/^(?:+249|0)?9[0-9]\d{7}$/+249912345678Sudan phone number format
SRRX_PHONE_SR/^(?:+597)?[1-9]\d{6,7}$/+5971234567Suriname phone number format
SERX_PHONE_SE/^(?:+46|0)?7[0-9]\d{8}$/+46712345678Sweden phone number format
CHRX_PHONE_CH/^(?:+41|0)?7[0-9]\d{8}$/+41712345678Switzerland phone number format
SYRX_PHONE_SY/^(?:+963|0)?9[0-9]\d{7}$/+963912345678Syria phone number format
TJRX_PHONE_TJ/^(?:+992|0)?9[0-9]\d{8}$/+992912345678Tajikistan phone number format
TZRX_PHONE_TZ/^(?:+255|0)?7[0-9]\d{8}$/+255712345678Tanzania phone number format
THRX_PHONE_TH/^(?:+66|0)?[1-9]\d{8}$/+66123456789Thailand phone number format
TLRX_PHONE_TL/^(?:+670)?7[0-9]\d{6,7}$/+67071234567Timor-Leste phone number format
TGRX_PHONE_TG/^(?:+228)?[9]\d{7}$/+22891234567Togo phone number format
TORX_PHONE_TO/^(?:+676)?[1-9]\d{4,6}$/+67612345Tonga phone number format
TTRX_PHONE_TT/^(?:+1-868)?[0-9]{7}$/+1-8681234567Trinidad and Tobago phone number format
TNRX_PHONE_TN/^(?:+216|0)?[2-9]\d{7}$/+21621234567Tunisia phone number format
TMRX_PHONE_TM/^(?:+993|0)?[1-9]\d{7}$/+99312345678Turkmenistan phone number format
TVRX_PHONE_TV/^(?:+688)?[1-9]\d{4,6}$/+6881234Tuvalu phone number format
UGRX_PHONE_UG/^(?:+256|0)?[7-9]\d{8}$/+256712345678Uganda phone number format
UARX_PHONE_UA/^(?:+380|0)?[3-9]\d{8}$/+380912345678Ukraine phone number format
AERX_PHONE_AE/^(?:+971|0)?5[024568]\d{7}$/+971501234567United Arab Emirates phone number format
UYRX_PHONE_UY/^(?:+598|0)?9[1-9]\d{6,7}$/+59891234567Uruguay phone number format
UZRX_PHONE_UZ/^(?:+998|0)?[1-9]\d{7,8}$/+998912345678Uzbekistan phone number format
VURX_PHONE_VU/^(?:+678)?[5-7]\d{5}$/+67851234Vanuatu phone number format
VARX_PHONE_VA/^(?:+379)?[0-9]{6,11}$/+37912345678Vatican City phone number format
VERX_PHONE_VE/^(?:+58|0)?4[1-9]\d{7}$/+584123456789Venezuela phone number format
VNRX_PHONE_VN/^(?:+84|0)?[1-9]\d{8,9}$/+84123456789Vietnam phone number format
YERX_PHONE_YE/^(?:+967|0)?[1-9]\d{7,8}$/+96712345678Yemen phone number format
ZMRX_PHONE_ZM/^(?:+260|0)?[1-9]\d{8,9}$/+260123456789Zambia phone number format
ZWRX_PHONE_ZW/^(?:+263|0)?[1-9]\d{8,9}$/+263123456789Zimbabwe phone number format
Last Updated:
Contributors: parsajiravand