International Phone Number Validation Regex (E.164 Format)
• CronOS Team
regexphonevalidationtutorialinternationale164
Need to generate a regex pattern?
Use CronOS to generate any regex pattern you wish with natural language. Simply describe what you need, and we'll create the perfect regex pattern for you. It's completely free!
International Phone Number Validation Regex (E.164 Format)
Validate international phone numbers in E.164 format: starts with +, followed by country code and subscriber number (1-15 digits total).
Pattern Breakdown
regex
^\+[1-9]\d{1,14}$
Components
| Component | Description | Matches |
|---|---|---|
^ | Start anchor | Ensures match from string start |
\+ | Plus sign | Literal + character (escaped) |
[1-9] | Country code start | First digit must be 1-9 (not 0) |
\d{1,14} | Remaining digits | 1 to 14 more digits |
$ | End anchor | Ensures match to string end |
Character Classes
\+- Literal plus sign (escaped, since+is a quantifier)[1-9]- First digit must be 1-9 (country codes don't start with 0)\d- Any digit (0-9){1,14}- Quantifier: between 1 and 14 occurrences (total length 1-15 digits after +)
Examples
Valid:
+15551234567(US)+442071234567(UK)+33123456789(France)+8613800138000(China)+123456789012345(15 digits - maximum length)+12(minimum: country code + 1 digit)
Invalid:
15551234567(missing + sign)+05551234567(country code can't start with 0)+1555123456789012345(too long, 16 digits after +)+(no digits)+1-555-123-4567(contains formatting characters)+1 555 123 4567(contains spaces)
Implementation
JavaScript
javascript
const phoneRegex = /^\+[1-9]\d{1,14}$/;
phoneRegex.test('+15551234567'); // true
phoneRegex.test('+442071234567'); // true
phoneRegex.test('15551234567'); // false (missing +)
phoneRegex.test('+05551234567'); // false (starts with 0)
Python
python
import re
phone_regex = r'^\+[1-9]\d{1,14}$'
bool(re.match(phone_regex, '+15551234567')) # True
bool(re.match(phone_regex, '+442071234567')) # True
bool(re.match(phone_regex, '15551234567')) # False (missing +)
Go
go
phoneRegex := regexp.MustCompile(`^\+[1-9]\d{1,14}$`)
phoneRegex.MatchString("+15551234567") // true
phoneRegex.MatchString("+442071234567") // true
phoneRegex.MatchString("15551234567") // false (missing +)
Limitations
- No formatting: E.164 format doesn't allow spaces, dashes, or parentheses
- No country code validation: Doesn't verify if country code is valid
- No subscriber number validation: Doesn't check if number is valid for that country
- Length only: Only validates format, not actual number validity
- No extension support: E.164 doesn't include extensions
When to Use
- International phone number input
- SMS/MMS systems that require E.164 format
- VoIP applications
- Global applications supporting multiple countries
- When you need standardized phone number format
For production, consider:
- Using a library like
libphonenumberfor full validation - Validating country codes against known list
- Formatting display version for users while storing E.164
- Handling country-specific number length requirements
Need to generate a regex pattern?
Use CronOS to generate any regex pattern you wish with natural language. Simply describe what you need, and we'll create the perfect regex pattern for you. It's completely free!