Regex for international phone number (E.164)

Use /^\+[1-9]\d{1,14}$/ to check that a whole string is a valid for international phone number (E.164). Every example below is tested against the pattern, and you can open it in the Regex Tester with the samples preloaded.

Updated

/^\+[1-9]\d{1,14}$/
Open in Regex Tester
InputResult
+14155550199✓ Match
+442071838750✓ Match
+919876543210✓ Match
14155550199✗ No match
+0123456789✗ No match
+1 415 555 0199✗ No match
+1234567890123456✗ No match

How the pattern works

PartMeaning
^\+Starts with a plus sign
[1-9]Country codes never start with 0
\d{1,14}Up to 14 more digits — E.164 allows 15 digits in total
$End of the string, so no spaces or dashes

Code examples

JavaScript

const re = /^\+[1-9]\d{1,14}$/;
re.test(value); // true or false

Python

import re

bool(re.fullmatch(r'\+[1-9]\d{1,14}', value))

PHP

preg_match('/^\+[1-9]\d{1,14}$/', $value) === 1;

Notes and limitations

E.164 is the format Twilio, WhatsApp and most SMS APIs expect. Strip spaces, dashes and parentheses before testing, and add the country code if the user left it out.

Regex TesterType a pattern and watch matches highlight live in your test text.
Open the tool

Frequently asked questions

What is the regex for international phone number (E.164)?
/^\+[1-9]\d{1,14}$/ — it matches the whole string. See the table above for what each part does.
Which examples match?
Of the examples tested, these match: +14155550199, +442071838750, +919876543210. The others don’t.
How do I test this regex?
Click “Open in Regex Tester” — the pattern, flags and sample text load automatically, and matches highlight as you edit.