UTILS.
Private by default
⇋

Find and Replace

Find and replace text, with optional regex and case-insensitive matching.

Your files stay on this device

Files are processed in your browser, never uploaded. The site downloads code and assets to run the tools. No accounts or trackers.

Use Download to save this tool as one HTML file for offline use.

Privacy →
output

About this tool

Search and replace text with optional regular expressions, all in your browser.

With regex off, the find text is matched literally, so characters such as . * ( and ? match themselves, and a $ in the replacement is inserted as a plain dollar sign. With regex on, the find field is a JavaScript regular expression and the replacement can use $1, $2 and similar references to captured groups. The case-insensitive option adds the i flag.

If the find field is empty, the output is the input unchanged. In regex mode only the global and case-insensitive flags are used, so ^ and $ match only at the very start and end of the whole text, not at each line.

Frequently asked questions

Can I use regular expressions?
Yes, enable regex to treat the find field as a pattern with capture groups like $1 in the replacement.
What happens with an invalid pattern?
If the regex is invalid, an error message appears and the output keeps the last valid result.
Why did my $ show up literally in the output?
In plain mode the replacement is inserted exactly as typed, including dollar signs. Turn on regex mode if you want $1 style references to captured groups.
Can I replace only the first match?
There is no switch for it: every match is replaced. A pattern starting with ^ only matches at the start of the whole text, which limits a change to that spot.

More tools