HomeRedaction Guides → Redact IP Addresses

How to Redact IP Addresses in a PDF

IP addresses commonly appear in logs, audit reports, and incident writeups. Use precise patterns (especially for IPv4) and verify the exported PDF to ensure the text is truly removed.

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
Confirm whether your document includes IPv4 addresses, IPv6 addresses, or both (often logs include IPv4).
Step 2
Add an IPv4 regex rule and preview matches.
See Example: IPv4 address (0–255 validation)
Regex
\b(?:(?:25[0-5]|2[0-4]\d|1?\d?\d)\.){3}(?:25[0-5]|2[0-4]\d|1?\d?\d)\b
Matches
  • 192.168.1.10
  • 10.0.0.1
  • 8.8.8.8
This avoids invalid octets like 999. If you still see false positives, consider requiring nearby context (e.g., “IP:” or “Client”).
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
If logs use labels, consider a label-scoped rule to reduce false positives.
See Example: Labeled IP address (context)
Regex
(?i)\b(?:ip|client|source)\s*[:#]?\s*(?:(?:25[0-5]|2[0-4]\d|1?\d?\d)\.){3}(?:25[0-5]|2[0-4]\d|1?\d?\d)\b
Matches
  • IP: 192.168.1.10
  • Client 10.0.0.1
  • Source: 8.8.8.8
Context-based rules help avoid matching version numbers or dotted identifiers in technical documents.
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 4
Preview matches across multiple pages to ensure you are capturing all occurrences (headers, tables, appendices).
Step 5
Export a final PDF where matched IP addresses are permanently removed.
Step 6
Verify the exported PDF by searching for known IPs and attempting copy/paste; keep the verification report for review.

Common mistakes to avoid

Using “any dotted number” patterns
Avoid matching generic dotted sequences. Technical PDFs often contain version numbers (e.g., 1.2.3.4) and identifiers that are not IPs.
Missing repeated occurrences
IP addresses often repeat in tables and summaries. Always preview matches across the document.
Skipping verification
Always verify the exported PDF. Logs and reports are high-risk for accidental leaks if masking is used instead of removal.

FAQ

Do I need to redact private IPs (192.168.x.x)?
That depends on your policy. Many organizations still redact internal IPs in public releases. Use explicit rules that match your requirements.
What about IPv6 addresses?
IPv6 patterns are more complex and vary in shorthand forms. Start by verifying whether your PDFs contain IPv6; then add a pattern tailored to those formats and preview carefully.
What if the PDF is scanned?
Scanned/image-only PDFs are not supported in PermanentRedaction at this time.