Regex for International Phone Number
This regex matches international phone numbers following the E.164 standard. It allows an optional leading plus sign followed by a country code and subscriber number totaling up to 15 digits. The E.164 format is the most universally accepted phone number format and is used by services like Twilio and most telephony APIs.
^\+?[1-9]\d{1,14}$ What is the regex pattern for International Phone Number?
The regex pattern for International Phone Number is ^\+?[1-9]\d{1,14}$. This regex matches international phone numbers following the E.164 standard. It allows an optional leading plus sign followed by a country code and subscriber number totaling up to 15 digits. The E.164 format is the most universally accepted phone number format and is used by services like Twilio and most telephony APIs. This pattern is commonly used for international form validation and sms api input formatting.
Test Examples
+442071234567 +442071234567 +14155552671 +14155552671 +8613800138000 +8613800138000 Common Uses
- ✓ International form validation
- ✓ SMS API input formatting
- ✓ Phone number normalization
- ✓ Database storage format
Variations
With spaces
^\+?[1-9]\d{0,2}[\s-]?\d{1,14}$ Allows a space or dash after country code
Grouped format
^\+?\d{1,3}[-.\s]?\d{1,4}[-.\s]?\d{1,4}[-.\s]?\d{1,9}$ Matches numbers grouped with separators
E.164 strict
^\+[1-9]\d{1,14}$ Requires the plus sign prefix
Frequently Asked Questions
What is E.164 format?
E.164 is the international telephone numbering plan that defines a maximum of 15 digits starting with a country code. It is the standard format used by most telephony APIs and international calling systems.
Should I store phone numbers in E.164 format?
Yes. E.164 is the recommended storage format because it is unambiguous and globally unique. Convert user-entered numbers to E.164 before storing them in your database.
Why does this not allow parentheses or dashes?
E.164 is a strict format meant for machine processing, not display. Formatting characters like parentheses and dashes should be added at display time based on the user's locale.