Skip to content
DoItJag

How to redact a PDF properly, and why black boxes are not enough

Published . Last reviewed .

In short:Drawing a black shape over PDF text hides it on screen but leaves the words in the file, where anyone can copy them. Real redaction replaces the content, removes hidden details such as metadata and form answers, and is checked by searching the result.

Why the black box fails

When you draw a black rectangle over a name in a PDF editor, or highlight it in black, the rectangle is added as a new layer on top of the page. The text underneath is still in the file. Anyone who receives it can select the area, copy, and paste into a notepad, and the name appears. Search finds it too, and so does any program that pulls text out of PDFs.

This is not a rare edge case. The US National Security Agency’s guidance on redaction lists it first among the common mistakes: “Covering text, charts, tables, or diagrams with black rectangles, or highlighting text in black, is a common and effective means of redaction for hardcopy printed materials. It is not effective, in general, for computer documents distributed across computer networks.” The same report warns that covering part of an image with a separate black shape, or shrinking an image to make it unreadable, has the same problem.

So redaction has to remove the content, not cover it.

What a PDF can hide

A PDF holds more than what you see on the page. The Library of Congress format description notes that a PDF can contain text, images, graphics and other content, and most PDFs also carry document information. When redacting, the places to think about are:

Where What it may hold
Page text the words under your black box
Images a scanned ID, a photo, a signature
Metadata author name, title, dates, software
Form fields answers typed into the form
Comments review notes, deleted suggestions
Attachments files embedded in the PDF
Bookmarks headings that may repeat names

The NSA report puts it plainly: hidden information “is often as sensitive as the original document”. A title field that still reads “Settlement with Sharma family, draft 3” can undo careful work on the pages.

How to redact properly

1. Work on a copy

Keep the original file somewhere safe and redact a copy. Redaction cannot be undone, and you may need the full version later.

2. Find everything that must go

Make a list before you start: names, account numbers, Aadhaar and PAN numbers, phone numbers, email addresses, addresses, signatures, photos. In Redact PDF you can type words or phrases to find, or tick Aadhaar, PAN, Indian mobile numbers and email addresses. Every match is listed with its page. Untick any that should stay.

Search only sees real text. Scanned pages are pictures, so their contents are invisible to search. Look through every page and drag boxes over anything sensitive that the search did not list, including signatures and photos.

3. Apply the redaction

When you apply it, each page with at least one box is redrawn as an image at 200 DPI with the boxes painted into the picture, and that image replaces the page. The words under the boxes are gone because the page no longer contains any text, only pixels. Pages without boxes are copied as they were and keep their selectable text.

The output is a new document. Title, author, bookmarks, attached files, form fields and their answers, comments and scripts are not carried over.

4. Check the result yourself

Do not trust any redaction you have not tested. The tool reopens its output and searches for the redacted words and number patterns, and reports whether anything can still be read. Then check by hand:

  1. Copy test. Open the redacted PDF, select the area of each black box, copy and paste into a plain text editor. Nothing should appear.
  2. Search test. Use your PDF reader’s search for each redacted name or number. It should find nothing.
  3. Text extraction. Run the file through Extract Text from PDF. It pulls out every piece of text the file holds. Read the result for anything you meant to remove. Redacted pages will show no text at all.
  4. Metadata. Open the file in PDF Metadata Viewer and check title, author, subject, keywords and custom fields. It also shows whether there are attachments, form fields or annotations left.

5. Look at every page

Pattern matching finds anything shaped like a PAN or a 10-digit mobile number, real or not, and can miss unusual formats. A number written as “98 4500 1234” or split across two lines may not match. Read every page before sending.

When flattening is the right tool instead

Flattening and redaction are often confused. Flatten PDF merges form fields, comments, stamps and highlights into the page so they become fixed and cannot be edited, moved or deleted. Filled answers keep their font, so they stay searchable text.

That is useful when you want a filled form or a reviewed document to look the same everywhere and not be altered. It is not redaction. If a black highlight annotation sits over a word, flattening draws the highlight into the page, but the word under it remains in the page text. Flatten when you want to keep content fixed; redact when you want content gone.

A safe order for a filled form that also contains something to hide: flatten first so the answers become page content, then redact, then check.

Common mistakes

  • Changing the text colour to white or black. The text is still there, just hard to see.
  • Cropping the page. Cropping usually hides the margin area but leaves its content in the file.
  • Redacting the PDF but sending the Word original. Check which file you attached.
  • Forgetting the file name. “Ravi_Kumar_salary_slip.pdf” gives away the name you just removed. Rename it.
  • Forgetting other copies. Text from the redacted area may also appear in a header, footer, bookmark or table of contents.
  • Assuming a scanned page is safe. It has no text layer, but the picture shows everything. Draw boxes over the sensitive parts.

Limits worth knowing

Redacted pages become images, so their text can no longer be selected or searched, and they usually make the file larger. If the recipient needs searchable text, run the redacted file through OCR afterwards and check that the redacted parts still show only black boxes. To mask just the first eight digits of an Aadhaar number, as many offices ask, a dedicated masking tool is quicker than full redaction.

Files you open in these tools are processed in your browser and are not uploaded to DoItJag. Even so, redaction is a judgement call: if the document is legally sensitive, have someone else check the result before it goes out.

Sources

Rules and rates change. Check the current notice or official page before you rely on a figure here. This guide is general information, not legal, tax or financial advice. Spotted a mistake? See our editorial and corrections policy.