BASALT · JOURNAL

How to redact a PDF on a Mac so the text is actually gone

2026-08-06 · how to redact a pdf on mac

Most guides on how to redact a PDF on Mac tell you to draw a black rectangle over the sensitive words and save. That produces a document where the words are still in the file, sitting under a shape, recoverable with a text selection or a command line tool. Redaction is a destructive operation on the file contents, and if nothing was destroyed, nothing was redacted.

This post walks through what actually has to happen inside the PDF, what the built-in Mac tools do and do not do, and how to confirm the result before the document leaves your machine.

What a PDF actually stores

A PDF page is not an image and it is not a word processor document. It is a program. The page has a content stream, a sequence of operators that a viewer executes in order to paint the page.

Text arrives through text-showing operators: Tj, TJ, ', and ". Each one carries a string of character codes that get mapped through a font encoding to glyphs, then drawn at a position set by the text matrix. When you select text in a viewer and copy it, the viewer is reading those operator arguments and running the mapping in reverse.

A rectangle drawn on top is just more operators appended later in the same stream: set a fill color, define a path, fill it. Painting order changes what you see. It does not change what is stored. The original Tj and TJ arguments are still in the stream, in order, fully intact.

That is the mechanism behind every court filing you have read about where the black boxes were copy-pasteable. Nobody made a careless mistake with the mouse. The tool did exactly what it was asked to do, which was draw a shape, and the person operating it believed drawing a shape was redaction.

Real redaction, step by step

To remove a word from a page you have to edit the content stream itself. That means:

  1. Parse the content stream into its operator sequence.
  2. Resolve each text-showing operator into individual glyph runs with real positions on the page, accounting for the text matrix, the font size, the horizontal scale, character and word spacing, and any TJ kerning adjustments.
  3. Determine which glyphs fall inside the marked region. This is per glyph, not per operator, because a single TJ array routinely holds an entire line.
  4. Rewrite the operator so the covered glyphs are excised and the surviving glyphs are re-emitted at their original positions. Half a line must still render exactly where it did before.
  5. Do the same for the other places text hides: /ActualText and /Alt entries that carry a plain text equivalent for accessibility, annotation contents and appearance streams, form field values, optional content groups that are switched off, and any OCR text layer sitting invisibly behind a scan.

Images need separate handling. If the sensitive material is pixels rather than glyphs, and the image is a scan or a photograph, the pixels under the mark have to be overwritten in the image data and the image re-encoded. Leaving the original XObject in place and drawing over it means the original is still extractable with any PDF decompressor.

Then there is the file structure. PDF supports incremental updates: a new revision is appended to the end of the file with a fresh cross-reference section, and the earlier bytes stay where they were. Save a redaction as an incremental update and the pre-redaction version is still physically present in the same file. It can be recovered by walking back through the update chain. A redacted file must be written as a single generation with one cross-reference structure and no prior revisions retained.

Finally, the parts nobody looks at: the document information dictionary, the XMP metadata packet, embedded file attachments, object streams holding stale objects, page thumbnails generated before the edit, and named destinations pointing at removed content. Any of these can carry the author's name, the original file path, a prior title, or in the case of a stale thumbnail, a small picture of the unredacted page. There is more on this in what a PDF still carries after you think you cleaned it.

What Preview and the usual Mac tools do

Preview is a viewer with light annotation features. Its rectangle tool adds an annotation or paints a shape. It does not parse and rewrite the page content stream, and it does not touch metadata or the update chain. Exporting to PDF afterward flattens appearance in some cases and not others, and you have no way to tell which case you are in from the interface.

Print to PDF is the workaround people reach for next. It does destroy the text under the box, because the print pipeline rasterizes or re-generates the page. It also destroys the real text everywhere else on the page, leaving you with a document that is no longer searchable, is often larger, and has lost tagging, bookmarks, and form structure. For a filing that has to remain text-searchable, that is not an acceptable trade.

Markup in Mail and Quick Look have the same limitation as Preview: they are annotation layers. The full argument is in why redacting a PDF in Preview is not redaction.

Verify before you send

Whatever tool you use, do not accept the interface's word for it. Open the saved file and check.

