Multi-keyword batch replacer
Apply many “keyword=>replacement” rules to text in one pass, in written order. Literal or regex matching, case switch, \n escape handling and per-rule hit counts — all local.
Runs in your browserEvery computation happens in your browser — your data never leaves this device.
Rules run in written order: earlier rules change what later rules can match.
Replaced text
The result is text only — no file is written. Per-rule hit counts are listed below.
Enter text and rules to replace
Rules: 0 · Rules applied: 0 · Replacements: 0
What this tool does
- Anonymise or rename a batch of keywords (brand names, old model numbers, contact details, sensitive words) before sharing text
- Tidy up formatting with regex rules, for example masking 11-digit phone numbers
Example
Input
Hello World, user_name Rules: World=>Universe / user_name=>userName
Output
Hello Universe, userName
Rules run in order and the detail list reports how many hits each rule made.
Frequently asked questions
How are rules written?
One per line as keyword=>replacement. The keyword is trimmed, the replacement is kept verbatim (leave it empty to delete). Lines starting with # and blank lines are comments. To match a literal => use regex mode and escape it.
In which order do rules run?
Strictly in written order, with each rule applied to the previous result, so a=>ab followed by ab=>X turns ab into Xb, while the reversed order gives a different result. Hit counts are measured against the text at that step.
Literal vs regex mode?
Literal mode escapes metacharacters such as . + ( and matches plain text only. Regex mode compiles the keyword as a JavaScript regular expression (so (\w+), ^, $ work) and allows $1 and $& in the replacement. An invalid pattern reports that the expression cannot be compiled.
What does the \n escape do?
By default \n, \t, \r and \\ inside the replacement are decoded into real characters, which is handy for turning separators into line breaks. Disable the switch to keep them literal. Everything runs locally: no upload and no file is modified.
Keywords:batch text replacetxt_replaceoffline