Local Text Redaction Tool
Mask common emails, links, phone numbers and card-like strings, or apply custom literal and regex rules with a redacted-only result.
A reviewable redacted result
Choose recognized types and replace each detected region with a type label, one mask code point per original code point, or fixed text. Overlapping matches are merged so a URL containing an email is removed as one region. The report contains region counts and labels, without matched strings or original snippets. Copy and Download export only the redacted result.
Custom rules
Additional rules are a JSON array with type (literal or regex), pattern, flags and label. Labels use 1–24 uppercase ASCII letters, digits or underscores and start with a letter. Regex flags may be i, m and u without duplicates; global Unicode matching is applied automatically. Literal rules escape regex characters. At most 10 rules of 200 pattern characters are allowed; zero-length matches are rejected.
Pattern detection has limits
Built-in recognition is heuristic. Phones require 7–15 digits with a plus sign or common separators; card-like numbers require 13–19 digits and a Luhn checksum. Neither test proves a real phone or payment card. Names, addresses, unusual identifiers and unrecognized formats may remain. Review the complete result before sharing. Inputs are limited to 200,000 UTF-16 units and 5,000 matches; the worker can be cancelled and stops after 5 seconds.
Questions & answers
Does masking guarantee anonymization?
No. The tool applies only the selected patterns and your rules. It cannot infer every sensitive fact or prove legal anonymization.
Can a replacement expand dollar expressions?
No. Fixed replacement text is inserted literally; expressions such as $& do not reinsert matched private text. Newlines are preserved in mask mode.
Are inputs uploaded or stored?
No. Processing runs on this device in a Web Worker. Input text is not sent to an API or saved in local storage. Changing an option cancels old work and clears the prior result.
Other Languages
References
How we make sure
We check this tool with the automated test suites linked below. Example checks are shown in their original language.
- Verification method
- Check complete spans/overlap handling for email, URL, phone and card fixtures and preservation of nonmatches.
- Comparison reference
- Explicit text spans, UTF-16 offsets and valid/invalid Luhn fixtures.
- Verification scope
- Extraction/redaction rules cannot guarantee identification of all sensitive text.
Test source and cases (select a file to read it)
-
text-redaction-tools.test.js
- contact redaction includes complete URLs and merges overlapping email regions
- common separated phones and Luhn cards are recognized, invalid cards are left untouched
These checks cover the listed examples and boundaries, not every possible input. Round trips and checks using the same library are not independent verification.