Redacting a PDF properly means the sensitive text must be gone, not just hidden behind a black box that anyone can remove or copy through. This tool searches a text-based PDF for a phrase you specify and deletes those characters from the file’s content streams, all inside your browser so the document is never uploaded.
How it works
A text-based PDF stores its visible text as literal strings inside content streams, usually compressed with FlateDecode. The redactor works directly on those streams rather than rendering the page and drawing over it:
- Parses the raw PDF bytes and locates each
stream … endstreamobject. - For FlateDecode streams, inflates the data using the browser’s native
DecompressionStream("deflate")— no external library is needed. - Inside the decoded text-showing operators (
TjandTJ), finds your phrase within the parenthesized PDF strings and replaces each matched character with a space, so the glyphs vanish from the text layer. - Re-compresses the stream with
CompressionStream, fixes the stream’s/Length, and reassembles a valid PDF for download.
Because the characters are removed rather than covered, selecting and copying the redacted region in the output yields nothing — the text is structurally absent, not merely hidden visually.
Why black boxes are not enough
This is the most important concept in document redaction. Drawing a black rectangle on a PDF is an annotation or a drawing instruction layered on top of the content stream — the text underneath is still there, still selectable, and still extractable by any PDF parser, copy-paste operation, or command-line tool. Numerous real-world disclosures of sensitive information have happened because organisations used visual overlay redaction rather than content-stream deletion. This tool removes the characters from the stream itself.
What this tool can and cannot redact
Works on: digitally created PDFs exported from Word, LibreOffice, InDesign, LaTeX, and most modern document tools. These store real text in content streams and the characters are literal ASCII or Unicode strings.
Does not work on: scanned PDFs where each page is a photograph with no text layer — the text is pixels, not characters, so there is nothing to delete from a content stream. Run OCR to generate a text layer first if needed.
May not work reliably on: PDFs using heavily subset-encoded fonts that store glyph indices instead of readable characters. In these cases the tool will report no match found even if the text is visible on screen, because the stored character codes do not correspond to the literal characters you typed.
Verification after redaction
Always re-open the downloaded PDF and:
- Try to select and copy the redacted area — paste into a text editor and confirm nothing appears.
- Use a PDF inspector or command-line tool to check the content stream if you need higher confidence.
- Never share the document without verifying — assume the redaction failed until you have confirmed it succeeded.
Everything runs locally in your browser; the PDF is never transmitted.