Find and replace
Replace every occurrence of a string in pasted text, with optional regex.
How it works
Replaces every occurrence of one string with another. Case sensitivity is optional, and so is regular-expression mode for anything more structured than a literal string.
In regex mode, capture groups are available in the replacement as $1, $2 and so on — so a pattern like (\w+), (\w+) with replacement $2 $1 swaps two comma-separated fields on every line. An invalid pattern reports the error rather than silently doing nothing.
The match count is shown, which is the quickest way to confirm a pattern does what you think before you rely on the output.
This tool runs entirely in your browser. Nothing you enter is sent to a server, logged or stored, and the page keeps working with the network disconnected.
Common questions
- Can I use regular expressions?
- Yes. Turn on regex mode and use capture groups in the replacement with $1, $2 and so on.
- How do I replace a literal dollar sign in regex mode?
- Escape it as \$ in the pattern. In the replacement, $$ produces a single literal dollar sign.
Related pages
- Word and character counter Words, characters, sentences, paragraphs and reading time, counted as you type.
- Typing speed test Measure words per minute and accuracy on a one, two or five minute test.
- Remove duplicate lines Strip repeated lines from a list, keeping the first occurrence of each.
- Sort lines alphabetically Sort a list of lines A–Z, Z–A, by length, or numerically.
- JSON formatter and validator Pretty-print, minify and validate JSON, with the exact position of any error.
- Text compare Compare two blocks of text and see which lines were added, removed or changed.
- Regex tester Test a regular expression against sample text, with matches and capture groups shown.
- Case converter Convert text between upper, lower, title, sentence, camel, snake, kebab and other cases.
- Remove empty lines Delete blank lines from a block of text, optionally collapsing runs to one.
- Readability checker Flesch Reading Ease and grade level, with sentence length and passive voice flagged.