Find & Replace Text

Find and replace in bulk with regex, case-insensitive and whole-word toggles — supports $1 backreferences and flags unsafe or invalid regex before running it.

Open file takes text files up to 10.0 MB; a bigger one is refused, never cut short. Replace in a large file… takes up to 200.0 MB, runs the rules above over it and downloads the result without showing it here.

Bulk find and replace

Paste or type your text, fill in the Find and Replace with fields, and every match changes at once. A live, non-destructive preview shows the result and a running match count as you type, so your original box stays untouched until you click Replace in the box or Copy. Three toggles refine the search: Regex for pattern matching, Case-insensitive to ignore capitalization, and Whole word to match standalone words only.

With Regex on, the Find field is treated as a JavaScript regular expression and the Replace field supports backreferences like $1 to reuse captured groups; with it off, both fields are matched literally. Whole word wraps your term in word boundaries, so cat matches the word but not category. Replacement is global by default — every occurrence changes in a single pass, unless you ask for the first match only — and an invalid pattern, or one prone to catastrophic backtracking, is flagged instead of run, an invalid one with the browser's own reason beside it. Line endings in the result keeps line breaks as they are or turns them into LF or CRLF in what you copy, download or put back in the box. Untick Wrap long lines to keep each line on one row with a sideways scroll, and tick Number the lines where matches are shown to number the highlighted view line by line, so a match can be named by its line. To remove blank lines, trim each line or collapse runs of spaces, use the whitespace cleaner; to join broken lines into one, use remove line breaks. Open a text file of up to 10 MB into the box, or paste. A file of up to 200 MB can go through Replace in a large file… instead: it is read as UTF-8 a piece at a time, run through the same rules with plain-text finds (Regex is refused there, because a match could run across two pieces), and downloaded under its own name with its line endings left as they are, without being shown here. Everything happens in your browser, so nothing is uploaded.

Frequently asked questions

Can I reuse the matched text in my replacement?

Yes. Turn on Regex, add capture groups to your Find pattern with parentheses, then reference them in the Replace field as $1, $2, and so on. With Regex off, a dollar sign is treated literally.

How do I replace a whole word without touching longer words?

Tick Whole word. It wraps your term in word boundaries, so replacing "cat" changes the standalone word but leaves "category" and "scatter" alone. It combines with Regex and Case-insensitive.

The preview shows my change but the text box didn't update — why?

The preview is non-destructive, so your original text is never altered as you type. To apply the change, click "Replace in the box" to write the result back into the input, or use Copy to grab it.

Can I run several replacements at once, or change only the first match?

Yes. Add as many find-and-replace rules as you need and they run in order, with one total count; a rule that cannot run is named. The matches can also be shown highlighted in the text, and a checkbox replaces only the first match.

Can I change the line endings, or see which line a match is on?

Yes. “Line endings in the result” keeps them as they are, which is the default, or writes LF (Unix, macOS) or CRLF (Windows) into what you copy, download or put back in the box; Copy and Download stay available when only the endings change. “Number the lines where matches are shown” draws the highlighted matches one numbered row per line — a very long text is shown without numbers, and the page says so — and unticking “Wrap long lines” keeps each line on one row with a sideways scroll.

Can it also remove blank lines, extra spaces or line breaks?

A regex rule can, but other tools on this site do it without writing a pattern. The whitespace cleaner removes blank lines, trims each line and collapses runs of spaces, and Remove line breaks joins broken lines into one. Both are linked from this page.

Can it handle a file too big to paste?

Yes, for plain-text finds. “Replace in a large file…” reads the file as UTF-8 a piece at a time, runs every rule over it with your case, whole-word and first-match settings, and downloads the result under the file's own name without showing it in the box; it can be stopped part way. Regex is refused there, because a match could run across two pieces, and so is a file saved in another encoding such as CP949. Line endings are left as they are.