piidetectionapi.com
Home
Solutions - Fundamentals
What Is PII Detection? NER vs Regex vs Rules Accuracy, Precision & Recall PII in Test Data
Solutions - Compliance
GDPR Personal Data HIPAA PHI Detection CCPA / CPRA PCI DSS Card Data
Solutions - AI & LLM Safety
LLM Guardrails Chatbot PII Filtering RAG Pipelines
Solutions - Data Discovery & DLP
Data Loss Prevention Log File Scanning Support Tickets Email Scanning Documents & PDFs Database Discovery ETL & Streaming Pipelines
Industries - Financial
Banking Fintech Insurance
Industries - Healthcare
Healthcare Pharma & Clinical Trials Telehealth
Industries - Public Sector & Legal
Government & FOIA Law Enforcement Law Firms & eDiscovery Education (FERPA)
Industries - Technology
SaaS Platforms Cybersecurity & IR Telecommunications Gaming & Platforms
Industries - Other
HR & Recruiting Retail & E-commerce Call Centers & BPO Real Estate Travel & Hospitality Marketing & AdTech
How-to Guides - Identity & Contact
Detect Names Detect Email Addresses Detect Phone Numbers Detect Physical Addresses Detect Dates of Birth
How-to Guides - IDs & Financial
Detect SSNs Detect Passport Numbers Detect Drivers Licenses Detect Credit Card Numbers Detect Bank Accounts & IBAN
How-to Guides - Technical & Health
Detect IP & Device IDs Detect Medical Records & PHI
Resources
Pricing API Docs Supported Entities Languages About Contact Sign In Try the Live Demo Get Started
How-To Guide

How to Detect Social Security Numbers in Text

Learn how to find, classify, and locate US Social Security Numbers in free text, logs, documents, and support conversations using PII Detection API. Handle every SSN format, apply SSA validation rules, and tell real SSNs apart from ITINs, EINs, and lookalike digit strings.

12 min read
cURL, Python & JavaScript examples
Updated August 2026

Overview

The US Social Security Number is arguably the single most damaging piece of PII an organization can leak. A name can be looked up, an email address can be changed, but an SSN follows a person for life and is the master key to credit applications, tax filings, medical accounts, and government benefits. That is why nearly every US privacy and security framework — from state breach notification statutes to GLBA and HIPAA — treats the SSN as a top-tier identifier that must be found, inventoried, and protected wherever it appears.

The problem is that SSNs rarely sit neatly in a database column labeled ssn. They show up pasted into support tickets, dictated into call transcripts, embedded in scanned tax forms, dropped into application logs by a careless debug statement, and typed into chat messages sent to your LLM-powered assistant. PII Detection API scans unstructured text and returns every SSN it finds as a structured entity: the entity type SSN, the matched text, exact character offsets, and a confidence score — plus an optional masked version of the input if you want detection and redaction in a single call.

Input Text
Applicant Maria Torres, SSN 545-81-2094, requested a copy of her W-2. Her spouse's social is 545 81 3310.
Detection Result (mask_mode: replace)
Applicant Maria Torres, SSN [SSN], requested a copy of her W-2. Her spouse's social is [SSN].

Unlike simple pattern matchers, the API uses context-aware transformer models, so it detects SSNs written with hyphens, spaces, or no separators at all, catches numbers introduced only by context ("her social is..."), and rejects nine-digit strings that are actually order IDs, ZIP+4 fragments, or phone number pieces. It is one of more than 150 entity types the service recognizes — see the full entity type catalog — and it works alongside related identifiers such as NATIONAL_ID and TAX_ID for non-US documents in 60+ languages.

Every Format
Hyphenated, spaced, unformatted, labeled, and partial SSNs
SSA Validation Built In
Impossible area, group, and serial ranges are filtered out automatically
Context-Aware
Distinguishes SSNs from ITINs, EINs, phone fragments, and IDs

Why SSN Detection Is High-Stakes

