Skip to content
Menu
Theme

Find and Replace Text

Find a word or pattern in any text and replace every match at once, with match case, whole words and regular expressions. Runs in your browser.

TextRuns in your browser
Paste or type. The result updates as you type.

What is find and replace?

Find and replace looks for a word, a phrase or a pattern in your text and swaps every match for something else. Most word processors have it, but sometimes you are not in a word processor. You are fixing a block of text copied from an email, a chunk of a CSV file, a config file, or a message you are about to paste into a chat. Opening a full editor for that is overkill.

This page gives you the same feature in a plain text box. Type what to look for in Find, what to put in its place in Replace with, and the result appears below with a count of how many replacements were made. Leave Replace with empty to delete every match.

Three options control how matches are found:

  • Match case makes “Apple” and “apple” count as different words. With it off, both are replaced.
  • Whole words only skips matches that sit inside a longer word. Replacing “cat” will then leave “category” alone. Accented letters count as part of a word, so this works with Vietnamese and other languages too.
  • Use regular expression lets you search with a pattern instead of fixed text, for example \d+ for any run of digits or [ ]{2,} for two or more spaces in a row.

Your text stays on your device. The search and the replacement run inside your browser and nothing is sent to a server.

How to use find and replace

  1. Paste your text into Your text. A sample is already there so you can try the tool first.
  2. Type the word or phrase you are looking for in Find.
  3. Type the new text in Replace with, or leave it empty to remove the matches.
  4. Tick Match case, Whole words only or Use regular expression if you need them.
  5. Read the Result box and the number of replacements under it. Both update as you type.
  6. Press Copy result to copy the new text.

FAQ

How do I delete a word everywhere in my text?

Type the word in Find and leave Replace with empty. Every match is removed. Tick Whole words only so that parts of longer words are not cut out by accident.

Can I use $1 to reuse part of the match?

Yes, but only with Use regular expression on. Put brackets around the part you want to keep, then write $1 for the first bracket, $2 for the second, and so on. $& stands for the whole match. With regular expressions off, a $1 in Replace with is inserted as plain text.

Why do I see “This regular expression is not valid.”?

The pattern has a syntax error, such as an opening bracket with no closing bracket. Fix the pattern and the result comes back. If you only wanted to search for a symbol like ( or ., turn Use regular expression off and the symbol is treated as normal text.

Should I type slashes around my regular expression?

No. Type only the pattern, without / at the start and end. Slashes are treated as part of what you are looking for.

Is there a limit on text length?

The text can be up to 100,000 characters. If it is longer, a warning appears and only the first 100,000 characters are used. The Find field can hold up to 1,000 characters, and a longer one shows a warning instead of a result.

Does this tool send my text anywhere?

No. Everything runs in the page on your own device. Nothing is uploaded or stored, and the text is gone once you close the tab.

Related tools