Redact PDF

Published Updated

Draw black boxes over anything that must go, on any page. Every page is then rebuilt as a 150 DPI picture, so covered text leaves the file instead of hiding under a shape.

Why every page becomes a picture

A black rectangle placed on top of a PDF hides words from the eye but leaves them in the file, where copy and paste, search or a text extractor finds them. This tool never keeps the original page content. When you add a PDF, pdf.js renders each page as a 150 DPI JPEG. You draw boxes on those images, the boxes are painted into the pixels with an extra 6 pixels (about 1 mm) on every side, and a new PDF is assembled from the images only.

The PDF format has its own route. ISO 32000-1, section 12.5.6.23 defines redaction annotations: content is marked first, then a reader that applies them must remove all traces of it. That needs an editor able to rewrite page content. Rendering to pixels reaches the same end for whatever is covered, and the trade-offs are listed below.

What the redacted file holds

Part of the originalIn the redacted PDF
Text and images under a boxBlack pixels; nothing of them in the file
Text outside the boxesVisible in the picture, but no longer selectable or searchable
Title, author, keywords, XMPRemoved; only pdf-lib's producer, creator and dates are written
Bookmarks and linksRemoved
Filled form fields, note iconsPainted into the picture as shown, no longer editable
Page sizeSame as the source: in a test, A4, Letter, rotated and cropped pages all came out at the size they show in a viewer

Searching the redacted file for what was covered

The site's own Redact PDF component was run in Google Chrome 156, Chromium 153 (Playwright build, not Google Chrome), Firefox 155 and Playwright's WebKit build (not the Safari app). Boxes were drawn with the mouse on a generated four-page PDF holding 22 marker strings, such as RDX-HELV-UNDER-1111. Each redacted file was then searched three ways: the text pdf.js extracts, every object in the file with its streams decompressed (pdf-lib, and qpdf through pikepdf), and the pixels of the page images. The same searches found all 22 markers in the original.

Marker in the test PDFIn the redacted file, all four browsers
Words under a box: Helvetica, Times and Courier lines, white text on white, a filled form field, a line on a page turned 90 degrees and a line running up the pageNot found by any of the three searches. Every pixel inside each marker's area is pure black (value 0 in all three colour channels)
Words outside the boxes, including a page with no box at allVisible in the page picture, but pdf.js finds no text on any page
Invisible text outside the boxes, the kind OCR software lays over a scanGone: neither in the picture nor in the file
Title, author, subject, keywords and XMP metadataNot found. The file information names only pdf-lib as producer and creator, with dates
A bookmark, a note's text, a web link's address and an attached fileNot found. The redacted file has no bookmarks, annotations or attachments

Each page of the result holds one JPEG image and a short instruction that draws it, with no fonts and no text. A page turned 90 degrees in the source comes out as a landscape page with no rotation flag.

One box went missing in the WebKit build. The drag over a 6-point line was 12.8 screen pixels tall, just above the tool's minimum of 12; the other three browsers kept it as a box, the WebKit build did not, and that line stayed readable in its output. The tool drops any box under 12 screen pixels in either direction without a message. On a Letter page shown at full preview size, 12 pixels is about 5 mm, so draw boxes a little taller than small print and check the redaction count above the page after each one.

File size and waiting time

Dense text pages (US Letter, 52 lines of 10-point text each), one box on page 1. Time runs from adding the file until the pages show, plus from Redact & Download until the file is ready:

Source PDFChrome 156Chromium 153Firefox 155WebKit build
1 page, 2,995 bytes600,535 bytes; 0.16 s600,537 bytes; 0.16 s669,442 bytes; 0.19 s828,782 bytes; 0.21 s
10 pages, 23,874 bytes6,355,408 bytes; 0.75 s6,355,409 bytes; 0.71 s7,058,970 bytes; 0.65 s8,776,200 bytes; 0.93 s
40 pages, 93,278 bytes25,555,096 bytes; 2.7 s25,555,096 bytes; 2.6 s28,377,130 bytes; 2.1 s35,288,378 bytes; 3.2 s

Every page becomes a 150 DPI JPEG, 1,275 x 1,651 pixels for Letter, whatever it held before, so 40 pages of plain text grow from 93 KB to between 25.6 MB (Chrome 156) and 35.3 MB (the WebKit build). Each browser has its own JPEG encoder, which is why the sizes differ.

Redacting a PDF

  1. Step 1

    Add the PDF

    Every page is rendered at 150 DPI before you start, with a counter as it goes, so a long file takes a moment.

  2. Step 2

    Draw the boxes

    Drag on a page to draw one, drag its middle to move it or an edge to resize it. Use the arrows to reach other pages.

  3. Step 3

    Redact and download

    The button works once at least one box exists. The new file is named after yours with -redacted added.

Before you send it

  • Page through to the end. Boxes belong to one page each, and the total count shows above the preview.
  • Draw generously. The extra margin is only about 1 mm, so cover descenders and any signature that strays outside its line.
  • Expect some softness. Pages are stored as JPEG, a lossy format that MDN notes can give unsatisfactory results on sharp content such as text and diagrams.
  • Treat the original as confidential. It still holds everything you covered.
  • For a face or plate in a photo, Blur & Pixelate Image works on the image. For author and dates only, PDF Metadata Remover keeps text searchable.

Redaction questions

Is the text under a box really removed?

Yes. Each page is turned into a picture first, the box is painted into that picture, and the new PDF is built from the pictures alone, so no text layer survives to be copied. A rectangle drawn with a PDF editor's shape tool leaves the words underneath.

Why can't I search or copy text in the result?

Every page, including pages without boxes, is now an image. That is what makes the redaction dependable. Keep the original for your own use and send the redacted copy.

Do the pages keep their size when printed?

Yes. Each output page takes the size the source page shows in a viewer, so A4 stays A4 and a rotated page stays landscape. The 150 DPI image is fitted to that page, and a crop box in the source sets the new page edge.

Can I redact a password-protected PDF?

A PDF that needs a password to open cannot be rendered, so the tool shows an error. Remove the password with Unlock PDF, redact that copy, and delete the copy without a password afterwards.

Are form values and comments kept?

They are painted into the picture just as they look on the page, so a filled-in value stays readable unless a box covers it. They stop being editable fields or comments.

Does the file get bigger?

For text, by a lot: each page becomes a picture, and a page picture takes far more bytes than the text that drew it. A one-page Letter PDF of dense text, 2,995 bytes, came out at 600,535 bytes in Chrome 156 and 828,782 bytes in the WebKit build. PDF Compressor can reduce it again if needed.

Does a hidden OCR text layer survive redaction?

No. Scanned PDFs often carry invisible text over the page so that it can be searched. The redacted file is built from page pictures only, so that layer is gone everywhere, inside and outside the boxes. In the test above, an invisible line outside every box could not be found in any of the four browsers' output.

Can faint letters show through a black box?

Not in the test above. Inside every box, all pixels of the page image were pure black in all four browsers, including over white text and a filled form field. The box is painted into the picture with an extra 6 pixels on each side before the picture is saved as JPEG.

Why did a box I drew disappear?

A box smaller than 12 screen pixels in either direction is dropped as soon as you let go, without a message. That is about 5 mm on a Letter page shown at full preview size, so a box drawn tightly over small print can vanish. Drag a little wider and taller than the text, and check that the redaction count above the page goes up.

Are attachments and links removed too?

Yes. The test file's attached text file, its web link, its bookmark and its comment were all missing from the redacted output in every browser. Only the page pictures and pdf-lib's producer, creator and dates are written.

Related Tools