Most PII carries some risk when exposed. SSNs carry catastrophic risk, and regulators price that risk accordingly. Understanding the legal landscape explains why SSN discovery is usually the first requirement in any data protection program — and why "we didn't know it was in that log file" is never an accepted defense.

Identity Theft and Fraud

An SSN paired with a name and date of birth is sufficient to open credit lines, file fraudulent tax returns, claim unemployment benefits, and commit medical identity fraud. Because the SSA almost never reissues numbers, a victim cannot simply "rotate" a compromised SSN the way they would a password. The FTC consistently ranks SSN misuse among the most reported and most damaging forms of identity theft, and class-action settlements following SSN breaches routinely run into nine figures.

Regulatory Obligations

  • State breach notification laws: All 50 US states define SSN as a trigger element. If SSNs are exposed, notification duties, credit monitoring obligations, and attorney general reporting typically follow — often on tight statutory deadlines.
  • GLBA Safeguards Rule: Financial institutions must know where customer nonpublic personal information lives and protect it with access controls and encryption. You cannot safeguard SSNs you have not located, which makes automated detection across tickets, logs, and documents a practical prerequisite for compliance.
  • HIPAA: The Social Security Number is one of the 18 identifiers that must be removed for Safe Harbor de-identification of health data. Any covered entity releasing datasets for research or analytics must prove SSNs are gone — read our HIPAA PHI detection guide for the full identifier list.
  • NY SHIELD Act and state analogues: New York, California, Massachusetts, and others impose affirmative "reasonable safeguards" duties on any business holding residents' SSNs, including data minimization and disposal requirements.
  • IRS Publication 1075 & SSA rules: Organizations handling federal tax information face strict SSN handling, masking, and audit requirements.

Where Stray SSNs Actually Hide

In our experience scanning production data, the SSNs that cause breaches are rarely in the systems designed to hold them — those are already encrypted. The dangerous copies live in the margins: customer support tickets where an agent pasted a full account record, call center transcripts where a caller read their number aloud, exception traces that serialized a whole request object into a log line, CSV exports sitting in a shared drive, and free-text "notes" fields in CRMs. Detection-first tooling exists precisely to sweep these unstructured surfaces continuously. This is the core discipline behind PII detection for data loss prevention.

Detection first, then decide: Because the API returns exact character offsets and confidence scores, you can choose your response per channel — block the message in a chat filter, mask the value in a log pipeline, quarantine the document in a DLP workflow, or simply inventory the finding for your data map.

SSN Structure and Real-World Formats

Every SSN is a nine-digit number conventionally written as AAA-GG-SSSS: a three-digit area number, a two-digit group number, and a four-digit serial number. The names are historical. Before June 25, 2011, the area number encoded the state where the card was issued and the group number followed a documented issuance order — which meant an SSN leaked information about where and roughly when a person first registered. Since 2011, the SSA assigns numbers by randomization: area numbers no longer map to geography, previously unused areas entered circulation, and the old high-group validation tables became obsolete.

This history matters for detection. Validators built before 2011 that reject "unissued" area numbers now produce false negatives on perfectly valid post-randomization SSNs. Modern detection should apply only the structural rules the SSA still enforces (covered in the validation section below) and lean on context for everything else.

Formats You Will Encounter in the Wild

People and systems write the same nine digits many different ways. A production-grade detector has to catch all of these:

  • Hyphenated: 545-81-2094 — the canonical form used on cards, tax forms, and most documents.
  • Spaced: 545 81 2094 — common in OCR output from scanned forms and in dictated transcripts.
  • Unformatted: 545812094 — typical in databases, CSV exports, log lines, and copy-paste artifacts. This is the hardest case, because a bare nine-digit string is ambiguous without context.
  • Labeled: SSN: 545-81-2094, Social: 545812094, soc sec # 545 81 2094 — labels are strong context signals the model exploits, including dozens of abbreviation variants.
  • Partial / last four: SSN ending in 2094, last 4: 2094 — widely used in identity verification scripts. Partials still count as sensitive in combination with other identifiers, and the API flags them when context makes the meaning clear.
  • Mixed punctuation: 545.81.2094 or line-broken numbers from PDF text extraction — messy, but recoverable with context-aware matching.
