Find and Replace Text

Paste your text, type what to find and what to put in its place, and press Replace all. Find all highlights every match first, and Undo takes back any replacement.

Try an example
Plain-text files such as .txt, .csv, .md, .json, or .html.

About this find and replace tool

This tool works like the find and replace box in a text editor, but for any text you paste or upload. Search for a word or phrase, choose whether capital letters and whole words matter, and replace every match at once. Turn on Regex to search with regular expressions and reuse parts of each match with $1, $2, and so on, for example to swap names or reformat dates. Find all highlights every match before you change anything, the result shows removed text in red and new text in green, and Undo and Redo let you step back and forward through your replacements.

How to use find and replace

  1. Add your text. Paste it, type it, press Upload file, or press an example, which also fills in the find and replace fields.
  2. Say what to find. Type a word, a phrase, or a pattern, and turn on Case-sensitive, Whole word, or Regex as needed. A regex template fills in a common pattern.
  3. Check the matches. Press Find all to highlight every match and step through them with the previous and next buttons.
  4. Press Replace all. Every match is replaced in the text box, the changes are shown in red and green, and Undo takes it back. Copy or download the result when you are done.

Frequently asked questions

How do I delete every match instead of replacing it?

Leave the Replace with field empty and press Replace all. Every match is removed from the text.

What does Whole word do?

It only matches the search text when it is not part of a longer word. With Whole word on, replacing "grey" changes "grey cat" but leaves "Greyhounds" alone.

How do capture groups like $1 work?

With Regex on, each part of the pattern in parentheses is a group. In the replacement, $1 inserts the first group, $2 the second, and $& the whole match, so finding (\w+) (\w+) and replacing with $2 $1 swaps two words. Use $$ for a literal dollar sign.

Can I insert a line break or tab in the replacement?

Yes, when Regex is on: type \n for a line break and \t for a tab. Without Regex, the replacement is inserted exactly as typed.

Do ^ and $ match each line or the whole text?

Each line. With Regex on, ^ matches the start of every line and $ the end of every line, so replacing ^ with "> " quotes every line.

Does a case-insensitive replacement keep the original capitals?

No. Every match is replaced with the replacement exactly as you typed it, so "Grey" and "grey" both become "gray". Turn on Case-sensitive and run the replacement twice if you need different capitals.