Regex Tester & DebuggerSpecialized Version
🔍

SSN Regex Tester

SSN Regex Tester

//g
Flags:
Examples:

SSN Regex Tester

Test and validate ssn patterns with this specialized regex tester. Includes tested patterns and real-time matching.

Recommended Ssn Pattern

``regex ^\d{3}-\d{2}-\d{4}$ `

Test Examples

Valid matches:

  • 123-45-6789
  • 000-00-0000
  • 999-99-9999
Invalid (should not match):
  • 123456789
  • 123-456-789
  • 12-345-6789

Pattern Explanation

Matches US Social Security Number format (XXX-XX-XXXX)

Alternative Patterns

1. ^\d{9}$ 2. ^\d{3}[- ]?\d{2}[- ]?\d{4}$`

How to Use

1. The pattern above is preloaded—or enter your own 2. Add test strings to validate 3. See real-time match highlights 4. Copy the pattern for your code

Regex Quick Reference

| Symbol | Meaning | Example | \dAny digit\d{3} matches "123" \wWord character\w+ matches "hello" +One or morea+ matches "aaa" *Zero or morea* matches "" or "aaa" ?Optionalcolou?r matches "color" ^Start of string^Hello $End of stringworld$ [abc]Character class[aeiou] matches vowels (ab)Alternation(catdog) matches either

Frequently Asked Questions

Are all matching numbers valid SSNs?

No. SSA doesn't issue numbers starting with 9, 000, or 666. Area numbers 734-749 are unassigned. This pattern only validates format.

What regex flavor does this use?

This tester uses JavaScript regex (ECMAScript). Most patterns work the same in Python, Java, and other languages.

Related Tools

Explore other tools you might find useful:

Related Calculators