How to anonymize a document before sending it to AI
- 1.
Load the document
Drop a PDF with a text layer, a Word file (.docx), TXT or Markdown. You can also paste text into the "Document text" box.
- 2.
Review what was found
The list groups the details by type and the preview highlights them in the text. Untick anything that should stay and add your own phrases, such as a company name. To add a fragment, select it in the preview and click "Add selected text".
- 3.
Copy the text with placeholders
Choose placeholders such as [PERSON_1] and [EMAIL_1], or the [REDACTED] mask. Copy the result into the AI chat or download it as .txt or .md.
- 4.
Restore the data in the reply
Paste the AI reply into "Paste the AI reply". The placeholders turn back into names, numbers and addresses. If you plan to close the tab, download the mapping table first.
What the tool detects
Detection uses patterns and checksums, and a dictionary plus a few rules for names. It was built for Polish documents, so it also knows Polish ID numbers:
- Emails and phone numbers: international numbers with a + prefix and Polish numbers in digit groups. Amounts followed by a currency are not treated as phone numbers.
- Bank accounts: IBANs from EU countries and Polish 26-digit account numbers, checked with the mod 97 checksum. Payment cards are checked with the Luhn algorithm.
- Names: a first name from the dictionary followed by a capitalised word ("John Smith"), a name after "Mr", "Mrs", "Ms" or "Dr", and the Polish forms "Pan", "Pani" and "Sz.P.". Once a surname is found, it is hidden everywhere in the text, including Polish inflected forms.
- Dates of birth after "born", "date of birth" or "DOB", and the Polish "ur." or "data urodzenia". Other dates stay in the text.
- Polish addresses ("ul.", "al.", "pl.", "os." with a number, postcode with town) and Polish identifiers: PESEL, NIP, REGON, ID card and passport numbers, each with its checksum.
The first-name dictionary holds the 1,000 most common male and 1,000 most common female first names from the Polish PESEL register. It includes many international names such as John, Michael, Sarah and Elizabeth, but rarer English names may be missing.
What it can miss
Automatic detection does not replace reading the text yourself. These are the usual gaps:
- first names missing from the dictionary, and surnames that never appear next to a first name or a title,
- details written in lowercase, with typos, or in words ("born on the fifth of May"),
- street addresses outside Poland, such as "12 Baker Street, London",
- details that identify someone indirectly: a job title, a small company name, a case number or a description of an event.
Add anything missing as your own phrases. Every occurrence is hidden, whatever the letter case or accents. For numbers with a fixed format, such as a client number, add a regular expression. Patterns that could run for a very long time are rejected or stopped.
The PDF needs a text layer. Run a scan through OCR PDF first. In PDFs with columns or tables the reading order can get mixed up, so check the preview.
Placeholders or mask
Placeholders turn the details into labels: "Tenant [PERSON_2], email [EMAIL_1], address [ADDRESS_1]". The same person always gets the same label, even when the text uses a different form, so the AI can summarise a contract or draft a letter without mixing up the parties. The "Ask the AI to keep the placeholders" option adds a sentence at the top asking the AI not to change them.
Mask puts "[REDACTED]" everywhere. Use it when the task does not need the details and you will not restore them, for example when you only want the style improved.
How to restore the data in the AI reply
Paste the reply into the last box. Placeholders are recognised even if the AI changes them: drops the brackets ("PERSON_1"), changes the letter case or puts a space instead of the underscore ("[Person 1]"). Placeholders that are not in the table show up in a warning.
The mapping table (placeholder to original) exists only in the memory of the open tab. It is not saved in the browser, so it disappears when you refresh the page. For a longer conversation, download the table as a .csv file and load it later with "Load table". The file holds the real personal data, so keep it as safe as the original document and never paste it into the chat.
Pseudonymisation is not anonymisation under the GDPR
The GDPR treats these differently. Pseudonymisation (Article 4(5)) means the data can no longer be linked to a specific person without additional information that is kept separately. Recital 26 says that pseudonymised data which can be linked to a person with that additional information is still personal data. Data protection rules stop applying only to anonymous information, from which a person cannot be identified by means reasonably likely to be used (GDPR text on EUR-Lex).
Text with placeholders plus a mapping table is therefore pseudonymisation: with the table, you still know who [PERSON_1] is. The rest of the document can also give a person away. The tool reduces how much personal data reaches the AI service, but it does not decide whether you are allowed to use that service. Your employer's AI policy, client agreements and your data protection officer come first. For health data and other special categories, ask the data protection officer before you send anything.
When you need a PDF, not text
This tool gives you text to paste. If you have to send the document itself with the data hidden, use Redact PDF. It turns pages with marks into images, so no text can be copied from under the black boxes. With a PDF loaded here, you can copy the details found and paste them into Redact PDF as search phrases. To extract the plain text of a PDF without hiding anything, use PDF to Text.
Frequently asked questions
Is it safe to upload a contract to ChatGPT?
+
How do I remove personal information from a PDF?
+
What is the difference between anonymisation and pseudonymisation?
+
Is the document or the mapping table uploaded anywhere?
+
What if the AI changes or drops a placeholder?
+
Does it work with a scanned document?
+
Guides using this tool
Updated: