Find and Replace Text
Find and replace every occurrence of a word or phrase at once. The result updates live as you type the search term, with a running count of replacements made. Match case, match whole words only, or switch on regular expressions for pattern-based search and replace.
Find and Replace Text tool
How to use it
- Paste your text into the box.
- Type what to find and what to replace it with.
- Turn on Match case, Whole word or Regex if needed, then copy the result.
What is search and replace?
Search and replace scans your text for every occurrence of a term and swaps each one for new text in a single pass. Under the hood, this find and replace tool builds one regular expression from your settings and applies it globally.
whole word: new RegExp("\\b" + escaped(term) + "\\b", "gi")
g = replace all, i = ignore case unless Match case is on
When Regex is off, special characters in your search term are escaped automatically, so searching for 3.5 or (draft) just works. The \b markers are word boundaries: they make the pattern match art but not start or party. Turn Regex on and your own pattern is used as written, including capture groups you can reuse as $1 and $2 in the replacement.
Worked example
Mini regex cheat sheet
| Pattern | Matches | Example |
|---|---|---|
\d | Any digit 0 to 9 | \d{4} finds 2026 |
\w | Letter, digit or underscore | \w+ finds each whole word |
\b | A word boundary | \bis\b matches is but not this |
. | Any character except a line break | c.t matches cat, cot and cut |
* | Zero or more of the previous item | ho*p matches hp, hop, hoop |
+ | One or more of the previous item | \s+ finds every run of whitespace |
? | Previous item is optional | colou?r matches color and colour |
( ) | Captures a group for reuse | find (\w+), (\w+), replace $2 $1 |
Match options explained
By default the tool replaces every occurrence at once and ignores case, so searching for cat changes Cat, CAT and cat alike. The status line reports how many replacements were made, which doubles as a quick way to check how often a term appears. Leave the replace box empty to delete every match.
‘Match case’ makes the search exact, so replacing ‘Apple’ leaves ‘apple’ alone; use it when a word is also a brand or a name. ‘Whole word’ only replaces the term when it stands on its own, so replacing ‘is’ will not change ‘this’ or ‘island’. Skipping that option on a short word is the classic way to corrupt a document with one click.
Using regular expressions
Turn on ‘Regex’ to search by pattern instead of literal text. A few patterns cover most jobs: \d+ matches any run of digits, \s+ matches any run of spaces and tabs, [A-Z]{2,} matches acronyms of two or more capitals, and \bcolou?r\b matches both color and colour. Parentheses capture parts of the match for reuse in the replacement as $1, $2 and so on, and $& inserts the whole match. Find (\w+), (\w+) and replace with $2 $1, for example, turns a list of Last, First names into First Last.
The anchors ^ and $ match the start and end of the whole text, not of each line, and a dot matches any character except a line break. Characters with special meaning in regex (. * + ? ( ) [ ] { } | \ ^ $) need a backslash in front of them. When Regex is off, the tool escapes them for you, so a plain search for ‘3.5’ or ‘(draft)’ just works. An invalid pattern shows an error in the result box instead of failing silently.
Compared with Word and Google Docs
Word, Google Docs, Notepad and VS Code all open find and replace with Ctrl+H on Windows, and all except Notepad support some form of regex. The advantage here is speed for text that lives outside a document: a list from an email, a chunk of HTML, a CSV export. Paste, replace, copy back, with no file to open or save.
Common uses
- Bulk editing names, terms or URLs
- Fixing a repeated typo across a document
- Reformatting data with regular expressions
- Swapping placeholders for real values
- Stripping prefixes or tracking parameters from a list of URLs
- Converting Last, First name lists into First Last
When to use it
- You need to replace a word in a whole document at once, such as a renamed product across a long page.
- A pasted article is full of tracking links and you want to delete every URL from the text in one go.
- A list of names in Last, First format has to become First Last, which one regex swap handles.
- You want to remove everything in square brackets, footnote markers included, from copied text.
- The same typo appears dozens of times and fixing it by hand would take longer than one find and replace.
Related tools
Remove Line Breaks has ready-made options for joining lines, so you skip writing a \n pattern yourself.
Remove Extra Spaces collapses messy whitespace in one click instead of a hand-built \s+ replacement.
Slug Generator performs a whole chain of replacements at once, turning any title into a clean URL slug.