US Social Security Number
Detects US Social Security Numbers (SSNs) in both formatted (XXX-XX-XXXX) and unformatted (XXXXXXXXX) representations. The pattern excludes invalid SSN ranges including area numbers 000, 666, and 900-999, group numbers 00, and serial numbers 0000, in accordance with SSA assignment rules. SSNs are critical PII used across healthcare, financial, and government contexts.
- Type
- regex
- Engine
- boost_regex
- Confidence
- high
- Confidence justification
- The pattern enforces SSA-defined exclusion rules for invalid area, group, and serial numbers, significantly reducing false positives. Combined with corroborative keyword proximity, this provides high-confidence detection of genuine SSNs.
- Detection quality
- Verified
- Jurisdictions
- us
- Regulations
- CCPA/CPRA, GLBA, HIPAA, SOX
- Frameworks
- ISO 27001, ISO 27701, PCI-DSS
- Data categories
- pii, phi, government-id
- Scope
- narrow
- Risk rating
- 9
- Platform compatibility
- Purview: Compatible, GCP DLP: Unsupported, Macie: Unsupported, Zscaler: Compatible, Palo Alto: Unsupported, Netskope: Unsupported
Pattern
\b(?!000|666|9\d{2})\d{3}[-\s](?!00)\d{2}[-\s](?!0000)\d{4}\b
Corroborative evidence keywords
social security, SSN, social security number, SS#, soc sec, ID number, identification, ID card, license, permit, registration, certificate, address, age, birthday, citizenship, city, date of birth, DOB, email (+21 more)
Proximity: 300 characters
Should match
123-45-6789— Standard hyphen-delimited SSN format123 45 6789— Space-delimited SSN format123456789— Unformatted nine-digit SSN
Should not match
000-12-3456— Area number 000 is never assigned by SSA666-12-3456— Area number 666 is never assigned by SSA900-12-3456— Area numbers 900-999 are reserved and not valid SSNs123-00-6789— Group number 00 is never assigned by SSA
Known false positives
- Random nine-digit numbers without context may match the pattern Mitigation: Require corroborative keyword proximity (e.g., 'SSN', 'social security') within 300 characters to confirm the match as a genuine SSN