Find and Replace
Find and replace text with regular expressions, capture groups, case-sensitive matching, and a live match count.
Find and Replace tool
Example
Input: Text: The cat sat on the cat mat. Find: cat, Replace with: dog
Result: The dog sat on the dog mat (2 matches found)
Every occurrence of the search text is replaced. Turn on Use Regex to search with a regular expression pattern instead.
Handy Regex Replacements
| Find | Replace with | Before | After |
|---|---|---|---|
| \s+ | (one space) | too many spaces | too many spaces |
| (\d{4})-(\d{2})-(\d{2}) | $3/$2/$1 | 2026-09-25 | 25/09/2026 |
| \bcat\b | dog | cat, category, cat. | dog, category, dog. |
| ^ | - (dash, space) | milk / eggs (two lines) | - milk / - eggs |
| (\w+)@(\w+) | $2-$1 | user@example | example-user |
| [aeiou] | (empty) | banana split | bnn splt |
| \d+ | # | Order 66 of 1138 | Order # of # |
All with Use Regex turned on and Case Sensitive off.
- Paste or type the text you want to search through into the Input Text area.
- Enter the search term or regular expression pattern in the Search field.
- Enter the replacement text in the Replace With field.
- Toggle Use Regex or Case Sensitive to refine your search.
- Check the match count and review the Result panel, where every match is already replaced.
- Click the Copy button to copy the result.
Find and Replace With Plain Text or Regex
Find and Replace swaps every match of a word or pattern in your text for something else. Type what to find and what to put in its place. The Result panel shows the new text, with a live count of matches, and your original text is never changed.
By default the search is plain text and ignores case, so "cat" also finds "Cat" and "CAT". Turn on Case Sensitive for exact matches. A plain search finds text anywhere, even inside longer words, so "cat" also matches the start of "category".
Turn on Use Regex to search with a regular expression, which is a short pattern that describes text. \d+ matches any number, \s+ matches a run of spaces, and \b marks the edge of a word, so \bcat\b finds only the word cat. Put part of a pattern in parentheses to capture it, then reuse it in the replacement as $1, $2 and so on. That is how you turn 2026-09-25 into 25/09/2026 in one step. The ^ and $ signs match the start and end of each line. The tool uses JavaScript regex rules, and a broken pattern shows an error instead of a result.
New to regex? The Regex Cheatsheet lists the common symbols with examples. The Regex Tester highlights each match, so you can check a pattern before you replace anything.
Frequently Asked Questions
Related Tools
Text Diff and Compare Tool
Compare two blocks of text side by side and highlight the differences. Find additions, deletions, and changes instantly.
Text and WritingWord Counter and Character Counter
Count words, characters, sentences, and paragraphs in your text. Includes reading time and speaking time estimates.
Text and WritingRemove Duplicate Lines
Remove duplicate lines from text while keeping the original order. Supports case-sensitive and case-insensitive modes.
Text and WritingCase Converter
Convert text between UPPER, lower, Title, Sentence, camelCase, snake_case, kebab-case, CONSTANT_CASE, and PascalCase.
Text and Writing