Find and Replace Text
Find a word, a phrase or a character in your text and replace every match in one step. Match case, match whole words only, or use regular expressions, then click any highlighted change to keep the original there. Leave the replacement empty to delete the matches.
- Whole words
- Regular expressions
- Stays on your device
Every match is replaced. Click a highlighted change to keep the original there.
- Matches
- 0
- Replaced
- 0
- Kept as they were
- 0
- Characters after
- 0
How to find and replace text online
Replace words in text, documents or lists in three steps.
-
Paste your text
A document, an email, code or a list. You can also open a .txt, .csv or .md file.
-
Type what to find and what to replace it with
Every match is replaced straight away and highlighted in the result. Tick Match case, Whole words only or Regular expression to narrow the search.
-
Check and copy
Click a highlighted change to keep the original there, or use Previous and Next to step through them. Then copy or download the result.
Replacing cat with dog in The cat sat on the mat. The category of cats: cat, Cat, CAT. finds 6 matches, including the “cat” in category and cats. Tick Whole words only and it finds 4.
Find and replace features
A full find and replace, with a preview of every change.
-
Aa
Match case
Replace only matches with the same capitals, or every match whatever its case.
-
\b
Whole words only
Replace cat without touching category or cats.
-
.*
Regular expressions
Patterns like \d+ and (\w+) with $1 and $2 in the replacement.
-
✓
Undo one change
Click any highlighted change to keep the original there, or keep all and replace them again.
Match case and whole words
Finding *cat* and replacing it with *dog* in *The cat sat on the mat. The category of cats: cat, Cat, CAT.*:
| Options | Matches | Result |
|---|---|---|
| None | 6 | The dog sat on the mat. The dogegory of dogs: dog, dog, dog. |
| Match case | 4 | The dog sat on the mat. The dogegory of dogs: dog, Cat, CAT. |
| Whole words only | 4 | The dog sat on the mat. The category of cats: dog, dog, dog. |
| Match case and whole words only | 2 | The dog sat on the mat. The category of cats: dog, Cat, CAT. |
Whole words only stops a match inside a longer word: “cat” in “category” and “cats” is left alone.
Regular expressions for find and replace
Tick **Regular expression** to do a regex replace online with a pattern. Some patterns that are useful in everyday text:
| Find | Replace with | Before | After |
|---|---|---|---|
\d+ | # | Order 66 shipped on 12 May, 3 boxes. | Order # shipped on # May, # boxes. |
\s+ | (one space) | too many spaces | too many spaces |
(\w+), (\w+) | $2 $1 | Smith, John | John Smith |
(\d{4})-(\d{2})-(\d{2}) | $3/$2/$1 | 2026-11-21 | 21/11/2026 |
^ | - | apple⏎banana | - apple⏎- banana |
[\w.+-]+@[\w-]+\.[\w.]+ | [email] | Write to anna@example.com | Write to [email] |
$1 and $2 put back what the first and second brackets matched, and $& the whole match. ^ and $ mean the start and end of each line. ⏎ marks a line break.
Delete words, line breaks and special characters
- Delete words: leave Replace with empty. Every match is removed; deleted matches show crossed out in the result.
- Line breaks and tabs: type \n for a line break and \t for a tab, in either box. Find , * and replace it with \n to turn *red, green, blue into a list of one color per line, or the other way round.
- Punctuation and symbols: plain searches find characters like ?, ( or $ as they are. In a regular expression, put a backslash before them: \?, \( or \$.
To remove every line break or every extra space at once, the Remove Line Breaks and Remove Extra Spaces tools have more options.
Find and replace shortcuts in other apps
The same job in the apps you already use:
| App | Shortcut | Line breaks and special characters |
|---|---|---|
| Microsoft Word | Ctrl+H | ^p for a paragraph mark, ^l for a line break, ^t for a tab |
| Google Docs | Ctrl+H (Cmd+Shift+H on a Mac) | Paste the text here to replace line breaks |
| Microsoft Excel | Ctrl+H | Ctrl+J in Find what for a line break inside a cell |
This tool works the same on any device, including phones, where most apps have no shortcut.
Check every replacement before you copy
A bulk replace text tool is quick, but a replace-all can change words you didn’t mean to change, like cat inside category. Every replacement here is highlighted in the result. Click one to keep the original word there; click it again to replace it after all. Previous and Next step through the matches, and Keep all originals or Replace all reset them in one go.
The counts under the tool show how many matches were found, how many were replaced and how many you kept, so you know the result before you paste it anywhere. To count how often a word appears without changing anything, use the Specific Word Counter.
Find and replace FAQ
How do I find and replace text online?
Paste your text, type the word to find and its replacement. Every match is replaced at once; copy the result.
Can I replace only one occurrence?
Yes. Every match is replaced first; click the highlighted changes you want to undo, or press Keep all originals and click the ones you want replaced.
Is find and replace case-sensitive?
No, not by default: cat finds cat, Cat and CAT. Tick Match case to find only the exact capitals.
How do I find and replace a whole word without changing other words?
Tick Whole words only. cat then matches the word cat but not category or cats.
Can I delete words with find and replace?
Yes. Leave Replace with empty and every match is deleted.
Can I replace line breaks?
Yes. Type \n for a line break and \t for a tab in either box.
Does it support regular expressions?
Yes. Tick Regular expression to use patterns like \d+ or ^, and $1, $2 and $& in the replacement.
Does it keep my line breaks and formatting?
Line breaks and spaces are kept exactly. The tool works on plain text, so bold, links and other formatting from a document are not kept.
Is my text uploaded?
No. Everything runs in your browser and nothing is sent or stored.
Sources and references
- Keyboard shortcuts for Google Docs, Google Docs Editors Help
- Helpful search strings for finding special characters in Word, Microsoft TechNet
- Regular expressions, MDN Web Docs
More text editing tools
- Aa Case Converter Convert text to uppercase, lowercase, sentence case, title case and more. Open tool
- ¶ Remove Line Breaks Remove line breaks from PDF or email text, and keep paragraphs if you like. Open tool
- Find Specific Word Counter Count how many times a word or phrase appears, with every match highlighted. Open tool
- ± Text Compare Compare two texts and highlight what was added and removed. Open tool