Skip to main content
AllDevToolsHub
Back to all patterns

Phone Number (E.164 International)

Validation

Validates international phone numbers in E.164 format (e.g. +14155552671).

/^\+[1-9]\d{1,14}$/

How it works

E.164 is the ITU-T standard for international phone numbers. It starts with a + sign, followed by a country code (1–3 digits) and subscriber number, with a total maximum of 15 digits. This format is required by most SMS and telephony APIs.

Test Cases

Should Match

  • +14155552671
  • +447911123456
  • +919876543210

Should NOT Match

  • 14155552671
  • +0123456789
  • +1234567890123456

Quick Summary

Validates phone numbers in E.164 international format: a leading + followed by 2–15 digits with no spaces, dashes, or parentheses. Required by Twilio, AWS SNS, and most telephony APIs.

Key Takeaways

Key Takeaways

  • E.164 format: + followed by country code and subscriber number, max 15 digits total
  • No spaces, dashes, or parentheses allowed, strip formatting before validating
  • Country code cannot start with 0 (enforced by [1-9] after the +)
  • Use a library like libphonenumber-js for locale-aware validation and formatting
Use Cases

When to use it

  • Validating phone inputs before sending SMS via Twilio or AWS SNS
  • Normalizing phone numbers in a CRM or contact database
  • API input validation for international phone fields
Watch out

Common Mistakes

  • Validating formatted numbers like (415) 555-2671, strip all non-digit characters first
  • Assuming E.164 validation guarantees the number is active or assigned
  • Not handling the + prefix, some systems strip it before storage
FAQ

Phone Number (E.164 International), Frequently Asked

How do I convert a US number like (415) 555-2671 to E.164?

Strip all non-digit characters, then prepend the country code: +1 + 4155552671 = +14155552671.

What library should I use for full phone validation?

libphonenumber-js (JavaScript) or Google's libphonenumber (Java/Python) validate number length and range per country.