Word Replacer
Find and replace any word, phrase, or pattern in text. Supports regex, case-sensitive, whole-word, and bulk multi-pair replace. Free, browser-side.
About Word Replacer Tool
Word Replacer is a browser-based find-and-replace utility with four matching modes — literal substring, case-sensitive substring, whole-word (word-boundary aware), and full JavaScript regular expression (ECMAScript flavour with /g, /i, /m, /s flags). The literal mode uses String.prototype.replaceAll() for raw character matching. The whole-word mode wraps your search term with \b word-boundary anchors, so 'cat' will not match inside 'category' or 'concatenate'. The regex mode passes your pattern straight to a RegExp constructor — letting you use capture groups, lookahead/lookbehind, character classes, quantifiers, and backreferences ($1, $2) in the replacement string. The bulk mode reads one find→replace pair per line (split on the ASCII arrow '→' or the keyboard-friendly '->') and applies them in order, top-to-bottom — meaning later pairs see the output of earlier ones, which is useful for chained transformations but also a footgun if a later replacement re-matches earlier output. Typical workflows: search-and-replace variable names across a code snippet (whole-word mode), fix typos across a long document, redact PII with regex like \b\d{3}-\d{2}-\d{4}\b for US SSNs, normalise data formats (DD/MM/YYYY to YYYY-MM-DD via regex), and run translation glossary swaps with bulk mode.
What is the difference between 'Whole Word Only' and a regex with \b?
Functionally identical. Whole-word mode just wraps your literal search term in \b...\b automatically and escapes regex special characters first, so '$5' searches literally for the dollar-5 token without you having to escape the dollar sign. If you want word-boundary matching plus regex features (alternation, quantifiers), enable Use Regex and write the \b yourself: '\b(cat|dog)\b' matches the standalone word cat or dog but not 'category' or 'doghouse'.
Are JavaScript regex flags like /g, /i, /m, /s supported?
Yes implicitly. The tool always uses /g (global) so all matches replace at once (or first-only if you pick that mode, which sets the flag off). Case-sensitive option toggles /i. The /m flag (multiline ^ and $ anchors per line) and /s flag (dot matches newline) are not directly exposed — but if you write your pattern inline as 'foo$' it will only match at string end by default. To anchor per line, use (?m) inline flag at the start: '(?m)foo$' matches 'foo' at any line end. For dotall, use '[\s\S]' as a portable alternative to /s.
Can I use capture groups and backreferences ($1, $2) in the replacement?
Yes — Word Replacer uses native JavaScript String.replace() so all standard replacement patterns work: $& (whole match), $` (text before match), $' (text after match), $1-$99 (numbered capture groups), $<name> (named groups via the (?<name>...) syntax). Example: find '(\w+)@(\w+\.\w+)' and replace with '$1 at $2' converts '[email protected]' to 'alice at example.com'. Useful for swapping date formats — find '(\d{2})/(\d{2})/(\d{4})' replace '$3-$2-$1' converts '24/12/2025' to '2025-12-24' (ISO 8601).

How does Bulk Replace ordering work — can a later pair re-match earlier output?
Yes, and this is a common pitfall. Each pair runs in sequence on the current text state. If pair 1 changes 'cat' to 'dog' and pair 2 changes 'dog' to 'horse', you end up with 'horse' everywhere — not what you wanted. Workaround: use a placeholder for the first pass. Pair 1: 'cat' → '__TMP1__'. Pair 2: 'dog' → 'horse'. Pair 3: '__TMP1__' → 'dog'. This guarantees independence. Bulk mode is line-by-line on the form 'find → replace' (use → or -> as separator); blank or malformed lines are ignored.
Why does my regex search not find what I expect?
Three common causes. First, special characters not escaped: dot (.), star (*), plus (+), question mark (?), parentheses, brackets, braces, backslash, caret, dollar, pipe — must be backslash-escaped to be matched literally. Second, greedy vs lazy quantifiers: '<.*>' matches from the first '<' to the last '>' on the line; use '<.*?>' for lazy matching. Third, case sensitivity — if your text is 'HELLO' but you search 'hello' without enabling case-insensitive, no match. Test on a small sample first; the Matches Found counter shows zero when nothing matched.
Is there an undo button if the replacement was wrong?
No undo built in — but you can prevent disasters by copying the original to a second tab first (clipboard) or by running Replace First Only mode for a test before committing to Replace All. The 'Total Replacements' counter shown after each run tells you how many substitutions happened, so an unexpectedly high number (say you expected 5 but got 200) is a red flag to inspect output before pasting it back into production. Tab refresh loses everything — copy result out before navigating away.
Does my text leave the browser?
No. All find/replace runs in browser JavaScript via String.replace() and RegExp directly on the textarea value. No fetch() to a server, no analytics with payload, no localStorage write. DevTools Network tab confirms zero outbound requests when you click Replace. Safe for sensitive content like internal source code, customer PII, legal documents, or encryption keys — nothing is ever uploaded or logged.
