- All tools
- Find and replace text
How do I find and replace several things in a text at once?
Paste your text, add one or more find-and-replace rules and press Replace all. Rules run top to bottom, each on the result of the one before, with live match counts and a highlighted preview. Plain text and JavaScript regular expressions are supported, with up to 20 rules.
- Paste your text into the box.
- Fill in one or more rules and check the highlighted matches.
- Press Replace all, then copy or download the result.
Rules
Rules run from top to bottom; each one works on the result of the previous one. In regex mode you can use $1, $<name>, $&, \n and \t in the replacement.
Preview of matches
Matches of all enabled rules in your original text, highlighted.
What this page can do
- Up to 20 find-and-replace rules, applied in order
- Plain text or JavaScript regular expressions
- Match case, whole word, multiline and dot-all options
- Live match count for every rule and in total
- Highlighted preview of the matches
- Undo, copy, download as .txt, or reuse the result as input
When to use this page
- Cleaning an export, a log or a list with several fixes in one go.
- Reformatting dates, names or codes with capture groups such as $1 and $2.
- Trying a regular expression on real text before you run it in a script or an editor.
When to use something else
- You need to change many files at once — use your editor’s search across files, or a command-line tool such as sed.
- You rely on PCRE or POSIX features that JavaScript lacks — test in the tool you will actually run.
- The text is hundreds of megabytes — use a command-line tool instead of a browser tab.
How it compares with other options
Code editors such as VS Code and Notepad++ search and replace across many files, and sed or perl handle very large inputs. This page is for a quick job on text you can paste: several rules in one list, a visible preview and an undo, with nothing to install. Its regular expressions use the JavaScript engine of your browser, so results can differ from grep, sed or PCRE-based tools.
Where your text goes
Nowhere. Everything is computed by your own browser, in a background worker created on the page itself. Nothing you paste is sent to a server, logged or stored — close the tab and it is gone. You can check it yourself: open your browser’s network panel — the page still loads its own code and any ads, but no request carries what you typed.
Questions about this tool
Which regular-expression syntax does this use?
JavaScript’s own (ECMAScript) syntax, with the Unicode flag on. It is close to PCRE but not identical: there are no possessive quantifiers or atomic groups, and lookbehind needs a recent browser. A pattern that works in grep, sed or Notepad++ may need small changes.
What can I write in the replacement?
In plain mode the replacement is inserted literally, except that \n becomes a line break, \t a tab and \\ a backslash. In regex mode you can also use $1 to $99 for groups, $<name> for named groups, $& for the whole match, $` and $' for the text before and after it, and $$ for a dollar sign.
Why did my replacement run on text that an earlier rule changed?
Rules are applied in order, and each rule works on the output of the previous one. This lets you chain steps, but it also means a later rule can match text that an earlier rule inserted. The highlighted preview shows matches against your original input only; the counts next to each rule are the real sequential counts.
What happens with a very large text or a slow pattern?
The replacement runs in a background worker, so the page stays usable and the Stop button works. A badly written regular expression can take extremely long; after 20 seconds the run is cancelled with a message. Texts over about 1 MB show a warning because previews and highlighting get slow.