Launch offer: 50% off Pro on every one-time tool · ends Oct 25
Cosmovex/tools

Redact credit card numbers in a PDF, checked with the Luhn test

Redact card numbers with PDF Redact

This opens a payment record with two 16-digit numbers, only one of which passes the Luhn check, plus an IBAN. The card and IBAN finders are on: see which numbers are picked and which are left alone.

  1. Open the PDF. The Card numbers and IBAN-like patterns are ticked.
  2. Press Find matches: only 13 to 19 digit numbers that pass the Luhn check are listed.
  3. Mark them, then look at the page for card numbers written in groups the pattern did not read.
  4. Preview, export, read the report and download.
redact credit card numbers pdf black out card number in pdfremove credit card from pdfhide card number pdfredact iban in pdfpdf card number redaction
Open PDF Redact Free to start · no account

What to know

The Luhn check is the checksum that real card numbers satisfy. Requiring it removes most false hits: a 16-digit order or invoice number usually fails it, so it is not boxed. It also means a mistyped number will not be found, so read the pages as well.

The IBAN pattern looks at the shape only: two letters, two digits and a run of letters and digits of a plausible length, written with or without spaces. It does not compute the IBAN checksum, because for redaction a miss costs more than a false hit. Remember what else is on a payment record: expiry dates, security codes, the holder name and addresses. Search for those or box them by hand.

Updated · Cosmovex

Questions

Why was one of the 16-digit numbers not marked?

It does not pass the Luhn checksum, so it is not a valid card number. If it should still go, draw a box or add it as an exact term.

Does it find card numbers with spaces or dashes?

Yes, groups separated by single spaces or dashes are read. Numbers split across several text pieces by the PDF may need a manual box.

What do I lose when the output is made of images?

Text in the whole output can no longer be selected, searched or copied, links and form fields stop working, and the file is usually larger. That is the cost of making sure the covered content is really gone, and the tool says so before you export.

How do I know the black boxes really removed the text?

After export the tool re-opens the file it just wrote and checks it: it contains only page images, there is no text layer to extract, and the pixels inside every box are black. You should still open the result and read every page; the checks cannot tell whether you covered everything sensitive.

The free plan covers everything on this page. PDF Redact Pro ($29, paid once) is described on the PDF Redact page.