One Number, Many Disguises
545-81-2094  |  545 81 2094  |  545812094  |  Social: 545.81.2094  |  SSN ending in 2094
All Detected As
type: "SSN" — with exact start/end offsets and per-match confidence

OCR caution: Scanned W-2s, I-9s, and benefits forms frequently render hyphens as spaces, dots, or nothing at all, and misread digits (0/O, 1/l). Run detection on the raw extracted text rather than pre-normalizing it, so the reported offsets still map back to the source document for redaction.

Spoken Numbers in Call Transcripts

Voice channels add a final layer of variation. Speech-to-text engines transcribe a dictated SSN in unpredictable shapes: digit-by-digit ("five four five eight one two zero nine four"), grouped ("five forty-five, eighty-one, twenty ninety-four"), or as a mix of words and numerals depending on the engine's normalization settings. Callers also interrupt themselves, repeat groups, and confirm digits back to the agent, scattering fragments of the same number across several conversational turns. Because the detection model reads meaning rather than shape, it recognizes these dictation patterns in transcript text — which is why call centers and IVR platforms typically run every transcript through detection before the text touches analytics, quality assurance, or model training pipelines. If you are processing recorded calls at scale, this single step usually removes the largest source of unmanaged SSN copies in the organization.

Quick Start

Detecting SSNs takes a single HTTPS request. Send your text to the API endpoint with the SSN entity selected, and you get back every match with its position and confidence, plus a masked copy of the input. Try it interactively in the live demo before writing any code.

curl -X POST https://piidetectionapi.com/api/moderate.php \
  -H "Content-Type: application/json" \
  -d '{
    "api_key": "YOUR_API_KEY",
    "api_type": "pii_detection",
    "text": "Applicant Maria Torres, SSN 545-81-2094, requested a copy of her W-2.",
    "entities": ["SSN"],
    "mask_mode": "replace"
  }'
import requests

resp = requests.post(
    "https://piidetectionapi.com/api/moderate.php",
    json={
        "api_key": "YOUR_API_KEY",
        "api_type": "pii_detection",
        "text": "Applicant Maria Torres, SSN 545-81-2094, requested a copy of her W-2.",
        "entities": ["SSN"],
        "mask_mode": "replace",
    },
    timeout=30,
)
data = resp.json()
for e in data["detected_entities"]:
    print(e["type"], e["start"], e["end"], e["confidence"])
const resp = await fetch("https://piidetectionapi.com/api/moderate.php", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    api_key: "YOUR_API_KEY",
    api_type: "pii_detection",
    text: "Applicant Maria Torres, SSN 545-81-2094, requested a copy of her W-2.",
    entities: ["SSN"],
    mask_mode: "replace"
  })
});
const data = await resp.json();
data.detected_entities.forEach(e =>
  console.log(e.type, e.start, e.end, e.confidence));

The response contains the structured entity list and the masked text:

{
  "detected_entities": [
    {"type": "SSN", "text": "545-81-2094", "start": 28, "end": 39, "confidence": 0.99}
  ],
  "anonymized_text": "Applicant Maria Torres, SSN [SSN], requested a copy of her W-2.",
  "entities_detected": 1,
  "processing_time_ms": 142,
  "mask_mode_used": "replace",
  "status": 200
}

A few practical notes: each request accepts up to 50,000 characters of text; omit the entities array entirely to scan for all 150+ types at once; and set mask_mode to "redact" if you want SSNs removed rather than replaced with placeholders. Detection alone — reading detected_entities and ignoring anonymized_text — is equally valid when you only need to know whether and where SSNs exist.

SSN Validation Rules: Filtering the Impossible

Not every nine-digit string in AAA-GG-SSSS shape can be an SSN. The SSA has never issued, and will never issue, numbers in certain ranges — and a detector that knows these rules eliminates a whole class of false positives before context even comes into play. PII Detection API applies these structural checks automatically, so a match reported as SSN has already passed plausibility screening.

