webby.tools

Find and Replace Text

Find and replace words, phrases, or patterns in any block of text. Supports plain text matching and regular expressions. All processing happens in your browser — nothing is sent to a server.

How to Use Find and Replace

  1. Paste your text into the Input box — this can be anything: an article, source code, a CSV, a log file, or any block of text.
  2. Enter the find text — type the word, phrase, or pattern you want to locate.
  3. Enter the replacement — type what you want to replace it with. Leave the Replace field empty to simply delete all matches.
  4. Set options — enable Case-insensitive to match regardless of capitalisation; enable Whole Word to avoid replacing text inside longer words; enable Regular Expression for advanced pattern matching.
  5. Click Replace All — the result appears instantly with a count of how many replacements were made.

Regular Expression Examples

Find patternReplace withWhat it does
\s+(single space)Collapse multiple spaces/tabs into one
^\s+(empty)Remove leading whitespace from every line
\s+$(empty)Remove trailing whitespace from every line
^\d+\.\s*(empty)Remove numbered list prefixes (1. 2. 3.)
\b(\w+)\b[$1]Wrap every word in square brackets
https?://\S+(empty)Remove all URLs from text

Frequently Asked Questions

Does this replace all occurrences or just the first?

All occurrences are replaced in a single operation. The match count shows exactly how many replacements were made.

What does "Whole word only" do?

With whole word enabled, searching for "cat" will match the word "cat" but not "category" or "concatenate". It adds word boundary anchors (\b) around your search term automatically.

Can I use capture groups in regex replacements?

Yes. Use $1, $2, etc. in the Replace field to reference capture groups. For example, find (\w+)\s(\w+) and replace with $2 $1 to swap two words.

Is my text sent to a server?

No. Everything runs in your browser using JavaScript. Your text never leaves your device.

Related Tools

Icons from Creative Fabrica

This website may contain affiliate links. If you click on an affiliate link and make a purchase, we may receive a small commission at no additional cost to you.