Phone Number Regex
A phone number pattern covering compact E.164 numbers and the common US formats, pre-loaded in the tester. Below it, a table shows what it accepts and rejects, and what to normalise before you test.
What this phone number pattern accepts and rejects
The pattern has two alternatives joined by |: a compact international form (an optional +, a first digit 1-9, then up to 14 more digits, as in E.164) and the US forms (555) 234-5678 and 555-987-6543. It checks shape only: it does not strip spaces, and it cannot tell whether a number exists.
Each input below was tested on its own against the pattern above when this page was built, with no flags, so ^ and $ anchor the whole value. Paste any of them into the tester to see the same result.
| Input | Result | Why it matters |
|---|---|---|
+16176803278 | Matches | E.164: plus sign, country code and number, no separators. |
(555) 234-5678 | Matches | US form with parentheses. |
(555)234-5678 | Matches | The space after the area code is optional. |
555-987-6543 | Matches | US form with dashes. |
5552345678 | Matches | Ten bare digits pass through the international alternative, because the plus sign is optional. |
12 | Matches | Accepted: that alternative allows as few as two digits, so a match alone does not prove a usable number. Add a minimum length if that matters. |
+44 20 7946 0958 | No match | Rejected: international numbers are usually written with spaces, and the pattern does not allow them. Strip spaces before testing. |
555.234.5678 | No match | Rejected: dots are not an accepted separator. |
1-555-234-5678 | No match | Rejected: a leading 1- country code is not part of the US alternative. |
+0123456 | No match | Rejected: country codes never start with 0. |
More from RegexCalc
Guides
Frequently Asked Questions
Why does this regex reject +44 20 7946 0958?
Because the international alternative allows digits only, and international numbers are usually written with spaces. Remove spaces, dots and dashes before testing: the same number written as +442079460958 matches.
Does a match mean the phone number is real?
No. The pattern checks shape only: its international alternative accepts anything from 2 to 15 digits, so even 12 matches. Use a phone number library or a confirmation code if the number has to work.