Rule Invalid Pattern Example (never valid) Why It Exists
Area ≠ 000 000-GG-SSSS 000-12-3456 Zero area was never allocated by the SSA
Area ≠ 666 666-GG-SSSS 666-12-3456 Deliberately excluded from issuance
Area not 900–999 9AA-GG-SSSS 923-45-6789 Reserved — the 9XX space is where ITINs live
Group ≠ 00 AAA-00-SSSS 545-00-2094 Zero group is never assigned
Serial ≠ 0000 AAA-GG-0000 545-81-0000 Zero serial is never assigned
Known test/blocked numbers Specific retired values 078-05-1120, 219-09-9999 Publicly famous numbers permanently invalidated

The last row has a memorable backstory. In 1938, a wallet manufacturer included a sample Social Security card in its product using the real SSN of an executive's secretary, Hilda Schrader Whitcher — 078-05-1120. Over the following decades, tens of thousands of people copied "their" number straight off the display card, and the SSA had to void it permanently. 219-09-9999, publicized in a 1940 advertisement, met the same fate. Both now serve as canonical test values, and any detector should treat them — and advertising staples like 123-45-6789 — as low-confidence or synthetic.

Validation ≠ verification. Structural validation tells you a number could be an SSN. Only the SSA's Consent Based verification services can confirm a number was actually issued to a specific person. For PII protection, plausibility is the right bar: a structurally valid nine-digit number in an SSN context should be protected whether or not it verifies, because your obligation attaches to the data's apparent sensitivity.

SSN vs ITIN vs EIN: Telling Nine Digits Apart

The United States uses several nine-digit taxpayer identifiers, and confusing them leads to both compliance gaps and noisy findings. An Individual Taxpayer Identification Number (ITIN) is personal PII just like an SSN; an Employer Identification Number (EIN) identifies a business and is generally public information. Classifying them correctly means the difference between a legitimate alert and alert fatigue.

SSN ITIN EIN
Written format AAA-GG-SSSS (3-2-4) 9XX-XX-XXXX (3-2-4) XX-XXXXXXX (2-7)
Issuer Social Security Administration IRS (individuals ineligible for SSN) IRS (businesses, estates, trusts)
Distinguishing digits First digit 0–8; not 000/666 area Always starts with 9; 4th–5th digits in defined ranges (e.g. 70–88, 90–92, 94–99) Two-digit prefix from IRS campus list
Context clues "SSN", "social", W-2, benefits, credit "ITIN", tax return for nonresident, W-7 "EIN", "Tax ID", invoices, W-9, payroll
Sensitivity Highest — personal identity key High — personal identifier Low — business identifier, often public
API entity type SSN TAX_ID TAX_ID (business context)

Notice the overlap trap: an ITIN written with hyphens is visually indistinguishable from an SSN except for its leading 9 — which is exactly the area range the SSA never issues. A well-designed detector uses that structural fact plus surrounding context ("filed with an ITIN", "W-7 application") to classify the match. Similarly, a nine-digit number grouped 2-7 next to the words "invoice" or "vendor W-9" is almost certainly an EIN, not a mis-formatted SSN.

Nine-digit collisions do not stop at tax identifiers. Routing numbers are nine digits (see detecting bank accounts and routing numbers), ZIP+4 codes contain nine digits, phone numbers contribute nine-digit substrings, and order IDs, tracking numbers, and case numbers are frequently nine digits long. Context-aware classification — not pattern shape — is what keeps each of these in its correct category.

Beyond the US: National Identifiers

If your data crosses borders, the SSN is only one member of a large family. Most countries issue a functionally equivalent identifier — the UK National Insurance number, the Canadian Social Insurance Number, Spain's DNI, India's Aadhaar, Sweden's personnummer — each with its own format, checksum, and legal status. Enable NATIONAL_ID alongside SSN to catch these equivalents in one pass; the model recognizes national ID formats and their surrounding context across 60+ languages, so a support ticket that mixes an American SSN with a customer's Canadian SIN is fully covered by a single request. For multinational compliance programs this matters directly: GDPR treats national identification numbers as personal data warranting special handling, and several member states restrict their processing outright.

