Skip to content
documentflare
Tutorials

Detect & Redact PDF Personal Data Without Uploading

Detect and redact personal data in a PDF without uploading it: IBAN, cards and emails flagged locally, pages rasterized. Free, in-browser.

Alex Wellerstein — Wikimedia Commons, CC BY 3.0

This page contains affiliate links: we may earn a commission if you use them, at no extra cost to you. This does not influence our recommendations. As an Amazon Associate, we earn from qualifying purchases.

Table of contents

The black rectangle, a reassuring illusion

You need to send a proof of address, a payslip or a bank statement. You open a PDF editor, draw a black rectangle over your account details, your social security number or your card number, and you believe the document is anonymized. Yet if someone copies the text under the rectangle or extracts the PDF content, the data reappears intact.

This phenomenon is well known: many tools draw an opaque graphic object without removing the text from the underlying stream. Visually, the page is masked; technically, the information stays in the file. That is exactly what you want to avoid when sharing a sensitive document.

Fellowes 6M — P-4 micro-cutFellowes 6M — P-4 micro-cutP-4 micro-cut: right for ID documents and financial papers.affiliate

Why visual masking alone fails

A PDF keeps its text in structured objects, independently of appearance. A black rectangle is just a drawing placed on top. As long as the text object exists, a reader, an extractor or a search engine can recover it.

To make an area truly confidential, you must destroy the text underneath. The safest method in a browser is to rasterize the page: turn the redacted area — or even the whole page — into an image. The text no longer exists as such; only its visual rendering remains.

How Document Flare’s redaction tool works

The Redact data from a PDF tool works entirely in your browser. Nothing is sent to a server.

Local automatic scan

When the file loads, the PDF is opened with pdf.js. The text of each page is extracted line by line, then analyzed by a personal-data detection module. The recognized patterns are:

  • IBANs (mod-97 check digit);
  • French NIR, the social security number with its key;
  • Bank cards (contiguous or grouped digits, validated by the Luhn algorithm);
  • SIREN and SIRET (canonical spaced form, or 9 / 14 digits with context);
  • Email addresses;
  • French and international phone numbers;
  • Birth dates spotted by context (“born on”, “date of birth”, etc.);
  • IPv4 addresses.

Each occurrence is displayed with its type, its value and the pages involved. You select the ones to mask.

Manual keyword redaction

Automatic detection does not recognize proper names, postal addresses, case numbers or free text. For that, the tool offers a keyword field: enter a term or a comma-separated list, and every occurrence found in the text will be redacted.

Drawing black rectangles, then rasterizing

For each selected item, a black rectangle is drawn on the page at the exact position of the text. Then every affected page is rasterized: it is rendered to a canvas, converted to a JPEG image (0.95 quality), and reinserted into a new PDF. The text under the areas becomes non-extractable, because it no longer exists as a text object.

Pages that are not redacted are copied as-is, without alteration.

In practice: redact a document in four steps

  1. Drop your PDF into the tool. The local scan starts automatically.
  2. Select the detected personal data or enter your own keywords.
  3. Run the redaction. The PDF is rebuilt with the redacted pages rasterized.
  4. Verify by opening the file and trying to select or copy the text under the black areas: nothing should be extractable.

Limits and pitfalls

  • Possible false negatives. Detection is heuristic. A scan without a text layer, a broken font, an unusual identifier or a proper name without context may escape the analysis. Always proofread the document before sending it.
  • Loss of vectorization. Rasterized pages become JPEG images. Text is no longer selectable, clickable links and internal bookmarks disappear on those pages, and the file size may increase.
  • Metadata is not touched. The tool redacts the visible content of pages, not the title, author, dates or XMP stream. To clean those traces, follow up with Remove PDF metadata.
  • Size and pagination. The tool accepts one file up to 50 MiB and up to 1,000 pages, like the other PDF tools in the catalog.
  • Source file intact. The original document stays on your device; only the export is modified.

Redacting within a protection chain

Redacting is one step, not an absolute guarantee. For a document going to an external party, a cautious approach combines the tools:

  • redact personal data with the redaction tool;
  • clean metadata and attachments with the cleanup tool;
  • if needed, encrypt the file with a password (see our article on PDF encryption).

This chain reduces exposure surfaces without ever sending the document to a third-party server. To understand why local processing matters for compliance, read our article on GDPR and local PDF processing, and our guide on PDF document privacy.

Check that the redaction holds

After downloading, open the redacted PDF in a standard reader and try copying the text under a black rectangle. If the operation succeeded, nothing is selectable where the areas are. It is the only test that matters: visually, the data is hidden; technically, it is destroyed.

And for the paper originals?

Fellowes 6M — P-4 micro-cutFellowes 6M — P-4 micro-cutP-4 micro-cut: right for ID documents and financial papers.affiliate Fellowes 60Cs — 10-sheet shredderFellowes 60Cs — 10-sheet shredderTen sheets per pass and a 22 L bin: sized for regular office use.affiliate