Skip to content
All tools

Find and Replace Text Online

Paste text, type what to find and what to put instead, and see every match highlighted before you replace. Supports whole-word and case-sensitive search, line breaks, and regular expressions.

How to find and replace text

  1. Paste your text into the big box.
  2. Type what to find and what to replace it with. Matches are counted and highlighted as you type.
  3. Press Replace all. Changed your mind? Undo restores the previous version.
  4. Copy the result.

Handy recipes

To do thisFindReplaceMode
Remove blank lines between paragraphs\n\n\nPlain
Turn a list into one comma-separated line\n, Plain
Collapse repeated spaces {2,} Regex
Strip hashtags but keep the word#(\w+)$1Regex
Swap “First Last” to “Last, First”^(\w+) (\w+)$$2, $1Regex
Delete everything in [brackets]\[[^\]]*\](empty)Regex

About regex mode

Regex mode uses JavaScript regular expressions with the multiline flag on, so ^ and $ match at the start and end of each line. Groups in parentheses are available as $1, $2…, named groups as $<name>, and $& is the whole match. In plain mode every character is literal, including $.

Cleaning up pasted text? The smart quotes converter fixes quotes and dashes, and the invisible character detector finds characters you can’t search for because you can’t see them.

About the find & replace (with regex).

Leave “Use \n and \t” switched on and type \n for a line break or \t for a tab in either box. For example, find \n\n and replace with \n to remove blank lines between paragraphs, or find \n and replace with a comma and space to turn a list into one line.

It only matches the search term when it stands alone, not inside a longer word. Replacing “cat” with whole word on changes “cat” but leaves “category” and “concatenate” alone. It understands letters in any language, not just A–Z.

Switch on Regex to use JavaScript regular expressions. Parentheses capture groups you can reuse in the replacement as $1, $2 and so on, and $& inserts the whole match. Example: find (\w+)@(\w+)\.com and replace with $1 at $2 to rewrite email addresses. Invalid patterns show an error instead of failing silently.

Only your device's memory; nothing is uploaded. The live preview highlights up to the first 2,000 matches to stay responsive, but Replace all changes every match.

Explore the topic cluster

A wider set of tools and guides on this topic.