Home › Text Tools › Find and Replace Text

Find and Replace Text

Paste your text, type what to find and what to replace it with, and see every match highlighted before you replace. Supports whole words, case sensitivity and regular expressions with capture groups.

Type something to find
Match previewmatches are highlighted
Advertisement

How to use the Find and Replace Text

  1. Paste your text into the Your text box.
  2. Type what to find. Matches are highlighted in the preview and counted straight away.
  3. Set the options: case sensitive, whole words only, or regular expression.
  4. Type the replacement (leave it empty to delete the matches) and press Replace all or Replace first.
  5. Undo if needed, then copy the text or download it as a .txt file.

Useful regular expressions for find and replace

TaskFind (regex)Replace withExample result
Swap date format(\d{4})-(\d{2})-(\d{2})$3/$2/$12026-03-14 → 14/03/2026
Collapse repeated spaces {2,}(one space)a␣␣␣b → a b
Remove trailing spaces[ \t]+$(empty)Cleans the end of every line
Join lines with commas\n, apple⏎pear → apple, pear
Swap first and last name^(\w+) (\w+)$$2, $1Ada Lovelace → Lovelace, Ada
Wrap numbers in brackets\d+[$&]Item 42 → Item [42]
Mask email addresses[\w.+-]+@[\w-]+\.[\w.]+[email][email protected] → [email]

Plain text vs. regular expression mode

In normal mode every character you type is matched literally, so a dot is just a dot and $1 in the replacement is inserted as the text “$1”. In regular expression mode the search box uses JavaScript regex syntax: . matches any character, \d a digit, \w a word character, ^ and $ the start and end of each line, and brackets create capture groups you can reuse in the replacement.

The Whole words only option works in both modes and understands letters from any language, so it treats “café” as a single word. Case sensitive controls whether upper and lower case letters must match exactly.

Tips for safe bulk replacing

  • Check the highlighted preview and the match count before you press Replace all.
  • Use Replace first to try a change once, then Undo if it is not what you expected.
  • When replacing short words, tick Whole words only to avoid changing longer words that contain them.
  • Escape special characters such as . * + ? ( ) [ ] with a backslash in regex mode, or simply switch regex off.

Frequently asked questions

How do I replace a word everywhere in my text?

Paste the text, type the word in Find and the new word in Replace with, then press Replace all. Tick Whole words only so that replacing cat does not also change category or concatenate.

What does the Whole words only option do?

It only matches the search text when it is not touching other letters, digits or underscores on either side. Searching for art then matches art and art. but not party or start.

How do I use capture groups in the replacement?

Turn on Regular expression, put brackets around the parts you want to keep, and refer to them as $1, $2 and so on. For example, find (\d{4})-(\d{2})-(\d{2}) and replace with $3/$2/$1 to turn 2026-03-14 into 14/03/2026.

How do I replace line breaks?

Turn on Regular expression and search for \n. In the replacement, type a space or a comma to join the lines, or \n to insert a new line.

Can I undo a replacement?

Yes. Every Replace all or Replace first can be undone with the Undo button, up to 50 steps back.

Is find and replace case sensitive?

Not by default: Dog, dog and DOG all match. Tick Case sensitive to match only the exact capitalization you typed.

Is my text uploaded anywhere?

No. All searching and replacing happens in your browser with JavaScript, so your text never leaves your device.

Related tools