HomeRedaction Guides → Redact SSNs in PDF

How to Redact SSNs in a PDF

Use deterministic rules to permanently remove SSNs (###-##-#### and digits-only formats) and verify the exported PDF before sharing.

Important: PermanentRedaction permanently removes text from text-based PDFs. Scanned/image-only PDFs are not supported.
Quick notes
Tip: Many PDF editors can only mask text with black rectangles. Masking is not the same as permanently deleting text from the PDF layer.

Step-by-step

Step 1
Add an SSN regex rule for the formatted pattern (###-##-####).
See Example: SSN (###-##-####)
Regex
^\d{3}-\d{2}-\d{4}$
Matches
  • 123-45-6789
Anchored with ^ and $. Remove anchors if you need partial matches inside longer strings.
Using regex rules in PermanentRedaction
PermanentRedaction supports deterministic redaction rules using regular expressions. Patterns like this can be applied across an entire document to permanently remove matching text.
Step 2
Add a second SSN regex rule for digits-only SSNs (#########), if needed.
See Example: SSN (digits-only, 9 digits)
Regex
\b\d{9}\b
Matches
  • 123456789
This can match other 9-digit IDs. If you see false positives, add context (e.g., SSN label) or tighten the pattern.
Using regex rules in PermanentRedaction
PermanentRedaction supports deterministic redaction rules using regular expressions. Patterns like this can be applied across an entire document to permanently remove matching text.
Step 3
Preview matches and confirm you are only capturing SSNs (not other 9-digit numbers).
Step 4
Export a final PDF where matched SSNs are permanently removed.
Step 5
Verify by trying to search/copy SSN strings in the exported PDF and reviewing the verification report.

Common mistakes to avoid

Missing digits-only SSNs
Some documents omit dashes. Add a digits-only rule if your documents contain that format.
Redacting only the visible portion
Ensure the underlying text is removed in the export, not merely hidden.

FAQ

Should I redact the last 4 digits?
That depends on your policy and jurisdiction. Many workflows keep last-4 and redact the rest. Use explicit rules that match your policy.
Can an SSN appear in headers/footers?
Yes. Always preview matches and include headers/footers in your review.