Find and Replace Text
Find and replace text online with live preview and match count. Match case, whole word, regex with capture groups, and up to 10 rules. Private in your browser.
How to use Find and Replace
- 1Paste your text, then type what to find and what to replace it with.
- 2Choose match case, whole word or regex, and add more rules if you need them.
- 3Check the match count and highlighted preview, then copy or download the result.
What makes it better
- Live match count and a highlighted Matches preview
- Regex mode with $1 capture groups and \n or \t in the replacement
- Up to ten rules applied one after another
- Match case, whole word, multi-line and dot-all switches
- Friendly message instead of an error for an invalid pattern
About Find and Replace
Find and Replace swaps every match in your text at once and shows how many matches it found. Use plain text for simple edits, or switch on regular expressions to rewrite patterns with $1 capture groups. Add up to ten rules and they run in order, each one working on the result of the one before.
Common uses
- Fix a misspelled name or term everywhere in a long document.
- Reformat dates, for example turn 2026-11-10 into 10/11/2026 with a regex and capture groups.
- Remove or swap prefixes, tags or brackets across a pasted list or log.
- Run a series of clean-up rules, such as trimming labels and replacing separators, in one pass.
Example
Input
My favourite colour is blue. She painted the door a bright colour. The colours of the flag: red, white and blue.
Result
My favourite color is blue. She painted the door a bright color. The colors of the flag: red, white and blue.
Good to know
- Replacement in plain mode is literal: a dollar sign or backslash is inserted exactly as typed. In regex mode $1, $&, $<name>, \n, \t and \\ are expanded.
- At most 100,000 matches are replaced and the work stops after about a second and a half, so a pattern that backtracks badly cannot freeze the page for long. A notice appears when that happens.
- An empty Find field changes nothing. Highlights show matches of the first rule in the original text.
Find and Replace FAQ
How do I replace all occurrences at once?
Every match is replaced as soon as you type the Find and Replace values. The result box always shows the full replaced text and the count of matches.
How do I use capture groups in the replacement?
Turn on Regular expression, wrap part of the pattern in parentheses and refer to it as $1, $2 and so on. For example, find (\w+) (\w+) and replace with $2 $1 to swap two words.
What does Whole word do?
It only matches the term when it is not part of a longer word, so cat does not match category. Letters, digits and underscores count as word characters, including accented letters.
Can I replace with a line break?
In regex mode type \n in the Replace field to insert a line break and \t for a tab. In plain mode the text is inserted exactly as you type it.
Why does it say my pattern is not valid?
The pattern uses JavaScript regular expression syntax, so an unclosed bracket, a stray parenthesis or a repeat with nothing before it is rejected. The message names the problem and your text is left unchanged.