Find and Replace Text

Paste text, type what to find and what to replace it with, and get the result with a match count.

Find and replace

What this tool does

Paste your text, type the word or phrase to find and the text to replace it with, and the result updates instantly with the number of matches. Tick Match case or Whole words if you need them, or tick the regular expression box to use patterns and capture groups such as $1. Copy the result or download it as a text file.

Replaces every occurrence of a word, phrase or pattern in the text you paste, and shows how many matches were replaced.

Works in plain mode, with match case and whole word options, or with regular expressions and capture groups.

How to use it

  1. Paste your text into the left box.
  2. Type what to find and what to replace it with.
  3. Tick Match case, Whole words only or the regular expression option if you need them.
  4. Check the match count and the result on the right.
  5. Press Copy result or Download .txt.

Why use this tool

Replaces every match in one go, with a live count of how many were found before you copy anything. Changing a name, a date format or a repeated phrase through a long text by hand is slow and misses instances. A replace-all with a visible match count makes the edit complete and checkable, and doing it in your browser keeps private text private.

Why we built it

We built the find and replace tool to show a live match count before you copy, with regex and capture groups when you need them. Test patterns with the regex tester and tidy the result with the text cleaner.

Who this tool is for

  • Writers and editors fixing a name or term throughout a document
  • Developers changing patterns
  • Anyone preparing text for a template

When to use it

  • Changing a name, product or term throughout an article or a script.
  • Cleaning up text pasted from another source.
  • Reformatting dates, numbers or codes with a regular expression.
  • Preparing text for code, a template or a mail merge.

How it works

In plain mode the text you typed is escaped so every character is taken literally, then every match is replaced. Whole words only wraps the pattern in word boundaries so "cat" does not change "category". Without Match case the search ignores upper and lower case.

In regular expression mode the Find box is a JavaScript pattern. Parentheses create groups, and $1, $2 and so on in the replacement insert them: finding (\d{2})/(\d{2})/(\d{4}) and replacing with $3-$2-$1 reorders 31/12/2025 to 2025-12-31.

Patterns that can match nothing, such as a* or empty groups, are refused because they would insert the replacement between every character.

What you give it, and what you get back

Input and output of Find and Replace Text
ItemDetails
Your textAny amount of plain text pasted into the box.
FindA word, phrase or, with the regex option, a pattern.
Replace withThe new text; may be empty to delete matches. $1, $2 refer to groups in regex mode.
OptionsMatch case, whole words only, regular expression.
ResultThe edited text and the match count, ready to copy or download.

Issues you may run into

Common problems with Find and Replace Text
What you seeWhy it happensWhat to do
Nothing is replacedThe text does not match, often because of case or whole-word settings.Untick Match case or Whole words only, and check spelling.
"Not a valid regular expression"The pattern has unbalanced brackets or other syntax errors.Escape special characters with a backslash or switch the regex option off.
Too many replacementsThe search term appears inside longer words.Tick Whole words only.
Special characters behave oddlyRegex mode treats . * ? ( ) [ ] as syntax.Turn regex off or escape them with a backslash.

Assumptions and limitations

Frequently asked questions

How do I replace all occurrences of a word?

Paste the text, type the word in Find and the new word in Replace with. All matches are replaced at once and counted.

How do I make it case sensitive?

Tick Match case. Otherwise "Cat" and "cat" are treated as the same.

How do I replace only whole words?

Tick Whole words only so that "cat" does not change "category".

Can I use regular expressions?

Yes. Tick the regex option, and use groups with $1, $2 in the replacement.

Can I delete text with it?

Yes. Leave Replace with empty and every match is removed.

Is my text sent anywhere?

No. It is processed in your browser.