Find & Replace

Replace every match of a search term in a block of text, with optional regex.

Last updated

Result will appear here.
Copied

How to find and replace text

  1. Paste your text.
  2. Type what to find and what to replace it with, and choose case-sensitive, whole word or regular expression if needed.
  3. Click Replace All, then Copy result.

About this tool

With "regular expression" off, the find text is matched literally — special characters like . or * have no special meaning. Turn it on to use full JavaScript regex syntax (capture groups, character classes, \d, \s, and so on) in the find field, and reference captured groups in the replacement with $1, $2, etc. "Whole word only" wraps the pattern in word boundaries, so searching for cat won't match inside category.

Nothing you paste here is sent to a server — the entire tool runs as JavaScript in your browser tab.

Questions about find and replace

How do I replace a word without changing longer words that contain it?

Tick Whole word only. Replacing “cat” then leaves “category” alone.

Can I use regular expressions?

Yes. Tick Find is a regular expression to use JavaScript regex, and use $1, $2 and so on in the replacement for captured groups.

How do I replace line breaks?

Turn on regular expressions and find \n. Replace it with a comma and a space to turn a list into one line.

How do I delete a word everywhere?

Leave Replace with empty and click Replace All.

☕ Support toolcrate