imissfiles56 tools
  1. Home
  2. Text tools
  3. Find and Replace

Find and Replace

Replace across a whole document at once, with optional regular expressions.

Find and replace text

Never uploaded

Your file is processed in this tab and never sent anywhere.

The ads come from Google. Your files stay on your device.

How to find and replace text

  1. Paste your text. Or drop a text file onto the box.
  2. Enter what to find and replace. Turn on regex for patterns rather than literal text.
  3. Copy the result. With a count of how many replacements were made.

About Find and Replace

Find and replace exists in most editors, so the reason to use a separate tool is usually that you are between applications: text copied out of an email, a PDF, or a spreadsheet that needs cleaning before it goes somewhere else. Doing it in a browser tab avoids opening a word processor to make one substitution across four hundred lines.

The options do most of the real work. Case sensitivity matters when replacing an identifier that also appears as an ordinary word. Whole word matching prevents the classic disaster where replacing "cat" turns "category" into "egory": it requires a word boundary on both sides of the match. Both are off by default, which is the more forgiving behaviour, so turn them on deliberately when the replacement is precise.

Regular expressions turn this from a substitution tool into a pattern tool. With regex on, you can match anything with a shape rather than a fixed value: phone numbers, dates, email addresses, repeated whitespace, anything between two markers. Capture groups can be referenced in the replacement as $1, $2, and so on, which lets you reorder or restructure matches rather than just swapping them: turning dates from DD/MM/YYYY into YYYY-MM-DD, for instance.

The count of replacements is worth reading before you copy the result. It is the fastest way to catch a mistake: if you expected twelve replacements and it reports four hundred, your pattern is matching more than you intended, and the number tells you that before you paste the damage somewhere. Everything runs in this browser tab, so text you would rather not hand to a website stays on your device.

Useful regex patterns

PatternMatchesCommon use
\s+Any run of whitespaceCollapse multiple spaces into one
^\s+|\s+$Leading or trailing whitespaceTrim every line
\d{4}-\d{2}-\d{2}An ISO dateFind or reformat dates
[\w.]+@[\w.]+An email addressRedact or extract addresses
\n{3,}Three or more line breaksCollapse excessive blank lines
(\d+)/(\d+)Two numbers with a slashReorder using $2/$1

Find and Replace FAQ

How do I replace whole words only?

Turn on whole word matching. Without it, replacing "cat" will also change the "cat" inside "category".

Can I use regular expressions?

Yes. Turn on regex mode and the find field is treated as a pattern. Capture groups can be referenced in the replacement as $1, $2, and so on.

How do I remove text rather than replace it?

Leave the replace field empty. Every match is deleted.

How do I know the replacement worked correctly?

The tool reports how many replacements were made. If that number is far from what you expected, your pattern is matching more or less than you intended.

Can I replace line breaks?

Yes, with regex mode on. Use \n for a line break, or \n{2,} for two or more.

Is my text uploaded?

No. The replacement runs in this browser tab.

Related tools