Find and replace text without opening an editor
Paste your text, type what to find and what to put instead, and see the result at once together with the number of replacements. Use it for names, dates, product codes, line breaks and anything else that needs changing in many places. It is quicker than opening a big editor for a small job, and it works the same on a phone as on a computer.
Whole words, regex and many rules at once
Match case or ignore it, match whole words only, or switch on regular expressions with groups like $1 for more advanced work. The Preserve case option keeps Hello, hello and HELLO in the same style after the change, which is a small detail that saves a lot of tidying.
How to use Find and Replace Text
- Paste your text into the box.
- Type the text to find and the text to replace it with. Leave the replacement empty to delete matches.
- Choose the options you need: match case, whole word, regular expression, replace only the first match.
- Solve the security check and press Replace. Press Count matches to see how many there are without changing the text.
- Check the preview table and the result, then copy it or download it as a text file.
About Find and Replace Text
By default the text you type is searched literally, so special characters such as . or ( have no special meaning. Whole word matching uses Unicode letters and numbers, so it works for accented words too. With regular expressions on, the pattern is a JavaScript regular expression, and the replacement can use $1 and $2 for groups, $& for the whole match and $<name> for named groups. In literal mode a dollar sign in the replacement is just a dollar sign. The line break and tab option turns \n and \t in the replacement into real line breaks and tabs. Preserve case copies the style of each match onto the replacement: all capitals stay capitals, all lowercase stays lowercase, and a capital first letter stays a capital first letter. Rules mode runs the rules from top to bottom, each one on the result of the one before.
Purpose of Find and Replace Text Tool
Use it to rename a product or person across a long text, to fix a repeated typo, to change a date format or a separator, to swap line breaks for commas, to clean a list before an import, or to try a regular expression on real text before using it in code.
Limitations of Find and Replace Text
- A badly written regular expression can make the browser slow or freeze on long text. If the page stops responding, close it and simplify the pattern.
- Preserve case only handles all capitals, all lowercase and a capital first letter. Mixed styles such as iPhone are not changed.
- In rules mode spaces next to the arrow are ignored, so a rule cannot start or end with a space. Use a regular expression such as a space in a character class for that.
- Regular expressions follow JavaScript rules, which differ in small ways from PHP, Python and editors such as Notepad++.
- Text over 2 million characters, or more than 100000 matches in one rule, is refused to keep the page fast.
Privacy and data
Find and Replace Text runs entirely in your browser. What you type or select is processed on your own device and is never sent to or stored on our server. See our Privacy Policy for details.
Frequently asked questions
How do I find and replace multiple words at once?
Add one rule for each pair of words. All the rules run together on your text, and a preview shows every change before you copy the result.
How do I replace only whole words?
Tick the whole word option. Then cat matches the word cat but not category or concatenate.
How do I use a part of the match in the replacement?
Turn on regular expressions, put the part in brackets, and write $1 in the replacement. For example, find (\w+) (\w+) and replace with $2 $1 swaps two words.
How do I use regex in find and replace?
Turn on regular expressions, type a pattern as the find text and run. Use brackets to capture parts of a match and $1, $2 in the replacement. The preview shows every change before you copy.
Can I replace text but keep the capital letters?
Yes. Turn on the option that preserves letter case, so replacing cat with dog also turns Cat into Dog and CAT into DOG.
Rate Find and Replace Text
No ratings yet. Be the first to rate this tool.
Report a bug or give feedback
Popular tools
Morse Code to Text
Decode Morse code made of dots and dashes into readable text, with flexible separators and error marking.
Text ToolsWebpage URL to Text
Turn a web page address, pasted page source or an HTML file into clean readable text without ads and menus.
Text ToolsASCII to Text Converter
Decode decimal, hex or octal ASCII codes into text, with auto-detection, a code table, control-character names and clear errors for bad codes.
Text ToolsBinary to Text Converter
Decode binary into text as UTF-8, 7-bit ASCII or 16-bit UTF-16, with or without spaces, and find exactly what is wrong when it will not decode.
Text ToolsBMI Calculator
Work out your BMI, category and healthy weight range in metric or imperial units.
Health ToolsBullet List Generator
Turn lines, commas or sentences into a bullet, numbered or checklist, with nested levels, as text, Markdown or HTML.
Text Tools