Find and replace text
Replace every occurrence of a word or a pattern, with optional regular expressions, whole-word matching and exact case.
- Free, unlimited
- 100% on-device
- No sign-up
Find and replace text
Result
| # | Word | Count | Share | Bar |
|---|
Three steps — nothing to install
Paste the text
The block you want to edit, however long. Nothing is sent anywhere.
Set find and replace
Plain text or a JavaScript pattern, whole words only if you want, case-sensitive if it matters.
Copy the result
The number of replacements is reported, so you can tell a working pattern from one that matched nothing.
Plain text and regular expressions
In plain mode every character you type is matched literally, including dots, brackets and question marks. That is the safe default, because a search for v1.0 should not treat the dot as a wildcard.
In regular-expression mode the pattern is compiled by JavaScript, so character classes, groups and lookarounds work. Replacement text can use $1 for the first captured group, $& for the whole match and the other JavaScript replacement tokens. An invalid pattern is reported with the browser's own message rather than being ignored, which is the failure mode of most find-and-replace widgets.
Whole words, case and what a boundary is
Whole-word mode wraps the pattern in word boundaries, so cat matches in the cat sat but not in category. A word boundary is defined by JavaScript as the change between a word character and a non-word character, and word characters are ASCII letters, digits and underscore. Accented letters count as non-word characters, so whole-word matching around café needs the regular-expression mode with explicit boundaries.
Case-sensitive mode is off by default, which matches the way people search. Turn it on when you are replacing an identifier, a code or a name where capitals carry meaning.
What it will not do
It replaces what you can see, once. There is no undo history beyond pasting the original again, no multi-file search, and no replacement across a line break unless your pattern explicitly matches one. For a structural change across many files, use your editor; for a one-off cleanup of a block of text, this is faster.
If you are removing rather than replacing, leave the replacement field empty. To remove entire repeated lines instead of a pattern inside them, the duplicate line remover is the right tool; to compare before and after, use the text diff.