Skip to content

Regex for International Phone Numbers — Pattern Explained with Examples

DodaTech Updated 2026-06-20 2 min read

In this tutorial, you'll learn about Regex for International Phone Numbers. We cover key concepts, practical examples, and best practices to help you understand and apply this topic effectively.

International phone number validation is critical for global applications. The E.164 standard defines a max 15-digit format starting with a country code. This pattern validates that a number has the correct basic structure: a plus sign, a valid country code digit, and up to 14 additional digits.

The Pattern

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

Pattern Breakdown

Part Meaning
^ Start-of-string anchor
\+ Leading plus sign (required)
[1-9] Country code starts with a non-zero digit
\d{1,14} Remaining digits — 1 to 14 of them (total max 15)
$ End-of-string anchor

Matches

  • +14155551234
  • +442071838750
  • +911234567890
  • +61299999999
  • +33123456789

Does NOT Match

  • 555-1234 (no plus sign or country code)
  • +1555 (too few digits after country code)
  • 0014155551234 (uses 00 prefix instead of +)
  • +1(415)555-1234 (contains non-digit characters)
  • +abc123 (contains letters)

Language Examples

JavaScript

const intlPhoneRegex = /^\+[1-9]\d{1,14}$/;
console.log(intlPhoneRegex.test('+14155551234'));  // true
console.log(intlPhoneRegex.test('555-1234'));       // false

Python

import re
pattern = r'^\+[1-9]\d{1,14}$'
print(bool(re.match(pattern, '+14155551234')))   # True
print(bool(re.match(pattern, '555-1234')))        # False

Go

package main

import (
	"fmt"
	"regexp"
)

func main() {
	re := regexp.MustCompile(`^\+[1-9]\d{1,14}$`)
	fmt.Println(re.MatchString("+14155551234"))  // true
	fmt.Println(re.MatchString("555-1234"))       // false
}

Common Pitfalls

  • Country codes vary from 1 to 4 digits — this pattern does not validate specific country codes
  • E.164 limits the total number to 15 digits including the country code, but some countries have shorter local numbers
  • Phone number extensions are non-standard globally and require separate handling
  • Local formatting conventions (spaces, parentheses, dashes) must be stripped before validation

Real-World Use Cases

  • Global SaaS signup forms — accept user phone numbers from any country for account creation
  • SMS notification systems — validate numbers before sending international messages via third-party APIs
  • Contact synchronization — normalize phone data from global address books into a uniform E.164 format

FAQ

What is E.164 and why should I use it?

E.164 is the ITU-T international phone numbering standard. It limits numbers to 15 digits with a leading + and country code. Using it guarantees interoperability with telecom APIs and SMS providers.

How do I handle local number formats before validation?

Strip all spaces, dashes, parentheses, and dots first using a regex replace like number.replace(/[\\s\\-().]/g, ''). Then validate the cleaned string against the E.164 pattern.

Regex for US Phone Numbers Regex for Email

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro