Text Toolkit

Find and Replace

Find and replace text in bulk, with optional case sensitivity and regex support.

Result

 

About this tool

Replacing every instance of a word or pattern across a large block of text by hand is slow and easy to get wrong. This tool replaces every match at once, shows a live count of how many matches were found, and can toggle case sensitivity or switch to a regex pattern when a plain-text match isn't precise enough.

In regex mode, the Find box accepts a full JavaScript regular expression, and the Replace box can refer back to what was matched: $& inserts the entire match, and $1, $2, and so on insert capture groups. That makes it possible to restructure text, not just swap words. For example, finding (\w+), (\w+) and replacing with $2 $1 turns "Smith, Jane" into "Jane Smith" on every line. In plain-text mode, both boxes are treated literally, so a dollar sign in the replacement is inserted exactly as typed.

Common jobs this handles well: renaming a term throughout a document, stripping unwanted characters from pasted data, converting separators (for example, tabs to commas), and normalizing inconsistent formatting like double spaces. The match counter updates as you type, which is a quick way to check that a pattern matches what you expect before you copy the result.

Frequently asked questions

What happens if I don't check "Use regex"?
Your "Find" text is treated as a literal string. Special regex characters like . or ( are automatically escaped so they're matched literally instead of being interpreted as pattern syntax.
What happens if my regex pattern is invalid?
The tool shows the JavaScript RegExp error message and leaves your original text unchanged.
How do I match a line break or tab?
Turn on regex mode and use \n in the Find box to match a line break, or \t to match a tab. For example, finding \t and replacing with a comma turns tab-separated data into comma-separated data. The Replace box is inserted as typed (apart from $ references in regex mode), so \n there adds a literal backslash and n rather than a new line.
Can I undo a replacement?
Your original text in the input box is never modified. The result appears in the output box, so you can adjust the pattern and try again as many times as you like.

Share this tool

🔒 All tools run entirely in your browser. Nothing you type is sent anywhere.