Find and Replace
Replace every occurrence of a word or pattern in a block of text. Supports case sensitivity, whole-word matching, regular expressions and a live count of matches.
Your text is processed locally in your browser and is not uploaded to our servers.
Result
0 charactersWhat this tool does
Find and replace is the workhorse of text editing: change every color to colour, swap a placeholder for a real value, or reformat a list of dates. This tool does it on any block of text, with the options that matter — case sensitivity, whole-word matching, and full regular expressions for the jobs a plain search cannot handle. It shows a live match count, so you know how many changes it is about to make before you rely on the result.
How to use it
- Paste your text into the top box.
- Type what to find and what to replace it with.
- Adjust the options: turn on case sensitivity if Apple and apple should differ, or whole-word matching to avoid changing text inside longer words.
- Watch the match count so you know how many replacements happened.
- Copy the result, or use Swap to make the result the new input for a second pass.
How matching works
In plain mode, the tool searches for your exact text and replaces every occurrence. With Case sensitive off, matching ignores letter case. With Match whole words only on, a match must have a non-word character (or the start or end of the text) on both sides, so searching for cat changes cat and the cat. but not category or concatenate.
In regular expression mode, the Find field is treated as a regex, unlocking patterns: \d+ matches any run of digits, \s+ any run of whitespace, and parentheses capture groups you can reuse in the replacement as $1, $2 and so on. For example, finding (\d{4})-(\d{2})-(\d{2}) and replacing with $3/$2/$1 reformats 2026-07-24 into 24/07/2026.
A key safety feature: if your regular expression is invalid — an unclosed bracket, say — the tool catches the error and shows a clear message instead of freezing or throwing. Your text is never modified by a broken pattern. All replacement runs in your browser, so even very large texts are handled without a server round-trip.
Examples
Simple swap. Find teh, replace with the, and every typo is fixed at once.
Whole-word safety. To change the standalone word art to craft without touching start or part, turn on whole-word matching.
Regex reformatting. Turn a column of Last, First names into First Last: find (\w+),\s*(\w+), replace with $2 $1.
Collapsing blank space. Find \n{3,} in regex mode and replace with \n\n to reduce any run of three or more blank lines to a single blank line.
Common use cases
- Bulk corrections — fix a repeated typo or rename a term throughout a document.
- Localization — convert American spellings to British or vice versa.
- Data reformatting — rearrange dates, names or phone numbers with regex capture groups.
- Cleaning exports — strip or replace unwanted markers left by another system.
- Template filling — replace placeholders like
{{name}}with real values.
Privacy and security
Searching and replacing happen entirely in your browser. Your text and your patterns are never uploaded. Because the result is displayed as plain text, replacing content that contains HTML tags is safe — the tags are shown as characters, not rendered. Your options are remembered locally. See the privacy policy for more.
Frequently asked questions
What happens if my regular expression is invalid?
The tool detects the error and shows a message explaining that the pattern is not valid. Your text is left untouched, and the page keeps working — a broken pattern can never freeze the tool or corrupt your input.
How do I use captured groups in the replacement?
Turn on regex mode, wrap parts of your pattern in parentheses, and refer to them as $1, $2 and so on in the replacement field. $& inserts the whole match. To insert a literal dollar sign, use $$.
What does "match whole words only" do?
It requires a word boundary on both sides of the match, so searching for an changes the word an but not the an inside plan or another. It works in plain mode; in regex mode you control boundaries yourself with \b.
Can I replace across multiple lines?
Yes. Plain replacements work anywhere in the text, including across lines. In regex mode, use \n to match a line break, and remember that . does not match a newline by default.
Does it count matches before replacing?
The result updates live, and the summary shows how many replacements were made. To preview without changing anything, leave the replacement field set to the same text you are searching for, or read the count and then decide.
Related tools
Tools that pair well with the Find and Replace.