Find and Replace Text
Paste your text, enter what to find and what to replace it with, and every match is replaced at once. Turn on match case or whole word to be precise, or switch on regular expressions to rewrite patterns such as dates, names, or repeated markup using capture groups. The tool shows how many replacements were made.
Related Tools
[3 suggestions]Regex Tester
Test regular expressions against a string, highlight matches, and inspect capture groups.
Developer & WebWhitespace Remover
Strip unnecessary spaces, redundant tabs, and excessive blank lines from text.
Case & FormattingRemove Duplicate Lines
Strip repeated lines from any block of text while preserving initial ordering.
Line & ListsAbout the Find and Replace Text
The Find and Replace Text tool replaces every match in your text in one pass. By default the search text is treated literally, so characters such as a period or a dollar sign are matched exactly as typed. Match case makes the search case-sensitive, and Whole word only matches complete words, so searching for "cat" will not change "concat". Switch on Use regular expression to search with JavaScript regular expression syntax. In that mode the replacement can use capture groups, for example searching ([A-Za-z]+), ([A-Za-z]+) and replacing with $2 $1 turns "Smith, John" into "John Smith", and $& inserts the whole match. Anchors such as ^ and $ match at the start and end of each line. Leave the replacement empty to delete every match. If a regular expression is invalid, the tool shows the error instead of changing your text. Very complex patterns on very large text can be slow because they run in your browser tab. Nothing you paste is sent to a server.
Does it replace all matches or only the first one?▾
It replaces every match in the text. The result panel tells you exactly how many replacements were made, or that no matches were found.
How do I use capture groups in the replacement?▾
Turn on Use regular expression, wrap the parts you want to reuse in parentheses in the Find box, and refer to them as $1, $2, and so on in the Replace box. In plain text mode the replacement is always literal, so a dollar sign is inserted as typed.
How do I delete text instead of replacing it?▾
Leave the Replace With box empty. Every match is removed from the text.