Find and Replace Text
Paste text, enter what to find and what to put in its place, and see the result immediately.
INPUT
CHARS: 0WORDS: 0LINES: 0
OUTPUT
CHARS: 0WORDS: 0LINES: 0
How the Find and Replace Text works
Plain mode treats everything you type as literal text, so characters like a dot or a bracket need no escaping. Whole word mode only matches complete words, so replacing cat will not touch category.
In regular expression mode the Find box is a pattern and the replacement can use $1, $2 and so on to refer to captured groups, and $& for the whole match. The status line reports how many replacements happened so that a bad pattern is easy to spot.
Find and Replace Text examples
Global search and replace in paragraphs
Input
Target: Replace foo in 'foo bar foo baz'
Result
'bar bar bar baz'
When it is useful
- •Renaming a variable or label across a pasted block of text.
- •Swapping a term in a long document without opening an editor.
- •Reformatting dates or phone numbers with capture groups.
- •Removing a repeated phrase by replacing it with nothing.
Frequently Asked Questions
How do I replace a line break?
Enable regular expressions and search for \n. Use the replacement box for what should go in its place. To remove line breaks entirely, the Remove Line Breaks tool offers more control.
Why did nothing change?
Check the match case and whole word options. If regular expressions are on, a special character in your text, such as a parenthesis, may have been read as part of the pattern.
Can I use capture groups?
Yes, in regular expression mode. For example, finding (\w+) (\w+) and replacing with $2 $1 swaps each pair of words.
Related tools
- Regex Tester ToolWrite a pattern, paste a test string and see exactly what matches.
- Character RemoverList the characters you want gone, or pick a preset such as digits, vowels or emoji.
- Duplicate Word FinderPaste a draft to see which words you lean on too often and where you typed a word twice in a row.
- Remove UnderscoresTurn user_first_name into User First Name, or strip underscores completely.
- Whitespace RemoverChoose which kinds of whitespace to clean up and see the tidy result.