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
- 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.
- Enter the find text — type the word, phrase, or pattern you want to locate.
- Enter the replacement — type what you want to replace it with. Leave the Replace field empty to simply delete all matches.
- 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.
- Click Replace All — the result appears instantly with a count of how many replacements were made.
Regular Expression Examples
| Find pattern | Replace with | What 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. If you need to measure how different two strings are rather than replacing text, the Levenshtein distance calculator quantifies the similarity between any two strings.