Skip to main content

The replacement that goes wrong

The classic disaster: replacing "cat" and getting "conCATenate" and "CommuniCATion". There's no whole-word switch, so either include the spaces around the word in Find, or tick 'Use regex' and wrap the word in \b markers (\bcat\b) so only the whole word matches. Better yet, do the replacement, then search for the original term again to confirm zero matches remain, and skim a few replacements to make sure they're the ones you wanted.

For anything irreversible, copy the original to a safe place first. Find-and-replace across a long document is fast, which is exactly why a wrong replacement spreads fast too. A backup takes three seconds; undoing a bad replace across 200 pages takes much longer.

How to Use Find & Replace

  1. 1Paste your text into the Text box.
  2. 2Type what to find and what to replace it with. Leave 'Replace with' empty to delete every match.
  3. 3Untick 'Case sensitive' to match regardless of capitals ('Color', 'color' and 'COLOR').
  4. 4Tick 'Use regex' for pattern matching, such as all numbers or all email addresses.
  5. 5Tick 'First match only' to change just the first occurrence. The result and the number of replacements update as you type; copy or download it.
  6. 6Doing a careful replacement? Leave 'Case sensitive' ticked (it is by default) when capitals matter; untick it and replacing 'api' also changes 'API' and 'Api'.

Frequently Asked Questions

How do I replace every occurrence of a word?

Type the word in Find and its replacement in 'Replace with'; every occurrence is replaced at once and the tool shows how many there were. In plain mode, the search is for the exact text, including spaces and punctuation, so 'cat' also matches inside 'category'. Use regex with \b for whole words: \bcat\b.

What can I do with regex mode?

Match patterns instead of fixed text, using JavaScript regular expressions. For example, \d+ matches any number and \s+ any run of spaces and line breaks. Capture groups can be reused in the replacement: find (\w+)@(\w+) and replace with $2 at $1.

How do I remove extra spaces or blank lines?

Turn on regex. To collapse double spaces, find ' {2,}' (a space then {2,}) and replace with a single space. To remove blank lines, find \n\s*(?=\n) and leave 'Replace with' empty.

Why is a $ sign in my replacement treated literally?

In plain mode the replacement is used exactly as typed, so '$5' stays '$5'. Only in regex mode do $1, $2 and $& refer to parts of the match.

Is there a size limit?

Plain mode handles large texts quickly. Regex mode accepts up to 500 KB and runs in a separate background thread with a two-second limit, so a pattern that would take forever (catastrophic backtracking) is stopped instead of freezing the page.

Is my text private?

Yes. Searching and replacing happen in your browser, and nothing is uploaded.

What's the difference between this and Ctrl+H in my editor?

Nothing fundamental: it's the same operation. The advantage here is doing it without opening an editor: paste text from anywhere, replace, copy back. Handy for quick fixes in emails, documents, or web forms where there's no find-and-replace built in.

Can I use wildcards or patterns?

Yes. Tick 'Use regex' and the Find box takes a regular expression, with $1, $2 and so on in the replacement for captured groups. To build and debug a tricky pattern first, the Regex Tester highlights each match as you type.

Does it remember what I typed?

Only if you leave "Remember recent inputs" ticked: it keeps the last five things you typed here in this browser, and nothing is sent anywhere. Pick one from the Recent menu to bring it back, or press "Clear recent" to forget them. Unticking the box stops it and wipes the list.

About Find & Replace

Find & Replace changes every occurrence of a word or phrase in a block of text in one go, and tells you how many replacements it made. It's quicker than a word processor for cleaning up exported data, renaming a term throughout a document or fixing a repeated typo.

Plain mode finds exactly what you type, with an option to ignore capitals, and inserts your replacement literally, dollar signs included. Regex mode adds JavaScript regular expressions for pattern-based edits: reformatting dates, stripping HTML tags, collapsing whitespace or rearranging text with capture groups.

Regex runs in a background thread with a time limit, so a runaway pattern can't freeze your browser. Everything stays on your device.

Find-and-replace is the closest thing text editing has to a superpower. One operation, applied to every match in the document, in under a second. Renaming a product across a 50-page document, fixing a misspelled name in a mailing list, swapping date formats: all the same motion.

You May Also Like