Skip to content

Text Tools

Find and Replace

Paste your text, set what to find and what to replace it with, and see the result and match count instantly.

  • Free
  • No sign-up
  • Runs in your browser

Guide

How find and replace works

Find and replace searches a block of text for a piece you specify and swaps every match for new text. In plain mode the tool treats what you type as ordinary text, so characters like dots, brackets, and dollar signs are searched for literally. Every match in the text is replaced, not only the first.

Regular expression mode treats the search field as a pattern instead. A pattern can describe a class of text, such as "any run of digits" or "a word followed by a comma", rather than one fixed string. This is powerful for cleanup work, but it also means special characters like a dot, a star, or a bracket have a meaning of their own and must be escaped with a backslash to match literally.

Everyday uses

Typical jobs include correcting a name used throughout a draft, updating a product name or date in a template, swapping a delimiter in a list (for example commas for semicolons), removing unwanted characters by replacing them with nothing, and cleaning pasted text that has repeated spaces or stray symbols.

With regular expressions you can go further: reformat dates, strip tags or numbering from the start of lines, or collapse several blank lines into one. Developers use it for quick refactors of names or paths in snippets. If you are comparing two versions of a text after a change, the Text Diff Checker shows what changed, which is a good double check after a large replacement.

How to find and replace with this tool

  1. Paste your text into the Text box. It begins with a sample sentence about a fox.
  2. Type what to look for in Find and the new text in Replace with.
  3. Tick Use regex if your search is a pattern. Tick Case sensitive if capitalization must match exactly. By default, case is ignored and regex is off.
  4. Read the count under the fields, which shows how many replacements were made, and check the Result box.
  5. Click Copy to copy the result.

The result updates live as you type. The original text in the input box is never changed, so you can adjust your search and see a new result each time. If the Find field is empty, no replacement happens.

Cautions and limits

Every match is replaced, and there is no step-by-step confirmation, so check the count before copying. A short search such as "he" will also match inside "the" and "other". The tool has no whole-word option, but in regex mode you can wrap a word in \b markers, for example \bcat\b, to match only the full word.

In regex mode, an invalid pattern shows a red error message and leaves the text unchanged. In the replacement field, the usual JavaScript replacement codes apply: $& inserts the matched text, and $1, $2 insert captured groups when your pattern has them. In plain mode, those same codes in the Replace field are still interpreted, so a literal dollar sign followed by a digit or ampersand may not come out as typed.

Everything runs in your browser and nothing is uploaded. For removing repeated lines specifically, Remove Duplicate Lines is simpler.

Frequently asked questions

Does it replace all matches or only the first?

All matches. The search always runs across the whole text, and the line under the fields tells you how many replacements were made.

How do I replace only whole words?

Tick Use regex and wrap the word in word boundary markers, for example \bcat\b. Without regex mode, the search also matches inside longer words.

What happens if my regex is invalid?

A red error message appears and the result stays the same as the input. Fix the pattern, for example by escaping special characters with a backslash.

Is my text sent anywhere?

No. The search and replacement run in your browser as you type, and the tool does not upload your text.