Find and Replace Tool

Replace every occurrence of a word, phrase or pattern in a block of text at once. Choose whether to match case or whole words only, or switch on regular expressions for advanced patterns with capture groups. A live count shows how many matches will change.

Leave empty to delete matches. Use \n for a line break.

Step-by-step guide: How to Find and Replace Text Online (Including Regex)

How to use the Find and Replace Tool

  1. Paste the text you want to edit.
  2. Type what to find and what to replace it with. Leave Replace with empty to delete every match.
  3. Tick Match case or Whole words only if needed. The live count under the options shows how many matches there are before you replace anything.
  4. For patterns, tick Regular expression. You can then use groups in the pattern and $1, $2 in the replacement.
  5. Select Replace all, check the result and copy it. To make another change, select Use result as text and replace again.

Example: reformatting dates with a regular expression

A list uses American-style dates such as 12/31/2026 and you need ISO dates such as 2026-12-31. With Regular expression ticked:

  • Find: (\d{2})/(\d{2})/(\d{4})
  • Replace with: $3-$1-$2

Each date is matched as three groups — month, day and year — and rewritten in the new order. Without regular expressions, a plain search for “colour” with Whole words only ticked would change “colour” but leave “colourful” and “watercolour” alone.

Bulk editing without a word processor

Find and replace is one of the most useful editing operations, but it is not always available where you are working — in a web form, a CMS field, a configuration file or a chat message. Pasting the text here, making every change at once and copying it back is faster and more reliable than editing occurrences by hand, especially when there are dozens of them.

What each option does

  • Match case treats “Apple” and “apple” as different. Without it, all capitalisations match.
  • Whole words only matches the search only when it is not part of a longer word. It works with letters from any alphabet, not just English.
  • Regular expression interprets the search as a JavaScript regular expression. In the replacement, $& inserts the whole match, $1–$9 insert numbered groups and $<name> inserts named groups. Write $$ for a literal dollar sign.

When regular expressions are off, special characters such as ., * and $ are treated literally, so you can safely search for prices or file names.

Protection against runaway patterns

Some regular expressions can take an extremely long time on certain text — a problem known as catastrophic backtracking. To keep your browser responsive, regular-expression replacements run in a separate background worker that is stopped automatically if it takes longer than a few seconds, and the tool tells you to simplify the pattern. Your text is unaffected.

Limitations to keep in mind

  • Formatting such as bold, links or fonts is not preserved; the tool works on plain text.
  • Only one find-and-replace rule is applied at a time. Use “Use result as text and replace again” to chain several changes.
  • Regular expressions follow JavaScript syntax, which differs slightly from other flavours such as PCRE or Python. Test complex patterns with the Regex Tester first.

How your data is handled

All searching and replacing happens in your browser, including in the background worker used for regular expressions. Your text is never sent to a server.

Frequently asked questions

Can I undo a replacement?

Your original text stays in the first box and the result appears separately, so nothing is lost. Only when you choose “Use result as text” is the original replaced — copy it first if you might need it.

How do I replace line breaks?

Tick Regular expression and search for \n. In the replacement, \n inserts a line break and \t inserts a tab, with or without regular expressions.

Why does whole-word matching not find my phrase?

Whole-word matching requires the search to start and end at a word boundary. If your search itself begins or ends with punctuation or a space, the boundary check may fail; remove the surrounding spaces from the search.

Is there a limit on text size?

There is no fixed limit, but replacements in very large texts (tens of megabytes) take longer and use more memory.