Text Tools

Find and Replace

Search a block of text for a word, phrase or pattern and replace every occurrence at once, with optional case-sensitive and regular-expression matching.

Advertisement space

How Find and Replace Works

The tool builds a global search pattern from your Find text — either matched literally or, if you check the regex option, compiled as a regular expression — and scans the whole text for every match. Each match is swapped for your replacement text, and the number of replacements made is reported. Case-sensitivity is off by default, meaning "Text" and "text" are treated as the same until you turn it on.

How to Use This Tool

  1. Paste the text you want to search into the main box.
  2. Enter the word or phrase to find, and what to replace it with.
  3. Optionally enable case-sensitive matching or regular-expression mode.
  4. Select Replace All to apply the change and see how many replacements were made.

Example

Finding "cat" and replacing with "dog" in "The cat sat near another cat." gives "The dog sat near another dog." — 2 replacements made.

Helpful Tips

  • Leave "Replace with" empty to delete every match instead of substituting new text.
  • Regex mode supports patterns like \d+ to match numbers or \s+ to match whitespace — use it when a plain word search isn't precise enough.
  • If a regex pattern is invalid, the tool tells you instead of breaking, so it's safe to experiment.

Frequently Asked Questions

Is matching case-sensitive by default?
No, by default "Word" and "word" are treated as the same. Check the case-sensitive box if you need an exact-case match.
What happens if my regex pattern is invalid?
The tool catches the error and shows a friendly message telling you the pattern isn't valid, instead of crashing the page.
Can I use capture groups in the replacement?
Yes, in regex mode you can reference capture groups in the replacement text using $1, $2 and so on, following standard JavaScript regex replacement syntax.
Does Replace All replace every match or just the first one?
It replaces every match found in the text, not just the first occurrence.

This tool runs entirely in your browser. Your input is not uploaded to any server.