Find and Replace

Paste your text, type what to find and what to put instead. The result and the number of replacements update as you type.

How it works

By default both boxes are taken literally. A dot is a dot, brackets are brackets, and "$5" in the replacement is five dollars. Leave "Replace with" empty to delete every match.

Match case makes "Cat" and "cat" different. Whole words only skips matches inside longer words, so replacing "cat" leaves "category" alone. Accented letters count as letters, so "café" is not matched inside "cafés".

Tick Regular expression to use JavaScript patterns. Then ^ and $ mean the start and end of each line, and the replacement can use $1 for the first group, amp; for the whole match and $ for a dollar sign. Every search runs in a background worker with a 2 second limit, so a pattern that would take minutes is stopped instead of freezing the page.

How to use it

  1. 1 Paste your text into the Text box.
  2. 2 Type what to find, and what to replace it with.
  3. 3 Tick Match case, Whole words only or Regular expression if you need them.
  4. 4 Check the count above the result, then copy the result or download it as a .txt file.

Good to know

  • The count is a quick check. If you expected 3 replacements and see 30, the search is matching inside other words: tick Whole words only.
  • To delete blank lines, tick Regular expression, find ^\s*\n and leave the replacement empty.
  • Your original text stays in the top box, so you can try again without pasting it twice.

Browser support

  • Chrome 94 and later
  • Firefox 93 and later
  • Safari 16.4 and later
  • Edge 94 and later

These are the oldest versions with everything the tool uses. They are worked out from the tool itself, so they change when it does.

Version numbers checked on 2026-09-04.

Renaming a product in a long document, without breaking other words

Say your company renamed a product from "Cat" to "Dog", and a 20-page help document mentions it everywhere. A careless replace-all would also change "category" to "dogegory" and "Catalan" to "Dogalan". This tool shows you how many replacements it made, so you can see when a search is catching more than you meant before you copy anything.

Start simple. With the text "Cat cat CAT", finding "cat" and replacing with "dog" gives "dog dog dog" and the count reads "3 matches replaced", because case is ignored by default. Tick Match case and only the middle one changes. Now try the text "cat category bobcat cat." with Whole words only ticked: you get "dog category bobcat dog.", and the two words that only contain "cat" are left alone.

Regular expressions handle jobs that plain text cannot. A list of names written "Lovelace, Ada" on each line can be turned into "Ada Lovelace" with one search. Tick Regular expression, find ^(\w+), (\w+)$ and replace with $2 $1. The ^ and $ anchor the pattern to each line, the two groups capture the surname and the first name, and the replacement writes them back in the other order.

Regular expressions can also go badly wrong. A pattern such as (a+)+$ looks harmless, but on a long line of a letters that ends in something else, the engine tries every way of splitting the run before it gives up, and the number of ways doubles with each letter. In a normal page that would freeze the tab. Here the search runs in a separate worker with a 2 second limit, and the page tells you when it stopped one, along with a warning before you run a pattern of that shape.

There are limits. The tool works on plain text, so pasting from a word processor loses bold, links and other formatting, and the result is plain text too. In regex mode, a dot does not match a line break, and \b only knows the letters A to Z. Very large texts, above 5,000,000 characters, are refused so the result box stays usable. And there is no undo inside the result: keep your original in the top box until you are happy with what you copy.

Frequently asked questions

Why did "$1" not insert the first group?

Groups only work with Regular expression ticked. In plain mode the replacement is taken literally, so "$1" is written as a dollar sign and a 1. That is on purpose, so prices in a plain replacement come out right.

What does the warning about a slow pattern mean?

Patterns with a repeat inside a repeat, such as (a+)+ or (\w*)*, can take exponential time on text that almost matches. The tool warns when it sees that shape. The 2 second limit still protects the page, but rewriting the pattern so each part can match in only one way is the real fix.

Does Whole words only work with accented letters?

In plain mode, yes: letters from any alphabet count as part of a word. In regex mode it uses \b, which in JavaScript knows only the letters A to Z, digits and the underscore, so "é" counts as a boundary there.

Is my text uploaded?

No. The search runs in your browser, in a background worker. Nothing is sent anywhere.

Related tools

Your files are processed on your device and are not uploaded. You can verify this in your browser’s developer tools under the Network tab.