Search

Find & Replace

Search through large documents and rewrite text with confidence.

Input Character Count: 0

Replace string ($&: entire match, $1, $2: capture groups)

Please input source text

Read aloud

Find & Replace Tool

Replace every occurrence of a word or pattern in a text at once. Search as plain text or as a JavaScript regular expression with flags, use $1 or $<name> in the replacement, see each match with its line and column, and undo single replacements before you copy the result. The replaced text can also be read aloud.

How to use

  1. Paste your text into the Source Text box.
  2. Type what to find in the Search String field. By default it is plain text, so symbols such as . * ( are matched literally.
  3. To use a pattern, tick Regular Expression and set flags such as Case insensitive (i) or Multiline (m). The g flag stays on so that every match is replaced.
  4. Type the replacement in the Replace String field. You can use $& for the whole match, $1 or ${1} for groups, and $<name> for named groups.
  5. Check the Search Result Highlight and the Replace Details, which list every match with its line and column. Press Undo on a match to keep the original there, or use Replace All and Undo All.
  6. Copy the replaced text with the copy button.

Frequently asked questions

Can I replace every occurrence at once?
Yes. Every match in the text is replaced in one pass, and the number of replacements is shown next to the result.
Is the search case-sensitive?
Yes, by default. To ignore case, tick Regular Expression and then Case insensitive (i).
Can I skip some matches?
Yes. Each match in the Replace Details has an Undo button that puts the original text back at that spot; press it again to replace it again. Undo All restores every match and Replace All replaces them all again.
Which references can I use in the replacement?
$& inserts the whole match, $1, $2 and so on (or ${1}) insert numbered groups, and $<name> inserts a named group. $` and $' are not supported. A reference to a group that does not exist is left as it is.
Can you give an example with a regular expression?
To turn “Smith, John” into “John Smith”, search for (\w+),\s*(\w+) and replace with $2 $1. To remove spaces at the end of each line, search for [ \t]+$ with Multiline (m) and leave the replacement empty.
Can I insert line breaks?
No. The replacement is a single-line field and is inserted literally, so typing \n does not create a line break. You can still find line breaks with \n in a regular expression and replace them with something else.
Is my document uploaded?
No. Find and replace runs in your browser. The source text, search string and replacement are also kept in the page URL when they are short enough, so reloading keeps your work.
What is it useful for?
Renaming a term throughout a document, cleaning up text pasted from PDFs or spreadsheets, changing date formats with a regular expression, or adjusting a list before pasting it into code.