Find and Replace
Find & replace with live preview, regex flags (multiline, dotall, unicode), $1 capture groups, replace-first, and \\n / \\t escapes.
About this ToolHow it works, benefits & use casesTap to collapse
Find and Replace goes well past a basic search-and-swap. Enter what to find and what to replace it with, and a live preview highlights every match in the text as you type, with a running match count and a per-line match list. Plain mode supports case-sensitive matching, whole-word matching, replace-first-only, and interpreting \n and \t escapes in the replacement so you can insert real newlines and tabs. Switch on regular-expression mode to use full JavaScript regex with the multiline (^ $), dotall (. matches newline), and unicode flags, plus capture-group replacements like $1 and named groups like $<name>. Invalid patterns are reported inline instead of throwing, so you can fix them as you go. A Swap button exchanges the find and replace fields. The result downloads as a .txt file and the entire setup — text, pattern, replacement, and every option — is captured in a shareable URL. Everything runs in your browser.
How to Use
- 1Type the text to search for in "Find" and the replacement in "Replace with" (use "Swap" to exchange them).
- 2In "Options", toggle case sensitivity, whole word, replace-first-only, and \n / \t escape interpretation.
- 3Enable "Use regular expression" to unlock the multiline, dotall, and unicode flags and capture-group replacements.
- 4Paste your text into the input box, or click "Load example" — matches are highlighted live with a count.
- 5Click "Replace" and copy or download the result, or copy the page URL to share the exact find/replace setup.
Key Benefits
- Live highlighted preview with a running match count and per-line match list
- Plain or full JavaScript regular-expression matching
- Regex flags for multiline (^ $), dotall (.), and unicode
- Capture-group replacements with $1 and named $<name> references
- Whole-word, case-sensitive, and replace-first-only options
- Interpret \n and \t escapes in the replacement (literal mode)
- Invalid regex reported inline; .txt download and a shareable URL
Common Use Cases
- Renaming a token or variable across a pasted block of code
- Using regex capture groups to reformat dates, IDs, or key-value pairs
- Stripping or reformatting lines with multiline and dotall flags
- Replacing only the first occurrence of a term while leaving the rest
- Inserting real tabs or newlines into text via \t and \n escapes
Find & replace
Options
Literal mode only (regex uses $1)
0 characters · live
0 occurrences replaced
Enter text and a search term to see the result.
Was this tool helpful?
Share Your Experience
Help others discover this tool!
Related tools
- Regex TesterTest and debug regular expressions
- MongoDB Query BuilderVisually build MongoDB find queries and aggregation pipelines, then export to the Mongo shell, Node.js driver, Mongoose, or pymongo
- Case ConverterConvert text to camelCase, snake_case, kebab-case, and more
- Whitespace RemoverRemove extra whitespace from text
- Sort LinesSort text lines alphabetically or numerically
- String ReverserReverse any text string
Regex mode uses JavaScript regular expressions and exposes the multiline flag (so ^ and $ match line boundaries), the dotall flag (so . matches newlines), and the unicode flag. Replacements support native capture-group references such as $1 and named groups like $<name>. Case-insensitive matching is controlled by the "Case sensitive" checkbox.
The tool never crashes on a bad pattern. Instead it shows the error message inline and leaves your text untouched until the pattern is valid. This lets you build up a complex expression incrementally and see the moment it starts matching correctly.

