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
The Pattern
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.
/^\+?1?[-.\s]?\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}$/Examples
Common US formats
Matches: (555) 123-4567 555-123-4567 555.123.4567 +1 555-123-4567 Does not match: 123-4567 555-123-456 +44 20 7946 0958
With international prefix
Matches: +15551234567 1-555-123-4567 +1 (555) 123-4567 Does not match: 555-123-45678 text +12 345 678 9012
Related Entries
More from this reference:
Email Address Validation
Validate email addresses with a standard pattern covering most common formats.
URL Pattern
Match HTTP and HTTPS URLs with optional port, path, query string, and fragment.
Date (YYYY-MM-DD)
Match dates in ISO 8601 YYYY-MM-DD format with basic month and day validation.
Credit Card Number (Generic)
Match generic credit card numbers in grouped or continuous 16-digit format.
UUID v4
Match UUID v4 identifiers with the standard 8-4-4-4-12 hex format and version check.
Base64 Encoded String
Match standard Base64 encoded strings with optional padding.
Time (HH:MM 24-hour)
Match times in 24-hour HH:MM format with valid hour and minute ranges.
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.