Find and replace text

Replace words, phrases or patterns in any text with as many rules as you need, applied one after another. Paste text or open files, see every change highlighted with a count per rule, then copy the result or download the files.

Free and private. Everything runs in your browser, nothing is uploaded.

How it works

  1. Add your textPaste text, type it or open a file.
  2. Write the rulesEnter what to find and what to put in its place. Add more rules if you need them and choose match case, whole word or regex.
  3. Check and saveEvery change is highlighted. Copy the result, download it, or apply the same rules to several files.

Several replacements in one go

Cleaning up text often takes more than one replacement: fix a spelling, change a date format, remove double spaces, rename a product. Here each rule is one line, and the rules run from top to bottom. The second rule works on the text the first rule produced, so you can build small cleanup recipes and change their order with the arrows.

Each rule shows how many times it matched, and the result highlights every changed spot in the color of its rule. A place where text was only removed is marked with a thin red line, so deletions do not go unnoticed.

Match case, whole word and regex

By default a search ignores upper and lower case, so cat also finds Cat and CAT. Turn on Match case to find only the exact spelling. Whole word skips matches inside longer words, so cat no longer changes catalog or bobcat. Both options understand accented letters and other alphabets, and when case is ignored the Turkish dotted and dotless i are matched correctly.

With Regex you can use regular expressions: \d+ for numbers, \s{2,} for runs of spaces, groups such as (\d{2})/(\d{2})/(\d{4}) and $3-$2-$1 in the replacement to reorder them, or named groups with $<name>. Write \n for a line break and \t for a tab in the replacement. If a pattern takes too long, for example because it backtracks endlessly, the tool stops it after two seconds and tells you which rule caused it.

One file or many

Open a text file such as TXT, CSV, Markdown, HTML, JSON, XML, SQL or subtitles to load it into the editor. The download keeps the file name and extension. To change many files at once, use Apply to files: every file goes through the same rules, you see the number of changes per file, and you download them together as a ZIP. Files are read as UTF-8 and never leave your device.

Frequently asked questions

Are my text and files uploaded?

No. Everything runs in your browser. Your rules are remembered only in this browser so they are ready next time.

In which order are the rules applied?

From top to bottom. Each rule works on the result of the rules above it. Use the arrows to change the order.

How do I insert a line break?

Turn on Regex for that rule and write \n in the replacement. For example, find a comma and replace it with \n to put each item on its own line.

Can I use parts of the match in the replacement?

Yes, in regex mode. $& is the whole match, $1, $2 are the groups in parentheses, and $<name> is a named group. Write $$ for a dollar sign.

Which files can I open?

Plain text files such as TXT, CSV, MD, HTML, XML, JSON, CSS, JS, SQL, SRT and LOG. Word, Excel and PDF files are not plain text; convert them first with the matching tool on this site.

What happens with a very slow pattern?

The work runs in the background and is stopped after two seconds, or fifteen seconds per file when you apply rules to files. The page never freezes, and the message names the rule to fix.