Find and Replace
Replace every occurrence of a word or pattern in a block of text. Plain search is literal; switch on regular expressions for patterns and capture groups.
Output
🔒 Runs in your browser. Your data is never uploaded.
How to use
- Paste your text.
- Enter what to find and what to replace it with.
- Copy the result; the status line counts the replacements.
Plain mode versus regex mode
In plain mode every character is taken literally, so searching for “a.b” does not match “axb” and a replacement of “$1” is inserted as written. In regex mode the search uses JavaScript regular expression syntax, and the replacement may use $1, $2 for capture groups and \n or \t for a line break or tab.
Frequently asked questions
- How do I replace line breaks?
- Turn on Regular expression and search for \n. Replace with a space to join lines, or search for a comma and replace with \n to split a list onto separate lines.
- What does “Whole words only” do?
- It skips matches that are part of a longer word, so replacing “cat” leaves “concatenate” alone.
- Can I swap the order of two parts?
- Yes, with capture groups. Searching for (\d+)-(\d+) and replacing with $2-$1 turns 12-34 into 34-12.
Related tools
- Regex TesterTest a regular expression against sample text and see every match, its position and capture groups.
- Case ConverterConvert text between UPPER CASE, lower case, Title Case, Sentence case, camelCase, PascalCase, snake_case and kebab-case instantly.
- Remove Duplicate LinesRemove duplicate lines from a list while keeping the original order.
- Text DiffCompare two texts line by line and see what was added and removed.