Skip to content
Utilboxes

Find and Replace

Paste your text, type what to find and what to replace it with, and the result updates with a count of the replacements made. Tick match case or whole words only so “cat” leaves “concat” alone, or switch on regular expressions for patterns and $1 groups. Leave the replacement empty to delete matches. Nothing is uploaded.

Runs entirely in your browser

Updated

How to use Find and Replace

  1. 1Paste or load the text.
  2. 2Type the word or phrase to find, and what to replace it with.
  3. 3Tick Match case, Whole words only or Use regular expressions as needed.
  4. 4Check the replacement count, then copy or download the result.

How it works

In plain mode the search text is matched literally — dots, brackets and dollar signs mean themselves — and the replacement is inserted exactly as typed. Every occurrence is replaced in one pass, so replacing “a” with “aa” cannot loop.

Whole words only means the match may not have a letter, digit or underscore directly before or after it, in any alphabet, so “cat” matches in “the cat sat” but not in “concat” or “cats”.

With regular expressions on, the find box takes JavaScript regex syntax and the replacement understands $1, $2 and $<name> for groups and $& for the whole match. ^ and $ match at the start and end of each line unless you untick that option.

Searching runs in a background worker and is stopped after 1.5 seconds, so a regular expression that backtracks badly cannot freeze the page.

Your text is processed by JavaScript running in this page and is never sent over the network. That matters when you are pasting a draft, a client brief, meeting notes or anything else you would rather not hand to a server.

Worked example

Replace “colour” with “color”, whole words only, case-insensitive

  1. Text: Colour charts and watercolour paints
  2. “Colour” matches; “watercolour” does not, because a letter comes before it
  3. Result: color charts and watercolour paints

Result: 1 replacement. With Whole words off, both would change.

Tips and common mistakes

  • Use Whole words only for names and short words so you do not change parts of longer words.
  • Check the replacement count before copying — a count far higher than expected means the search is too broad.
  • In regex mode, escape special characters such as . ? ( with a backslash to match them literally.
  • Keep the original text until you have checked the result.

Frequently asked questions

How do I delete every occurrence of a word?
Type the word in Find and leave Replace with empty. Every match is removed.
Why was my replacement inserted in lower case?
The replacement is inserted exactly as you typed it, whatever the case of the text it replaces. Use Match case and run separate replacements if you need to keep capitals.
How do I replace line breaks?
Turn on regular expressions and find \n, for example replacing \n+ with a space to join lines.
Is there a size limit?
No fixed limit; it is limited only by your browser's memory. Very large texts with complex regular expressions may hit the 1.5-second safety stop.
Can I swap two words?
Not in one step. Replace the first with a temporary marker such as @@1, replace the second with the first, then the marker with the second.
Is my text uploaded?
No. The search and replace run in your browser, inside this page.