Why a Bare Regex Isn't Enough

Nearly every engineering team starts SSN detection with the obvious regular expression: \d{3}-\d{2}-\d{4}, perhaps with optional separators. It takes five minutes to write and fails in production within the hour, in both directions at once.

The False Positive Flood

Loosen the regex to catch unformatted SSNs — \d{9} — and it matches an enormous share of the numeric universe: Unix timestamp fragments, database primary keys, request IDs, the middle of any longer number, routing numbers, ZIP+4 codes with the hyphen stripped, and portions of phone numbers. Teams scanning application logs with a naive nine-digit pattern routinely report that over 95% of matches are noise. The operational consequence is worse than the number suggests: once analysts learn that SSN alerts are usually false, they stop reading them, and the one real leak sails through.

The False Negative Gap

Keep the regex strict to stay quiet, and it misses exactly the cases that matter: spaced digits from OCR, numbers broken across lines in extracted PDF text, dotted separators, dictated numbers in transcripts ("five four five, eight one, twenty ninety-four"), and every unformatted SSN sitting in a CSV export. A strict pattern gives you confident dashboards and unprotected data.

What Context-Aware Detection Adds

  • Linguistic context: The words around a candidate — "SSN", "social", "applicant", "W-2", "benefits" versus "order", "invoice", "tracking" — shift the classification decision, exactly as a human reviewer's would.
  • Structural validation: The SSA rules from the previous section run on every candidate, discarding impossible areas, groups, and serials without any configuration.
  • Cross-entity disambiguation: The model evaluates competing interpretations (SSN vs routing number vs phone fragment) jointly rather than letting overlapping regexes double-report the same span.
  • Calibrated confidence: Every match carries a score. A labeled, hyphenated, structurally valid number scores near 0.99; a bare nine-digit string with weak context might score 0.55 — and the threshold parameter lets you decide, per pipeline, how much uncertainty to accept.

Threshold tuning is a genuine dial, not a formality. A DLP scan of an HR file share should run at a low threshold (around 0.3–0.4) because a missed SSN is expensive and a human reviews the findings anyway. A real-time chat filter should run at the default 0.5 or higher, because blocking legitimate messages containing order numbers erodes user trust. For a deeper treatment of this trade-off, see our guide to NER vs regex detection techniques.

Advanced Code Examples

Catching Unformatted and Context-Only SSNs

This example throws the hard cases at the API: an unformatted nine-digit number, a spaced variant, and a lookalike order number that should not match. Broadening the entity list to include TAX_ID and NATIONAL_ID also catches ITINs, EINs, and foreign ID numbers in the same pass:

curl -X POST https://piidetectionapi.com/api/moderate.php \
  -H "Content-Type: application/json" \
  -d '{
    "api_key": "YOUR_API_KEY",
    "api_type": "pii_detection",
    "text": "Customer social is 545812094, spouse SSN 545 81 3310. Order #482915637 shipped Tuesday.",
    "entities": ["SSN", "TAX_ID", "NATIONAL_ID"],
    "mask_mode": "replace",
    "threshold": 0.4
  }'
import requests

resp = requests.post(
    "https://piidetectionapi.com/api/moderate.php",
    json={
        "api_key": "YOUR_API_KEY",
        "api_type": "pii_detection",
        "text": (
            "Customer social is 545812094, spouse SSN 545 81 3310. "
            "Order #482915637 shipped Tuesday."
        ),
        "entities": ["SSN", "TAX_ID", "NATIONAL_ID"],
        "mask_mode": "replace",
        "threshold": 0.4,
    },
    timeout=30,
)
data = resp.json()
print(data["anonymized_text"])
# Customer social is [SSN], spouse SSN [SSN]. Order #482915637 shipped Tuesday.
const resp = await fetch("https://piidetectionapi.com/api/moderate.php", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    api_key: "YOUR_API_KEY",
    api_type: "pii_detection",
    text: "Customer social is 545812094, spouse SSN 545 81 3310. Order #482915637 shipped Tuesday.",
    entities: ["SSN", "TAX_ID", "NATIONAL_ID"],
    mask_mode: "replace",
    threshold: 0.4
  })
});
const data = await resp.json();
console.log(data.anonymized_text);
// Customer social is [SSN], spouse SSN [SSN]. Order #482915637 shipped Tuesday.

