What Is a Regex for US Phone Number Validation?
US phone regex: ^\+?1?\s*\(?[0-9]{3}\)?[-.\s]*[0-9]{3}[-.\s]*[0-9]{4}$. This pattern matches the most common US phone number formats including (555) 123-4567, 555-123-4567, +1 555 123 4567, and 5551234567.
Formats Matched
(555) 123-4567555-123-4567555.123.45675551234567+1 (555) 123-4567+155512345671-555-123-4567
Breaking Down the Pattern
| Part | Meaning |
|---|---|
^\+?1? | Optional country code +1 |
\s*\(? | Optional whitespace and opening paren |
[0-9]{3} | 3-digit area code |
\)?[-.\s]* | Optional closing paren, separator |
[0-9]{3} | 3-digit exchange |
[-.\s]*[0-9]{4}$ | Separator + 4-digit subscriber number |
Usage Examples
JavaScript
const phoneRegex = /^\+?1?\s*\(?[0-9]{3}\)?[-.\s]*[0-9]{3}[-.\s]*[0-9]{4}$/;
phoneRegex.test('(555) 123-4567'); // true
phoneRegex.test('+15551234567'); // true
phoneRegex.test('123'); // false
Better Alternative: libphonenumber
For production use, consider Google's libphonenumber library which handles international numbers, validates area codes, and formats numbers correctly.
Try It Yourself
Test this regex with our Regex Tester.