Search and Replace

Find and replace text online: swap every occurrence of a word or phrase at once, see how many were replaced, and copy the result.

Runs in your browser. Files never leave your device.

About the Search and Replace

Find and replace words or phrases across a whole block of text in one go. Type what to find and what to put in its place, paste your text, and every occurrence is swapped at once, with a count of how many changed. A typo you repeated all through a document, a product renamed halfway through a draft or a name that appears all over a list can each be fixed in one pass.

The result updates as you type in any of the three boxes, so you can try a replacement and see its effect before you copy it. Your original text is left alone: the replaced version appears separately, ready to copy.

How find and replace works here

Whatever you type in Find Text is matched character for character and replaced with Replace With, from the start of the text to the end. It's a plain-text search, not a pattern: a full stop means a full stop and a question mark means a question mark, so you don't need to escape anything.

The search is case-sensitive and doesn't look at word boundaries. Finding cat changes cat, but not Cat, and it also changes the cat inside concatenate. Before you copy, glance at the counter in both headings: it shows how many occurrences were found and replaced.

Assumptions and limits

  • Matching is case-sensitive. To change both The and the, run two replacements. For case-insensitive or pattern matching in your own code, the Regex Tester helps you build the pattern.
  • Partial words match too. To replace only the whole word, include the spaces around it, for example ' art ' instead of 'art'.
  • Occurrences don't overlap: finding aa in aaaa replaces two pairs, not three.
  • A few character pairs in Replace With have a special meaning: $& inserts the text that was found, $$ inserts a single $, and $` and $' insert the text before or after the match. Other uses of $, such as $5 or $<name>, are kept as typed.
  • With the Find box empty, nothing is replaced: the result is your text unchanged and the count shows 0.
  • Line breaks can't be typed into the single-line Find box, so this tool replaces text within lines rather than joining or splitting them.

Worked examples

The sample: replace a word everywhere

With fox in Find and cat in Replace, both occurrences change and the headings show 2 occurrences and 2 replaced.

Before: The quick brown fox. The fox jumped.
After:  The quick brown cat. The cat jumped.

Replace text in a product list

A price list for 40 items uses the old brand name Velo 3 in every line. Finding Velo 3 and replacing it with Velo 4 updates all 40 lines at once, and the count of 40 confirms none were missed. Lines that wrote velo 3 in lowercase are left alone and need a second pass.

Wrap every match without retyping it

To put each mention of TODO in square brackets, find TODO and replace it with [$&]. The $& stands for the found text.

Before: TODO check totals. TODO send email.
After:  [TODO] check totals. [TODO] send email.

How to use the Search and Replace

  1. Enter Find Text and Replace With. Matching is exact and case-sensitive; leave Replace empty to delete every match.
  2. Paste your text into Original Text. The occurrence count and the Result box update straight away.
  3. Copy the result. Press Copy above the Result box and paste the changed text wherever you need it.

Frequently asked questions

How do I delete a word from all of my text?

Type the word in Find Text and leave Replace With empty, and every occurrence is removed. To avoid leaving double spaces behind, include one space in the Find box, for example 'very ' rather than 'very'.

Is the find and replace case-sensitive?

Yes. Apple and apple are different here, and only the exact capitalisation you type is replaced. Check the occurrence count: if it's lower than you expected, other copies probably use different capital letters.

Can I replace text with a line break or use regular expressions?

No. Both boxes are single lines and the search is for plain text, so special characters are matched literally. For pattern-based work, build and test your pattern with the Regex Tester first.

Why did a word inside another word get replaced?

Because the tool matches characters, not whole words, so replacing man also changes the man in manager and woman. Add a space before and after the word in both boxes to limit the change to whole words in the middle of sentences.

Does this replace only the first match or all of them?

All of them. Every occurrence from the beginning to the end of the text is replaced in one step. The number in the Result heading (n replaced) tells you exactly how many changes were made.

This tool runs entirely in your browser. What you enter or upload stays on your device and is never sent to our servers.