The order number survives untouched: it is nine digits, but nothing in its structure or context supports an SSN reading. That asymmetry — aggressive on real SSNs, quiet on lookalikes — is the entire value of context-aware detection.

Hash Mode for Deduplication and Record Linkage

Sometimes you need to remove SSNs but still tell whether two records refer to the same number — deduplicating claims, joining datasets, or counting distinct affected individuals during breach triage. mask_mode: "hash" replaces each SSN with a consistent hash, so equal inputs produce equal tokens without exposing the underlying value:

curl -X POST https://piidetectionapi.com/api/moderate.php \
  -H "Content-Type: application/json" \
  -d '{
    "api_key": "YOUR_API_KEY",
    "api_type": "pii_detection",
    "text": "Claim A filed under 545-81-2094. Claim B filed under 545-81-2094. Claim C under 545-81-3310.",
    "entities": ["SSN"],
    "mask_mode": "hash"
  }'
import requests

resp = requests.post(
    "https://piidetectionapi.com/api/moderate.php",
    json={
        "api_key": "YOUR_API_KEY",
        "api_type": "pii_detection",
        "text": (
            "Claim A filed under 545-81-2094. "
            "Claim B filed under 545-81-2094. "
            "Claim C under 545-81-3310."
        ),
        "entities": ["SSN"],
        "mask_mode": "hash",
    },
    timeout=30,
)
print(resp.json()["anonymized_text"])
# Claims A and B share one hash token; claim C gets a different one.
const resp = await fetch("https://piidetectionapi.com/api/moderate.php", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    api_key: "YOUR_API_KEY",
    api_type: "pii_detection",
    text: "Claim A filed under 545-81-2094. Claim B filed under 545-81-2094. Claim C under 545-81-3310.",
    entities: ["SSN"],
    mask_mode: "hash"
  })
});
const data = await resp.json();
console.log(data.anonymized_text);

Scoping Detection with Custom Instructions

If your text legitimately contains lookalike identifiers — internal employee IDs, legacy case numbers — the custom_instruction parameter lets you express exclusions in plain language instead of maintaining a regex allowlist:

resp = requests.post(
    "https://piidetectionapi.com/api/moderate.php",
    json={
        "api_key": "YOUR_API_KEY",
        "api_type": "pii_detection",
        "text": ticket_text,
        "entities": ["SSN", "TAX_ID"],
        "threshold": 0.35,
        "custom_instruction": (
            "Ignore nine-digit employee IDs prefixed with EMP- "
            "and internal case numbers labeled CASE:."
        ),
    },
    timeout=30,
)

Best Practices for SSN Detection Pipelines

1. Never Log the Matched Value

The fastest way to turn a detection system into a breach vector is to write detected SSNs into its own logs, alerts, or dashboards. Persist the entity type, the character offsets, and the confidence — never the matched text. The offsets are sufficient to redact the source later, and your alerting pipeline stays out of scope for every regulation discussed above.

Warning: Audit your exception handlers and debug modes. A detection service that echoes request bodies into stack traces on failure will eventually write raw SSNs to disk. Fail closed: on error, drop the payload, log only metadata.

2. Be Careful with Last-Four Preservation

Product teams often ask to keep the last four digits visible ("***-**-2094") because verification workflows use them. Understand the cost: the last four digits are the serial portion, the most personally distinctive part of the number, and combining a retained last-4 with a name and birth date meaningfully aids re-identification. Preserve partials only in channels that genuinely need them, and mask the full value everywhere else.

3. Scan Broadly, Not Just the Obvious Fields

