Saved

Press the star next to a tool's name to save it.

All my tools

Find and Replace Text

Paste your text, enter what to look for and what to put in its place, and this find and replace text tool changes every match at once. Regular expressions are supported.

Leave Replace with empty to delete every match.

Your text stays in your browser. Nothing is uploaded.

Result

Enter your text and press Replace all.

A find and replace text tool saves you from editing the same word by hand again and again. Paste your text, type what you're looking for and what should go in its place, and this find and replace text tool changes every match in one go and tells you how many were changed. You can ignore capital letters, match whole words only, or use regular expressions for more advanced patterns. It's useful for cleaning up documents, updating names and fixing data. The text stays in your browser, so it's safe to use with private content.

How to use find and replace text

  1. Paste your text into the large box.
  2. Enter the text to find.
  3. Enter the replacement, or leave it empty to delete each match.
  4. Set your options.
  5. Press Replace all, then copy the result.

Find and replace example

Suppose that your text says “The colour of the Colour chart” and you want the American spelling. With Find set to colour, Replace with set to color, and Ignore capital letters switched on, both matches are changed, and you get “The color of the color chart.” If you leave capital letters on, only the lowercase word is changed, and “Colour” stays as it was.

The options explained

  • Ignore capital letters finds a word however it is capitalized. The replacement is inserted exactly as you typed it.
  • Whole words only stops a search for “cat” from changing “category” or “concatenate.”
  • Use a regular expression treats the Find box as a pattern instead of plain text.

What is a regular expression?

A regular expression, often shortened to regex, is a sequence of characters that specifies a match pattern in text. These patterns are used by string-searching algorithms for find and replace operations, and also for input validation. They let you describe what you are looking for instead of naming it exactly. Here are a few useful patterns:

  • \d+ matches one or more digits.
  • \s+ matches any run of spaces, tabs or line breaks.
  • ^ and $ match the start and end of the text.
  • (\w+) (\w+) captures two words, which you can swap with $2 $1 in the replacement box.

Handy cleanup jobs

  • Remove double spaces: turn on regular expressions, find two or more spaces with a space followed by a plus sign, and replace with one space.
  • Swap a name throughout a contract by using whole words only.
  • Delete a repeated phrase by leaving the replacement empty.
  • Change a date format using a regular expression with groups.
  • Update a product name throughout a price list or a set of instructions.

Check before you use the result

Replacing everything at once is quick, but it can make mistakes that are easy to miss. The word “he” appears inside “the,” and a short name might appear within a longer one. Whole words only prevents most of those problems. Compare the number of matches with what you expected. If it's far higher, your search is probably too broad. If you'd like to see exactly what changed, paste the two versions into a diff checker.

Doing several replacements

Press Use as new text to move your result back into the main box, then enter your next search. Doing replacements one at a time in this way lets you review each change. The order can matter. If you replace “cat” with “dog” and then “dog” with “bird,” every original “cat” ends up as “bird,” which may not be what you intended.

Is my text private?

Yes. All the matching happens inside your browser, and nothing is uploaded or stored. That makes the tool suitable for contracts, code and customer lists. Copy your result before you leave the page, because it isn't saved anywhere.

Plain search or regular expressions?

For most jobs, a plain search is all you need. It looks for exactly what you typed, and characters such as dots, brackets and question marks have no special meaning. Regular expressions are worth learning when the thing you want to change varies from place to place, such as phone numbers, dates or any word that follows a particular label. If a pattern doesn't behave as you expected, try it on a short sample first, so that you can see what it matches before you run it on a long document.

Who uses find and replace?

  • Writers and editors correct a repeated spelling or rename a character.
  • Office staff update a company name or an address in a template.
  • Developers rename a variable or tidy up copied data.
  • Students fix a term that was used wrongly throughout an essay.

Common mistakes

  • Forgetting Whole words only. Short words appear inside longer ones.
  • Leaving special characters unescaped. In regex mode, a dot matches any character.
  • Replacing in the wrong order. Later replacements can affect earlier ones.
  • Not checking the count. It tells you whether the search did what you expected.

Test a pattern with the regex tester, change capitals with the case converter, and put lines in order with sort lines alphabetically.

What next

Use this often? Add Find and Rep to your Home screen.

Frequently asked questions

How does the find and replace text tool work?

It searches your text for every match and swaps each one for your replacement.

Can I delete words with it?

Yes. Leave Replace with empty.

Does it support regular expressions?

Yes. Turn on Use a regular expression. Use $1 for groups.

What does Whole words only do?

It stops a search from matching part of a longer word.

Is my text uploaded?

No. Everything happens in your browser.

What went wrong?

We only receive the reason you pick, never what you typed into the tool.

Thanks for your feedback.

More Text & Writing Tools