Skip to main content

20% off your first year with code See plans

Guide · How-to guide · PDF

How to anonymise a PDF without leaving data under the black box

Anonimatum Team

In short

Anonymising a PDF means permanently removing personal data from what you see, from the text layer and from the metadata. Drawing a black box or highlighting in black is not enough: the text stays in the file and can be copied.

Every few months a court filing or government release makes the news because someone copied the “redacted” text and pasted it into a new document. It is rarely sophisticated hacking. It happens when a box is drawn over the text instead of removing the text. Under the UK GDPR, the file still contains personal data and, once published or emailed, you may be looking at a reportable breach.

This guide explains what a PDF actually contains, a tool-agnostic method to anonymise it, how to do it in Anonimatum, and — most importantly — how to check the output is clean before anyone else sees it.

Step by step

  1. List the data you need to remove

    Note direct identifiers (name, NI number or SSN, email, phone, bank details) and indirect ones (address, dates, unique roles), depending on whether you will publish, disclose or use the file internally.

  2. Check whether the PDF has text

    Try to select a word. If you cannot, it is a scan: run OCR first so patterns and AI can read it.

  3. Upload the file and choose methods

    In Anonimatum, upload the PDF and tick catalogue patterns or your custom ones, the AI options you need and, where necessary, word sets or zones for signatures and stamps.

  4. Add a whitelist

    Include terms that must stay visible — your organisation, the legislation cited, the case number — so you do not redact more than necessary.

  5. Preview and review every mark

    Run the preview, go through the text highlighted in yellow, untick anything that is not personal data and add anything that was missed.

  6. Apply redaction and download

    Apply the anonymisation, open the result tab and download the anonymised PDF under a neutral file name.

  7. Verify the output

    Copy all the text, search for the data with Ctrl+F, check properties, comments and attachments, and strip metadata before sharing.

Why black boxes and highlighting do not anonymise

A PDF is not a picture of a page. A PDF exported from Word or a case management system stores every character as text, with its font and position. On top of that text you can add annotations — comments, highlights, shapes — and none of them delete what lies underneath. A black rectangle from the comment tools, black highlighting or white font on a white background all leave the data in place: it can be copied, indexed by search engines and read aloud by a screen reader.

Printing and rescanning is not a great fix either: the file becomes heavy and inaccessible, and if somebody runs OCR on it later, the text comes back. Real redaction means deleting the text and graphics in the area and only then painting the box that shows something was there. Our glossary entry on document redaction covers the concept in more depth.

The three layers you need to check

  • Visible layer: what appears on screen or on paper, including images, stamps and scanned signatures.
  • Text layer: the actual text that you can copy, find with Ctrl+F or extract with any tool. In an OCR’d scan, it is invisible text sitting behind the image.
  • Metadata and hidden items: author, title, producing software, comments, bookmarks, embedded attachments, optional layers and form fields.

A generic method to anonymise a PDF

Before opening any tool, decide what has to go. Re-identification risk depends on context: a name is obvious, but a reference number, a postcode and a date of birth together can point to one person. In the UK, the usual list includes names, National Insurance numbers (for example QQ 12 34 56 C, a format reserved for specimens), NHS numbers, addresses and postcodes, phone numbers, emails, bank details, vehicle registrations and signatures. In US files, add Social Security numbers (such as 123-45-6789, fictitious); the HIPAA Safe Harbor method lists them among the 18 identifiers to remove from health records.

Next, check whether the PDF has selectable text: try to highlight a word. If you cannot, it is a scan and you need OCR first — see our guide on how to anonymise a scanned PDF. Then use a tool that applies true redaction, review every mark, save a new file (never overwrite the original) and verify the result.

How to anonymise a PDF with Anonimatum

Anonimatum combines its own AI, running on servers in the European Union without sending your text to external language-model APIs, with patterns and human review. The workflow is: upload, configure, pick patterns, word sets, zones or AI options, preview, review and apply. The AI categories cover personal data under the GDPR (including vehicle licence plates since version 1.9.0), dates, addresses, monetary amounts and QR codes. The PDF anonymiser page summarises everything the tool can do.

For identifiers such as the National Insurance number or the SSN, you can create a custom pattern with a regular expression and reuse it across your team. The whitelist does the opposite job: terms that must never be blacked out even if they match a pattern, such as your organisation’s name or the statute you cite. Since 1.9.0, when you remove a mark during review you can ask Anonimatum not to mark that term again, for you or for your whole group.

Which method suits each type of data
DataBest methodFictitious example
NI number, SSN, email, phone, IBANCatalogue pattern or your own regular expressionQQ 12 34 56 C · 123-45-6789
Names, addresses, dates, amountsAI options, reviewed in the previewEmma Clarke, 14 Mill Lane, Leeds
Internal terms (nicknames, client codes)Word setCLI-0042
Signatures, stamps, logos, photosDrawn zone or saved figure patternHandwritten signature at the foot

How to verify the PDF is clean

Verification is not optional: redaction is irreversible and anything you publish cannot be recalled. Open the output in a different reader from the one used to produce it and run these checks:

Minimum checks before sharing

  • Select all (Ctrl+A), copy and paste into a plain text editor: no redacted data should appear.
  • Search with Ctrl+F for the surname, NI number or SSN and email address: zero hits.
  • Open the document properties (author, title, subject, keywords).
  • Check there are no comments, bookmarks, attachments or layers with personal data.
  • Look at the file name: “Report_EmmaClarke.pdf” undoes all your work.
  • Review headers, footers, footnotes and tables, where stray data tends to survive.

To clean metadata, use the PDF metadata remover, which strips author, dates and properties without touching the visible content. Our glossary explains what metadata is and why it often reveals who drafted a document.

Common mistakes when anonymising PDFs

  • Using drawing or comment tools in a PDF reader instead of a genuine redaction function.
  • Trusting automatic detection blindly: no AI or pattern is right every time; human review is part of the process.
  • Forgetting indirect identifiers: a unique job title (“the head of planning”), a date of birth or an address identify someone just as well as a name.
  • Over-redacting: blacking out dates, amounts or case numbers that should remain makes the document useless. A whitelist prevents this.
  • Anonymising the PDF but sending the original Word file, or leaving drafts in shared folders.
  • Not cleaning metadata or the file name.

Frequently asked questions

Is a black rectangle in a PDF enough?

Not if it is an annotation or a drawing. The text remains underneath and can be copied or searched. You need a function that deletes the content in the area before painting the box.

Is anonymising the same as pseudonymising?

No. Anonymisation removes the data permanently; pseudonymisation replaces it with a consistent value that can be reversed with separately held information. Pseudonymised data is still personal data under the UK GDPR and the EU GDPR.

Can I undo an anonymisation?

No, and that is the point. Keep the original somewhere secure and, if you need to reverse the process, use pseudonymisation with its mapping file.

What about scanned PDFs?

They need OCR so patterns and AI can read the text, and both the image and the OCR text layer must be redacted. Our scanned PDF guide covers this.

Redact PDFs properly, every time

Compare the plans and start anonymising PDFs with EU-hosted AI, patterns and a human review before anything is applied.

Sources and legislation

  1. ICO, Anonymisation guidance (UK GDPR)
  2. Data Protection Act 2018, legislation.gov.uk
  3. Regulation (EU) 2016/679 (GDPR), recital 26 and Article 4
  4. HHS, Guidance on de-identification of PHI under HIPAA (Safe Harbor)