Pair SSN with the identifiers that co-occur with it — PERSON_NAME, DATE_OF_BIRTH, ADDRESS, DRIVERS_LICENSE_NUMBER — because an SSN's risk multiplies with each companion identifier in the same record. Omitting the entities parameter scans for everything, which is usually the right default for discovery jobs.

4. Tune Thresholds Per Channel, and Measure

Run discovery scans low (0.3–0.4, human review downstream) and inline filters at 0.5+. Then measure: sample findings weekly, label them, and track precision and recall over time rather than assuming the initial tuning holds as your data drifts.

5. Use Detection Output for Breach Triage

When an incident does happen, the same API that powers prevention accelerates response. State notification statutes and GLBA both turn on questions detection answers directly: Did the exposed dataset contain SSNs? How many distinct individuals are affected? Which files and which lines? Batch-scanning the compromised corpus with the SSN entity and hash-mode masking produces a defensible count of unique affected numbers without your incident responders ever viewing a raw value — evidence you can hand to counsel and regulators. Teams that wire this up before an incident cut days off their notification timeline; teams that do it during one are grateful the endpoint accepts 50,000 characters per request and parallelizes trivially.

6. Test with Synthetic Numbers Only

Build your test suites around structurally valid but famous-invalid numbers (078-05-1120, 219-09-9999) and randomized values in unissued ranges — never real customer SSNs. Your test fixtures end up in git history, CI logs, and code review tools, none of which should ever contain live PII. Pricing for high-volume batch scanning is on our pricing page, and on-premise deployment is available when SSN-bearing data cannot leave your network.

Frequently Asked Questions

Can the API detect unformatted nine-digit SSNs?

Yes. Unformatted SSNs (545812094) are detected when structural validation passes and context supports the reading — a nearby label like "SSN" or "social", surrounding identity data, or document type signals. A bare nine-digit number with no supporting context is intentionally scored low, because most such strings are IDs, timestamps, or routing numbers. Lower the threshold parameter for discovery scans where recall matters more than precision.

How does the API avoid confusing SSNs with ITINs and EINs?

Structurally: ITINs always begin with 9, which is outside the SSN area range, and EINs group as 2-7 rather than 3-2-4. Contextually: words like "ITIN", "W-7", "EIN", "vendor", or "invoice" steer classification. ITINs and EINs are reported under the TAX_ID entity type, so you can treat personal ITINs as sensitive while filtering business EINs out of your alerts.

Does the API detect partial SSNs like "last four 2094"?

When context makes the meaning clear ("SSN ending in 2094", "last 4 of social: 2094"), yes — partial SSNs are flagged so you can decide per channel whether to mask them. Four bare digits without context are not flagged, since that would match every PIN, year, and street number in your data.

Is SSN detection required for HIPAA and GLBA compliance?

Effectively, yes. HIPAA's Safe Harbor de-identification method requires removal of all 18 identifiers, and Social Security Numbers are explicitly listed — you cannot certify de-identified data without demonstrating SSNs are gone. Under the GLBA Safeguards Rule, financial institutions must maintain an inventory of where customer NPI resides and protect it, which presupposes the ability to find SSNs in unstructured stores. Automated detection is the only approach that scales to tickets, transcripts, and logs.

Does a detected SSN mean the number is real?

No — and this distinction matters. The API validates plausibility: correct structure, issuable ranges, supportive context. It does not and cannot verify that the SSA actually issued the number to a person; only SSA verification services can do that. For data protection purposes, plausibility is the correct standard — a plausible SSN in your data demands protection regardless of its issuance status.

What should I do about false positives in log scanning?

First, raise the threshold for that pipeline — logs are the noisiest surface for nine-digit lookalikes. Second, use custom_instruction to describe your internal ID formats in plain language so the model excludes them. Third, review a sample of suppressed matches monthly to confirm you have not traded a noise problem for a blind spot. Most teams converge on a threshold between 0.5 and 0.7 for log pipelines within a week of tuning.

Find Every SSN Hiding in Your Data

Test detection on your own text in the live demo, or get an API key and scan your first documents in minutes.

Try the Live Demo View Pricing