# OCR Documents With Social Security Numbers Safely

- Author: Schema Law (https://www.schemalaw.com/)
- Published: 2025-04-16T03:04:00Z
- Updated: 2026-10-11T19:22:20Z
- Category: Confidentiality
- Canonical: https://www.schemalaw.com/blog/ocr-documents-with-social-security-numbers

> How to OCR documents with Social Security numbers: what court rules make you redact, how to search for identifiers, and where exports multiply them.

To OCR documents with Social Security numbers safely, screen the scan before upload, send only the pages you need, and treat every export as a new copy of each number. Searchable text then helps you find identifiers for redaction, but a single misread digit can hide one, so search by label as well as by pattern.

This post covers Social Security numbers and the other personal identifiers that court rules single out. It explains handling, not law. Filing rules differ by court, and other privacy laws may apply to your file, so check the rules that govern your matter.

## Which personal identifiers do court rules make you redact?

Federal court rules make filers cut five kinds of identifier down to a fragment: Social Security numbers, taxpayer identification numbers, birth dates, the names of minors and financial account numbers. Criminal filings add home addresses. State rules have their own lists, and some are shorter.

The federal civil rule is [Rule 5.2 of the Federal Rules of Civil Procedure](https://www.uscourts.gov/sites/default/files/2025-02/federal-rules-of-civil-procedure-dec-1-2024_0.pdf). It applies to "an electronic or paper filing with the court" and says the filer "may include only" the fragments in this table. [Rule 49.1 of the Federal Rules of Criminal Procedure](https://www.uscourts.gov/sites/default/files/2025-02/federal-rules-of-criminal-procedure-dec-1-2024_0.pdf) and [Rule 9037 of the Federal Rules of Bankruptcy Procedure](https://www.uscourts.gov/sites/default/files/2025-02/federal-rules-of-bankruptcy-procedure-dec-1-2024_0.pdf) follow the same pattern.

| Identifier in the document | What a federal filing may show | Which federal rules |
| --- | --- | --- |
| Social Security number | The last four digits | Civil, criminal, bankruptcy |
| Taxpayer identification number | The last four digits | Civil, criminal, bankruptcy |
| Birth date | The year | Civil, criminal, bankruptcy |
| Name of a person known to be a minor | The minor's initials | Civil, criminal, bankruptcy (which words it as a minor "other than the debtor") |
| Financial account number | The last four digits | Civil, criminal, bankruptcy |
| Home address | The city and state | Criminal only |

Four points about these rules affect how you handle a scan.

**They govern filings.** The text speaks of what a filing may include. Your internal working copy and the documents you exchange in discovery are governed by other things: protective orders, privacy statutes and your confidentiality duties.

**They have exemptions.** Rule 5.2(b) lists several, among them "the record of an administrative or agency proceeding" and "the official record of a state-court proceeding". Read the list before you spend a day redacting an administrative record that is exempt, and before you assume an exhibit is exempt when it is not.

**Filing your own number unredacted waives the protection.** Rule 5.2(h) says a person "waives the protection of Rule 5.2(a) as to the person's own information by filing it without redaction and not under seal." A client's number that goes into the public record by mistake is hard to pull back.

**Nobody checks for you.** The federal judiciary's [privacy policy for electronic case files](https://www.uscourts.gov/privacy-policy-electronic-case-files) summarizes the identifiers to be redacted and explains that the rules codify an earlier Judicial Conference policy. California's [rule 1.201](https://courts.ca.gov/cms/rules/index/one/rule1_201) is blunt about responsibility: it "rests solely with the parties and their attorneys", and the clerk "will not review each pleading or other paper for compliance".

California's rule also shows how state lists vary. It names two identifiers, Social Security numbers and financial account numbers, and allows the last four digits of each. Look up your own court's rule and build your search list from it.

## Is it safe to upload a document with a Social Security number to OCR?

Uploading a document with a Social Security number to OCR can be reasonable when the provider's written terms limit access, bar reuse and let you delete the file, and when you send only the pages the task needs. It is not safe by default.

The stakes are higher than for most client data. A Social Security number is far harder to replace than a password, so a leak is not something the client can undo by changing it.

Treat the number as sensitive personal information and the birth date beside it the same way. Data minimization means the schedule you total can go up while the cover sheet stays in the matter folder. Build the redaction list from the pages you actually converted, then search the export for every label the form printed next to an identifier.

Weigh four things before the upload:

1. **Do you need text from the page that carries the number?** A tax return's first page shows the number, while the schedule you want to total may not. Split the file and upload the schedule.
2. **What do the provider's terms say?** Look for limits on staff access, a ban on training or other reuse, and deletion on request. The post on [whether it is safe to upload client documents to an OCR tool](https://www.schemalaw.com/blog/is-it-safe-to-upload-client-documents-to-an-ocr-tool) has the questions to ask.
3. **Does anything outside your firm restrict the file?** A protective order, a records authorization or a client's outside counsel guidelines may limit which vendors can hold it.
4. **How long will it sit there?** Delete the upload when the exports are checked.

### Masking before upload

If you need the page but not the number, cover the number first. On paper, the D.C. Circuit's [guidance on redacting personal data identifiers](https://www.cadc.uscourts.gov/sites/cadc/files/ecfRedactionGuide.pdf) recommends opaque tape or paper before scanning and warns against plain paper, because "the scanner may pick up images through the paper." In a file, use a real redaction tool on a copy and keep the original offline. The service then receives a page with nothing to read in that spot.

### What Schema Law states

Schema Law's [pricing page](https://www.schemalaw.com/pricing) lists six lines for every plan, including "Documents stay inside your own account", "Your documents are never used to train an AI model" and "Delete any document, at any time". The homepage sets out its [security commitments](https://www.schemalaw.com/#security) at more length. Its listed features do not include finding or redacting identifiers. It reads the page into text and tables, and whatever numbers are on the page will be in the text. Screening is your job with this tool and with any other.

## Using searchable text to find Social Security numbers in a file

Searchable text turns a page-by-page hunt into a set of searches. Once a scan has a text layer, you can look for the nine-digit pattern, for the labels that sit next to it and for the forms that always carry it.

Search in three passes.

**Pass one: the pattern.** A Social Security number is nine digits, usually printed in groups of three, two and four. A regular expression search in a text editor, run on a plain text export, finds the common layouts:

```
\b\d{3}[- .]?\d{2}[- .]?\d{4}\b
```

That matches `123-45-6789`, `123 45 6789` and `123456789`. It will also match some nine-digit numbers that are not Social Security numbers, such as bank routing numbers. Those are worth seeing too.

Some PDF tools have a built-in version of this. Adobe's tutorial on [removing sensitive information in Acrobat](https://experienceleague.adobe.com/en/docs/document-cloud-learn/acrobat-learning/advanced-tasks/protect/redact) says its Find text and redact feature can "search for a Pattern to find certain types of information."

**Pass two: the labels.** Search for the words printed beside the number:

- `SSN`, `SS#`, `SS No`, `Soc. Sec.`, `Social Security`
- `TIN`, `EIN`, `Taxpayer`, `Employer ID`
- `DOB`, `Date of Birth`, `Birth Date`, `Born`
- `Account`, `Acct`, `Routing`, `Card No`
- `XXX-XX` and `***-**`, which mark numbers someone already shortened and show you where full ones may sit nearby

**Pass three: the document types.** Some forms carry identifiers by design. Find them by title and check each one by eye:

| Document type | Identifiers it commonly shows |
| --- | --- |
| Wage and tax statements, tax returns | Social Security and employer identification numbers |
| Pay stubs | Social Security number, sometimes partial, and bank account for direct deposit |
| Medical intake and billing forms | Social Security number, birth date, insurance member number |
| Loan and credit applications | Social Security number, birth date, account numbers |
| Death certificates and probate inventories | Social Security number, birth date, account numbers |
| Bank and brokerage statements | Account numbers on every page header |
| Older court filings and agency records | Any of the above, from before redaction rules applied |

Keep a hit list as you go: page, identifier type, and what you plan to do with it. That list becomes the redaction list for anything you file.

## Why can a misread digit hide an identifier from search?

A pattern search finds only strings that match the pattern exactly. If OCR reads one digit of a Social Security number as a letter, drops a hyphen, or splits the number across two table cells, the search passes over it. The number is still on the page image for anyone to read.

The misreads that break an identifier search:

- **A digit read as a letter.** `5` as `S`, `0` as `O`, `1` as `l` or `I`, `8` as `B`. One swap is enough.
- **A hyphen read as something else**, or as nothing, or with spaces added around it.
- **A box or comb field.** Forms that print one digit per box often come out with a space or a bar between every digit.
- **A number split by a line or cell boundary**, so half of it lands in one cell and half in the next.
- **A stamp, a punch hole or handwriting over the digits.** Handwritten numbers on intake forms are the least reliable of all.
- **A faint fax or a photocopy of a photocopy**, where recognition gives up and emits nothing for that line.

The last case is the dangerous one. Search finds no number because the text has none, while the page image still shows a legible one.

A looser pattern catches some of the damage. This version accepts the usual look-alike letters in place of digits and allows stray spaces:

```
\b[0-9OSIlB]{3}\s?[- .]?\s?[0-9OSIlB]{2}\s?[- .]?\s?[0-9OSIlB]{4}\b
```

It returns more false hits, which is the right trade on a file headed for a public docket. The label pass is the stronger backstop, because the words "Social Security" are long and survive misreads that a nine-digit string does not.

Search cannot be the last step. For every page of a document type known to carry identifiers, look at the image. Schema Law's own [questions section](https://www.schemalaw.com/#questions) says of its output, "Nothing marks a passage as uncertain, so check names, dates, and amounts against the original." The post on OCR errors explains a method for [proofreading OCR output against the original](https://www.schemalaw.com/blog/why-is-ocr-output-full-of-errors#proofreading-ocr-output-against-the-original), and the post on [why OCR gets numbers wrong](https://www.schemalaw.com/blog/why-does-ocr-get-numbers-wrong) covers digit confusions in depth.

## Identifiers that multiply in spreadsheet and text exports

Every export of a page that shows a Social Security number is another file containing that number, and some formats hold it more than once. One scanned wage statement can become a searchable PDF, a Word file, a spreadsheet and a text file within a minute. Count the copies, because each one needs the same care as the scan.

Where the number lands in each kind of export:

- **Searchable PDF.** Once in the page image and once in the hidden text layer.
- **Word, plain text, Markdown, HTML.** Once in the running text for each time it appears on the page.
- **Excel.** In a table cell if the number sat in a table. Schema Law describes its Excel export as "Each table on its own sheet, with the rest of the text on another", so check the text sheet as well as the table sheets.
- **CSV.** In a table row, or in a line of text with its page number.
- **JSON.** Schema Law describes its JSON export as "Each page's text and tables", so a number printed in a table can sit in the page text and in the table as well. Search the whole file.

Then come the copies no export list shows: the browser's download folder, the attachment in a sent email, the preview a chat tool cached, the copy in the document management system and the one on a laptop that synced overnight.

### A count for one small file

A fictional example: you are assembling exhibits in the estate of Dolores Vanterpool. The scan is 22 pages: a death certificate, two wage statements, a brokerage statement of six pages and a tax return. Her Social Security number appears on nine pages, and the brokerage account number on six.

You export Word to draft the inventory, Excel to total the holdings, and a searchable PDF for the file. That is three exports, each with nine pages of Social Security numbers, plus the three downloads and the original scan. Seven files now hold the number at least nine times each. The Excel file is the one most likely to be emailed to the accountant, and it is the one nobody thinks of as an identity document.

Spreadsheets add a trap of their own. A program that treats a nine-digit string as a number may strip a leading zero or the hyphens, which changes how the identifier looks and whether your search finds it. The post on CSV exports explains [opening a CSV without Excel changing the data](https://www.schemalaw.com/blog/scanned-pdf-to-csv#opening-a-csv-without-excel-changing-the-data).

To cut the count:

- Export only the formats you will use, from only the pages you need.
- Delete columns and lines holding identifiers from a spreadsheet or Word export before it is shared, and search the file afterward to confirm.
- Empty the download folder the same day.
- When a converted file must travel with identifiers intact, protect it. The post on [OCR for a password protected PDF](https://www.schemalaw.com/blog/ocr-a-password-protected-pdf) covers putting protection on an export and sharing the password.

## A screening routine for identity documents before conversion

Screen every scan for identity documents before it is converted, using the same short routine each time. Decide page by page whether the identifier is needed, remove what is not, convert what is left, then search the result and log what you found.

1. **Flip through the scan.** Note every page that is a tax form, wage statement, benefits letter, medical intake form, account statement, certificate or application.
2. **Ask what the task needs from each of those pages.** Totals from a statement do not need the account number. A date of death does not need the Social Security number printed beside it.
3. **Split the file.** Set aside pages that add nothing to the task. They stay in the matter file and are never uploaded.
4. **Mask what you can.** On pages you need, cover identifiers the task does not use, on a copy, with a real redaction tool or opaque tape before scanning.
5. **Check the restrictions.** Confirm that no order, authorization or client instruction bars sending the remaining pages to an outside service.
6. **Convert and export only what you need.**
7. **Run the three search passes** on the text, then look at the image of every flagged page.
8. **Record the hits.** Page, identifier, and action taken.
9. **Delete the upload** from the service when the exports are checked, and clear local copies.
10. **Before anything is filed or produced**, redact from the hit list and test the outgoing file. The post on [whether to OCR before or after redaction](https://www.schemalaw.com/blog/ocr-before-or-after-redaction) gives the sequence and the test.

A hit list for the Vanterpool file might read:

| Page | Document | Identifier | Needed for the task? | Action |
| --- | --- | --- | --- | --- |
| 1 | Death certificate | Social Security number, birth date | No | Masked on the working copy before upload |
| 2 to 3 | Wage statements | Social Security number, employer identification number | No | Not uploaded |
| 4 to 9 | Brokerage statement | Account number in each header | Last four digits only | Uploaded, shortened in the Excel export |
| 10 to 22 | Tax return | Social Security number on pages 10 and 11 | No | Pages 12 to 22 uploaded |

The routine means that when the inventory is filed, the redaction list already exists, and the only copies of the full number are the ones you chose to keep.

## Try it on a real document

Upload a scanned PDF and export it as Word, a searchable PDF or plain text on the free plan. Your documents are never used to train an AI model. [Start free](https://www.schemalaw.com/api/auth/google)
