Find and Replace Text
Search through pasted text and replace every match in one go. Use plain text for simple edits or switch on regular expressions for powerful patterns, with a live count of replacements.
Runs in your browser. Your files are never uploaded.
Loading Find and Replace Text…
How to use Find and Replace Text
- Paste your text into the original text box.
- Enter what to find and what to replace it with.
- Switch on options such as regular expression, match case, whole word or replace all.
- Check the replacement count, then copy the result or use it as the new input for another pass.
Plain search versus regular expressions
A plain search looks for exactly the characters you type. It is the safest choice for everyday edits such as changing a product name or fixing a repeated typo. Regular expressions describe patterns instead of fixed text, which makes it possible to match things like all dates, every number or any word that starts with a capital letter.
Because regular expressions give special meaning to characters like . * + ? ( ) [ ] and \, this tool escapes them automatically in plain mode so that searching for “1.5” really finds “1.5” and not “1x5”.
Useful patterns to try
- \s+ matches any run of whitespace; replace it with one space to normalise spacing.
- \d{4}-\d{2}-\d{2} matches dates written like 2026-10-17.
- ^\s+|\s+$ matches spaces at the start or end of the text.
- (\w+)@(\w+) with $2 swaps the parts either side of an at sign.
- Turn on Whole word to replace “he” without touching “the” or “her”.
Tips and limits
Always check the replacement count before copying. A count of zero usually means a case mismatch, a stray space, or a pattern that is slightly off. If the count is much larger than you expected, add Whole word or tighten the pattern.
Matching is case-insensitive unless Match case is on. With Replace all off, only the first match changes. Extremely complex patterns on very large text can be slow because the browser runs them on your device; split big documents if the page freezes. Nothing is uploaded at any point.
For safety, work on a copy of important text. Replacing is applied to the text in the box, and the original is not saved anywhere, so keep your own backup if you cannot afford a mistake. A good workflow is to run one replacement, check the count and result, press Use result as new input, and then run the next replacement. This step-by-step approach is easier to verify than trying to do everything in one complicated pattern.
Why use this find and replace text tool
- Plain or regex. Search for literal text safely, or use JavaScript regular expressions with capture groups like $1 and $2.
- Match case and whole word. Avoid changing “cat” inside “category” by turning on whole-word matching.
- Replacement counter. See exactly how many replacements were made before you copy anything.
- Clear regex errors. A mistyped pattern shows an explanation instead of breaking the page.
Frequently asked questions
Do I need to know regular expressions?
No. Leave Regular expression off and the tool treats special characters such as dots and brackets as ordinary text. Turn it on only when you need patterns, for example \d+ to match any run of digits.
How do I reuse part of the match in the replacement?
In regex mode, wrap parts of the pattern in parentheses and refer to them with $1, $2 and so on. For example, finding (\w+) (\w+) and replacing with $2 $1 swaps two words. $& inserts the whole match and $$ inserts a dollar sign.
Why does it say my regular expression is invalid?
The pattern has a syntax problem, such as an unclosed bracket or a misplaced quantifier. The message from your browser is shown so you can correct it. Remember that this tool uses JavaScript regex syntax, which differs slightly from other languages.
More free tools
Word Counter
Count words, characters, sentences and paragraphs instantly. Also shows reading time, speaking time and your most-used keywords. Free and private.
Open toolCase Converter
Convert text to uppercase, lowercase, title case, sentence case, camelCase, snake_case, kebab-case and more in one click. Free, runs in your browser.
Open toolLorem Ipsum Generator
Generate lorem ipsum placeholder text by paragraphs, sentences or words. Copy in one click for mockups, designs and templates. Free and instant.
Open tool