regexhelper
Test a pattern. Copy a ready-made one. No signup.

Regex to Validate a US Phone Number

Copy the pattern, paste your numbers below, and see which ones match. Below the tester: which formats it accepts and how to lock it to one.

/ /

What this pattern matches

This matches US 10-digit phone numbers written the way people really write them: with or without parentheses, spaces, dots, or dashes, and with an optional +1 or 1 prefix.

How it works, part by part

(?:\+?1[\s.-]?)? — an optional country code, +1 or 1.

\(?\d{3}\)? — the three-digit area code, parentheses optional.

[\s.-]? — an optional space, dot, or dash separator.

\d{3}[\s.-]?\d{4} — the 3-digit prefix and 4-digit line number.

Accepting fewer formats

This is deliberately permissive so it finds numbers inside messy text. For a strict form field, anchor it with ^…$ and remove the separators you do not allow.

FAQ

Does it accept the +1 country code?

Yes, but it is optional. Both +1 415 555 2671 and 415-555-2671 match.

Will it reject a 7-digit number?

Yes. It requires a 3-digit area code plus 7 more digits, so 555-2671 alone will not match.

How do I validate a single field strictly?

Wrap it in ^ and $ so the whole input must be the number, not just contain one.