Tips & Tricks

How to Redact Credit Card and Payment Information From a PDF

Credit card numbers, bank account details, and payment information appear in PDFs more often than most people realize. An invoice includes the client's payment details. A contract lists bank routing numbers. An email receipt converted to PDF shows the last four digits of the card used. Sharing any of these documents without redacting the payment information exposes the individual or business to financial fraud.

Payment data is the most dangerous information to leave unredacted. Unlike a name or address, it can be used immediately for theft.

Redacting payment information through PDF Redaction means finding every instance of card numbers, account numbers, and routing numbers across the entire document, applying true redaction that removes the underlying data, and verifying that no recoverable trace remains. WukongPDF's PDF Security redact tool handles permanent data removal.

How to Redact Credit Card and Payment Information From a PDF

The Specific Patterns That Identify Payment Information

Credit card numbers follow predictable patterns that make them searchable. Visa cards start with 4 and are 16 digits. Mastercard starts with 5 and is 16 digits. American Express starts with 3 and is 15 digits. The numbers are often formatted in groups of 4 separated by spaces or dashes. Search for these patterns using regular expressions in the redaction tool's search function.

Bank account numbers are less standardized than card numbers, making them harder to find by pattern alone. Look for labels near the number: Account Number, Account No., Bank Account, Routing Number, ABA Number, SWIFT, IBAN. Search for these label strings and redact the number that follows each one. The label is the signpost. The number next to it is the target.

WukongPDF

Try Redact PDF

No installation needed. Works directly in your browser.

Get Started โ†’

Searching for Card Numbers in Document Headers and Footers

Payment information in headers and footers repeats on every page. A single unredacted card number in a header that appears on 20 pages means 20 separate redaction locations. Search headers and footers specifically by examining the first and last inch of each page. The redaction tool's search may not automatically scan header and footer regions if they are stored as separate page elements in the PDF structure.

After redacting, scroll through every page at thumbnail size and check the header and footer areas for any remaining visible digits. A card number in a header is often smaller and lighter than body text, making it easy to miss during a body-text-focused review. The thumbnail scan catches header and footer content that the detailed review overlooks.

Handling Partially Masked Card Numbers

Many documents already show partially masked card numbers, such as **** **** **** 1234. The last four digits alone may not be sufficient for fraud, but combined with the cardholder's name and the merchant information elsewhere in the document, they can be used for social engineering attacks. Decide based on the document's sensitivity whether to redact even partially masked numbers. For documents shared publicly or with unknown recipients, redact all digits.

The redaction tool's pattern search should match both full numbers and partially masked numbers. A search pattern that looks for groups of 4 digits separated by spaces or asterisks will find both 4111 2222 3333 4444 and **** **** **** 1234. Apply redaction to all matches, then manually review to confirm that the redacted content was payment information and not a benign number that happened to match the digit pattern.

Payment Data TypeSearch PatternWhere It Appears
Credit card number4 groups of 4 digits, or 15-16 consecutive digitsInvoices, receipts, payment forms
Bank routing number9 digits, often labeled Routing or ABAContracts, direct deposit forms, invoices
Bank account numberVariable length, labeled Account or AcctSame documents as routing numbers
Last 4 digits of cardLabeled Last 4 or XXXX-XXXX-XXXX-NNNNReceipts, order confirmations
CVV or security code3-4 digits, usually near card numberPayment forms, rarely in PDFs unless filled incorrectly

Verifying That the Redacted File Contains No Recoverable Payment Data

After applying redactions, run the same verification tests described for any redacted document: text selection test, copy-paste test, export-to-text test, and metadata inspection. Payment data is particularly high-stakes, so add an additional test: open the redacted PDF in a hex editor or text editor at the binary level and search for fragments of the redacted numbers. A true redaction removes the data at the binary level.

Test a random sample of redacted locations rather than relying on a full-document scan for large documents. Select 10 redacted regions across different pages and attempt to recover the underlying data from each. If all 10 are unrecoverable, the redaction process is working correctly and the remaining redactions can be trusted. If any of the 10 is recoverable, the redaction process failed and must be reapplied to the entire document.

PCI DSS Compliance and Redaction Requirements

Organizations that handle payment card data are subject to PCI DSS requirements that prohibit storing full card numbers, CVV codes, or magnetic stripe data after authorization. Redacting this data from PDFs that must be retained for business records, such as signed order forms that include full card details, is one way to bring the stored documents into compliance. The redaction must be permanent, true content removal, not visual covering.

PCI DSS also requires that card numbers be rendered unreadable anywhere they are stored. A PDF archive of old order forms where the card number was never redacted is a compliance gap. A one-time redaction project to process the entire archive brings it into compliance. The project is time-consuming but finite. It ends when the last card number in the last PDF has been permanently removed. Budget the time based on the archive size and the number of documents per hour that can be redacted and verified.

Disposing of the Unredacted Original Securely

The unredacted original contains all the payment data you just finished removing. Delete it or store it in an access-controlled, encrypted location separate from the redacted version. An unredacted original sitting in the same folder as the redacted version, or worse, in a cloud storage folder synced to multiple devices, defeats the purpose of the redaction. Anyone who finds the unredacted original has all the data you carefully removed from the shared version.

If the unredacted original must be retained for record-keeping, name it clearly to distinguish it from the redacted version. A filename like Invoice-1234-UNREDACTED-ORIGINAL-DO-NOT-SHARE.pdf makes its status unambiguous to anyone who encounters it. The naming convention is a procedural safeguard, not a technical one, but it is the simplest and most effective protection against accidentally sharing the wrong version.

WukongPDF

Try Redact PDF

No installation needed. Works directly in your browser.

Get Started โ†’