Home →
Redaction Guides
→ Redact ZIP Codes
How to Redact ZIP Codes in a PDF
ZIP codes may appear harmless, but they can reveal geographic location and contribute to identifying individuals when combined with other details. When sharing legal filings, compliance documents, or customer records, removing ZIP codes may be necessary to protect privacy.
Important: PermanentRedaction permanently removes text from text-based PDFs. Scanned/image-only PDFs are not supported.
Quick notes
Tip: Many PDF editors can only mask text with black rectangles. Masking is not the same as permanently deleting text from the PDF layer.
Step-by-step
Step 1
Search the document for ZIP codes that appear in address blocks, forms, or contact sections.
Step 2
Use a pattern that matches both standard ZIP codes and ZIP+4 formats.
See Example: U.S. ZIP code pattern
Regex
\b\d{5}(?:-\d{4})?\b
Matches
- 32207
- 10001
- 94105-1234
This pattern matches both five-digit ZIP codes and ZIP+4 postal codes.
Using regex rules in PermanentRedaction
PermanentRedaction supports deterministic redaction rules using regular expressions.
Patterns like this can be applied across an entire document to permanently remove matching text.
Step 3
Preview matches across the document to confirm you are only matching ZIP codes and not unrelated numeric values.
Step 4
Apply redactions to the matched ZIP codes.
Step 5
Export the PDF and verify the text layer no longer contains the ZIP codes.
Common mistakes to avoid
Using a broad number pattern
Generic digit patterns may match phone numbers, case numbers, or account numbers.
Missing ZIP codes in tables
Addresses in spreadsheets or tables may contain ZIP codes that repeat across rows.
Not verifying the export
Always confirm the ZIP codes cannot be searched or copied from the final PDF.
FAQ
Why redact ZIP codes?
ZIP codes can reveal geographic location and may contribute to identifying individuals when combined with other data.
Will this pattern match ZIP+4 codes?
Yes. The regex includes an optional section for ZIP+4 formats.
Does this work on scanned PDFs?
Only if the document contains a searchable text layer.