Find & Replace

Find and replace across a whole block of text, with optional case sensitivity and full regular-expression matching, and a count of how many replacements were made. It is the tool for the edit that is too big for a text box and too small to justify opening an editor.

Live demo · real result from this tool
Leave empty to delete matches. In regex mode $1, $2 … insert groups and $& the whole match.
Replacements2

Result

Contact Jane Doe at john@example.com. Jane Doe will reply within 2 days.

Processed on your device — nothing is uploaded.

How to use Find & Replace

  1. Paste your text into the input panel.
  2. Type what to find and what to replace it with — leave the replacement empty to delete matches.
  3. Tick regex or case sensitive if you need them, then press Find & Replace.
  4. Check the replacement count, then copy the result.
  5. Leaving the replacement field empty deletes every match — a quick way to strip unwanted characters.
  6. Regex syntax is JavaScript’s, so lookbehind, named groups and Unicode property escapes are all available in current browsers.
  7. The original text stays in the left panel, so you can adjust the pattern and run it again without re-pasting.

Literal mode is genuinely literal

With the regex box unticked, every character you type in the search field is escaped before matching, so searching for c:\Users\ or a price like $9.99 or an expression like (a+b) finds exactly that text. This is the difference from pasting a search term into a tool that always treats input as a pattern, where a stray dot or bracket silently matches the wrong thing. The replacement is literal too: a $ in the replacement field stays a $.

What regex mode adds

Tick the box and the search field becomes a JavaScript regular expression, so you can match patterns rather than strings: \s+ for runs of whitespace, ^\s+ for leading indentation, \d{4} for a year, (\w+)@(\w+) for the parts of an address. Capture groups work in the replacement field — $1 is the first group, $2 the second, $& the whole match, and $$ a literal dollar sign. Swapping “John Smith” to “Smith, John” is (\w+) (\w+) replaced with $2, $1. An invalid pattern is reported rather than applied.

Replacement counts are the safety net

The badge showing how many replacements were made is the fastest way to catch a mistake. Expecting twelve and seeing four means your pattern is too narrow; expecting twelve and seeing two hundred means it is too broad and is matching inside words. Check the count before you copy the result, particularly with regex — the classic error is replacing a short word like “is” and quietly mangling “this” and “list” as well.

Matching is global by default

Every occurrence is replaced, not just the first. Case sensitivity is off unless you turn it on, so searching for “the” also finds “The” — convenient for cleaning up prose, dangerous when you are editing code or data where case carries meaning. Turn it on for anything machine-readable.

Frequently asked questions

Does it support regex?
Yes — enable regex mode for powerful pattern matching and replacements.
Can I do global replace?
Yes — all occurrences are replaced by default. You can limit to first N occurrences.
Is it case-sensitive?
Toggle case sensitivity. By default it's case-insensitive.
Can I use capture groups like $1 in the replacement?
Yes, in regex mode. $1 to $99 insert capture groups, $& inserts the whole match and $$ inserts a literal dollar. In literal mode the replacement is inserted exactly as typed, so a $1 stays a $1.
How do I delete every blank line?
Turn on regex and search for ^\s*$\n with an empty replacement. To collapse runs of several blank lines into one instead, search for \n{3,} and replace with two newlines.
Is my text sent to a server?
No. The replacement runs in your browser, which is why this is a reasonable place to clean up a log file, an export or a document you would not paste into an online editor.

Written by the ToolsRift team · Last updated

Pages are drafted with AI assistance and checked by automated tests. How we write and check pages.

Was this tool useful?

Report a problem

Start typing to search every tool.

↑ ↓ to moveEnter to openEsc to close