A plain replace-all with a count
- Input
- Text: foo bar foo — Find: foo — Replace: baz
- Working
- Both occurrences of foo match, at the start and the end of the text.
- Result
- baz bar baz — 2 replacements
Find and replace words or patterns across a whole document at once, with match counts, whole-word and case options, plus a full regular-expression mode. Runs entirely in your browser — your numbers never leave this device.
Enter the text, what to find and what to replace it with, and every occurrence is replaced in one pass — with the match count shown, so you know before you copy the result whether the operation found 2 matches or 2,000. Plain mode treats the search text literally: characters that would be special in a pattern, such as dots and brackets, are escaped for you, so searching for “v1.2” finds exactly “v1.2” and not “v1x2”.
Two switches refine plain mode. Case-sensitive matching is off by default, so “foo” finds Foo, foo and FOO alike; turn it on when case carries meaning, as in product codes. Whole-word mode wraps the search in word boundaries, which is the difference between replacing the animal in “cat” and mangling “category” into “dogegory”. Regular-expression mode removes the training wheels: the search field becomes a JavaScript regular expression, the replacement can reuse captured groups ($2 $1 turns “John Smith” into “Smith John”), and an invalid pattern is reported as an error with no replacement performed, rather than failing silently.
Everything happens in your browser — the document you are editing is never uploaded or stored. For sensitive text such as contracts, manuscripts or exported chat logs, that is the whole point of using a local tool instead of a server-side one.
Plain mode searches for the exact characters you typed — a dot means a dot. Regex mode interprets the search field as a regular expression, so a dot means “any character”, \d+ means one or more digits, and parentheses capture groups you can reuse in the replacement as $1, $2 and so on. Use plain mode for words and phrases; use regex mode for patterns like dates, codes or repeated structures.
Because plain mode matches substrings anywhere: searching for “cat” finds the cat in “category” and “delicate” too. Turn on Whole word to restrict matches to standalone words bounded by spaces or punctuation. Whole-word uses the standard word-boundary rule, so it works for words made of letters, digits and underscores.
Not by default. With case sensitivity off, “foo” replaces Foo, FOO and fOo as well — one search text, three matches. Turn case-sensitive on when the capitalisation matters, for example when replacing a lowercase code in body text but not its uppercase heading version.
The tool reports the error, performs no replacement and returns your original text untouched with a count of zero. An unbalanced bracket such as “(” is the most common cause. Fix the pattern and run it again — your text is never partially edited by a failed pattern.
In plain mode, yes — the replacement is inserted literally apart from regex-mode group references. In regex mode, a $ followed by a number is read as a group reference ($1, $2), so write $$ when you mean a literal dollar sign in regex mode.
No. Find and replace runs entirely in your browser; the text is never uploaded, stored or tracked.
More in Text Tools · Browse all tools