Regex Pattern Library

Phone Number (US/International)

Match US and international phone numbers with optional country code and separators.

What Is This?

This regex pattern validates US phone numbers with optional international format. It supports optional +1 country code, area code in parentheses or without, and flexible separators (dots, hyphens, spaces). It matches standard 10-digit US phone numbers with or without formatting.

How to Use This Pattern

1

Pattern

^\+?1?[-.\s]?\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}$

^\+?1?[-.\s]?\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}$
2

Usage

The pattern is designed for North American numbering plan numbers (NANP). The country code (+1) is optional. The area code (3 digits) can be surrounded by parentheses. The remaining 7 digits can be separated by dots, hyphens, spaces, or no separator.

Examples

Common US formats

Matches: (555) 123-4567, 555-123-4567, 555.123.4567, +1 555-123-4567. Non-matches: 123-4567, 555-123-456, +44 20 7946 0958

With international prefix

Matches: +15551234567, 1-555-123-4567, +1 (555) 123-4567. Non-matches: 555-123-45678, text, +12 345 678 9012

Related Entries

More from this reference:

Frequently Asked Questions

Does this work for non-US phone numbers?

No. International phone number formats vary significantly by country. For international validation, use a library like libphonenumber (Google) which maintains up-to-date formatting rules for every country.

Should I store formatted or unformatted phone numbers?

Store phone numbers in E.164 format (+1XXXXXXXXXX) without separators. This normalized format is universally accepted and makes it easy to validate, compare, and format for display.