The fastest check on a Mac is to select the area where the redaction is and press Command-C, then paste into a plain text editor. If the supposedly removed text appears, you have an annotation, not a redaction. This catches the most common failure but not the subtle ones.

For a real check, extract the text with an independent parser rather than the app that wrote the file. Command line tools such as pdftotext from Poppler, or a Python parser, will read the content stream directly. Search the extracted output for the terms you removed. Then look at the metadata separately, since text extraction will not show you an XMP packet or an attachment. A step by step procedure is in how to check whether a PDF was really redacted.

Check the file size too. A genuine redaction of a scanned page usually changes the size of the image objects. A file that is a few hundred bytes larger than the original almost certainly just gained a rectangle.

Building a habit that holds up

Redaction failures are rarely technical incompetence. They happen because a busy person used a familiar tool under time pressure and had no signal telling them the result was wrong. The fix is procedural: pick a tool that destroys rather than covers, verify the output every time with something other than that tool, and keep a record of what was removed and why.

If you produce documents in volume, make the verification step automatic rather than optional. A check that depends on someone remembering to run it will eventually not be run.

Frequently asked questions

How do I redact a PDF on a Mac?

Use a tool that removes the text from the page content stream rather than drawing over it, then verify the output with an independent parser before you send it. Preview's shape tools only add an annotation or a painted rectangle, which leaves the original characters in the file. A real redaction also strips metadata, attachments, and hidden layers, and writes the file as a single generation.

Can Preview redact a PDF permanently?

No. Preview is a viewer with annotation features, and its rectangle tool paints over content without parsing or rewriting the page content stream. The text-showing operators holding the redacted words remain in the file and can be recovered by selecting and copying, or by any command line extraction tool.

Does printing to PDF count as redaction?

Printing to PDF destroys the visible text under a black box, but it is not a redaction procedure. It also removes the searchable text layer from the entire document along with tagging, bookmarks, and form structure, and it leaves metadata, XMP packets, and embedded attachments in place. Many courts require text-searchable filings, which rasterized output cannot satisfy.

Is redacted text recoverable from a PDF?

Yes, whenever the text was covered rather than excised. Recovery methods include copying the selection, running pdftotext, deleting the annotation that formed the box, and walking back through the incremental update chain to a revision saved before the box was added. None of these require specialist tools or expertise.

How do I know a PDF redaction worked?

Extract the text with a parser that is not the application that wrote the file, such as pdftotext, and search the output for every term you removed. Then decompress the file with qpdf --qdf --object-streams=disable and grep the expanded structure, check metadata with exiftool, and count %%EOF markers to detect retained earlier revisions.

Does redaction remove the metadata too?

It should, but many tools do not. Author names, original file paths, prior titles, and document identifiers live in the information dictionary and the XMP packet, which are separate stores that can disagree. A redaction that clears the page but leaves the author name has still disclosed information, which is a well documented pattern in public releases.

Can I redact a scanned PDF on a Mac?

Yes, but it takes two operations rather than one. The pixels under the mark have to be overwritten in the image data and the image re-encoded, and any invisible OCR text layer positioned over the scan has to be edited at the same time. Handling only one of the two leaves the content fully readable.

Doing it in Basalt

Basalt is a native macOS app built around exactly this problem. It excises text from the content stream glyph by glyph, re-emits the surviving glyphs in place, destroys and re-encodes image pixels under a mark, strips metadata, XMP, attachments, hidden layers, and stale thumbnails, and writes the file as one generation so earlier revisions cannot be recovered.

Before anything is saved, a built-in verifier re-opens the written bytes with an independent parser and proves the redaction. If it cannot prove it, no file is written. You also get a signed certificate of redaction using Ed25519 that anyone can check with shasum and openssl without installing Basalt.

The engine runs as a separate process with no network entitlement, enforced by macOS at the code signature level, so documents never leave your Mac. It is $29 once for up to three Macs, free for 24 hours, and a 17 MB download.

Redaction that proves itself

Basalt destroys the content you mark, then re-opens the file it wrote and proves the content is gone before it saves anything. Your documents never leave your Mac.

DOWNLOAD BASALT 2.3.0 BUY $29 FREE FOR 24 HOURS · MACOS 13+