Find and Replace Text

Bulk find and replace with regex, highlighting, and live counts

Find and Replace Text

Find and replace text online with live results. Paste your text, set what to find and what to replace it with, and choose case-sensitive, whole-word, or regular-expression matching. Matches are highlighted before you replace, and the replacement count updates as you type.

Regex flags

Matches found

0

Replacements made

0

Preview (matches highlighted)

Result

How Find and Replace Works

This is a client-side find and replace text tool: it searches the text you paste for a word, phrase, or pattern and substitutes it with new text. It is built for both quick edits and bulk find replace jobs across large blocks of content, code, CSV rows, or log files. Every match is found and counted as you type, so you see exactly how many times your term appears and how many replacements were made.

There are three matching styles. Plain text (the default) treats your Find term literally, so special characters like a period or asterisk match those exact characters. Whole word wraps your term in word boundaries, replacing it only when it stands alone rather than inside a longer word. Regex interprets the Find field as a JavaScript regular expression, unlocking patterns, anchors, character classes, and capture groups for advanced search-and-replace.

The preview pane highlights matches in your original text before you commit, while the result pane shows the final replaced output. This split view means you can adjust options and confirm you are targeting the right text without ever altering your source. When you are happy, copy the result or feed it back in as new input for a second pass.

Example 1: Fix a misspelled word everywhere

You have a 2,000-word draft that repeatedly writes recieve instead of receive. Paste the draft, set Find to recieve and Replace to receive, leave Replace all on, and every instance is corrected at once. The counter confirms how many were fixed.

Example 2: Reformat with regex capture groups

You have a list of names as Last, First and want First Last. Turn on Use regex, set Find to (\w+),\s*(\w+) and Replace to $2 $1. Each line is rewritten using the captured groups. Keep the g flag on so it applies to every line.

Options Reference

Case-sensitive

Off by default. When on, only exact-case matches are replaced. Apple will not match apple. In regex mode this maps to whether the i flag is set.

Whole word

Matches your term only as a standalone word using word boundaries. Finding art matches art but not part or started. Ignored when regex mode is on so your pattern controls boundaries.

Use regex

Treats the Find field as a regular expression. Reveals the g, i, and m flag toggles. Replacement supports $1 backreferences and $& for the whole match. Invalid patterns show an error instead of crashing.

Replace all vs First only

Replace all substitutes every match. First only replaces just the first one. In both modes the match counter shows the total number of matches found in your text.

Regex flags

g applies the pattern globally, i ignores case, and m makes ^ and $ match at every line. With First only selected, the g flag is automatically dropped so only the first match changes.

Privacy by design

No network calls are made. The Find, Replace, and text fields never leave your device. You can disconnect from the internet and the tool keeps working as long as the page is open.

Frequently Asked Questions

How do I find and replace text online?

Paste your text into the input box, type the word or phrase to find in the Find field, and type its replacement in the Replace field. The result updates instantly with a count of how many matches were replaced. Click Copy Result to copy the new text to your clipboard.

How do I replace all occurrences instead of just the first?

By default the tool replaces every occurrence (Replace all). Switch the toggle to First only to replace just the first match. The match counter still shows the total number of matches found, so you always know how many exist in your text.

What does case-sensitive mean?

When case-sensitive is on, Cat and cat are treated as different words and only exact-case matches are replaced. When it is off, the search ignores letter case, so searching for cat also matches Cat, CAT, and cAt.

What does whole word matching do?

Whole-word matching only replaces the search term when it stands alone as a complete word. Finding cat with whole-word on matches cat but not category or concatenate. It uses word boundaries so partial matches inside longer words are skipped.

Can I use regular expressions (regex) to find and replace?

Yes. Turn on Use regex and your Find field is treated as a JavaScript regular expression. You can toggle the g (global), i (ignore case), and m (multiline) flags. In the Replace field you can reference capture groups with $1, $2, and so on. Invalid patterns show an error message instead of crashing.

How do I use capture groups in the replacement?

With regex enabled, wrap parts of your pattern in parentheses to create capture groups, then reference them in the Replace field with $1, $2, etc. For example, find (\w+)@(\w+) and replace with $2.$1 to swap the two sides of an at-sign. Use $& to insert the entire match.

Does this tool change my original text?

No. Your original input stays untouched in the input box. The replaced version appears separately in the result area, so you can adjust your options and compare before copying. Nothing is overwritten until you choose to use the output.

What happens if I enter an invalid regular expression?

The tool catches the error and shows a clear message describing the problem, such as an unmatched parenthesis. Your text is left unchanged and the tool keeps working, so you can fix the pattern and continue without reloading the page.

Is there a limit on how much text I can process?

There is no fixed character limit. Because everything runs in your browser, very large inputs (hundreds of thousands of characters) combined with complex regex may feel slower on older devices, but typical documents, code files, and lists process instantly.

Does this find and replace tool upload my data?

No. All matching and replacing happens locally in your browser with JavaScript. Your text is never sent to a server, stored, or logged. You can use the tool offline once the page has loaded.

Related Tools

Privacy & Limitations

  • Client-side only. All find and replace operations run in your browser. No text is sent to any server, and nothing is stored, logged, or tracked.
  • Regex engine. Patterns use the browser's native JavaScript regular expression engine. Some advanced syntax from other languages (such as lookbehind on very old browsers) may not be supported everywhere.
  • Large inputs. Extremely large text combined with complex patterns may run slowly on low-powered devices because all processing happens locally.
  • Highlight rendering. The preview safely escapes your text before highlighting, so HTML in your input is shown as plain characters, not rendered.

Related Tools

View all tools

Find and Replace Text FAQ

How do I find and replace text online?

Paste your text into the input box, type the word or phrase to find in the Find field, and type its replacement in the Replace field. The result updates instantly with a count of how many matches were replaced. Click Copy Result to copy the new text.

How do I replace all occurrences instead of just the first?

By default the tool replaces every occurrence (Replace all). Switch the toggle to 'First only' to replace just the first match. The match counter still shows the total number of matches found, so you always know how many exist.

What does case-sensitive mean?

When case-sensitive is on, 'Cat' and 'cat' are treated as different words and only exact-case matches are replaced. When it is off, the search ignores letter case, so searching for 'cat' also matches 'Cat', 'CAT', and 'cAt'.

What does whole word matching do?

Whole-word matching only replaces the search term when it stands alone as a complete word. For example, finding 'cat' with whole-word on will match 'cat' but not 'category' or 'concatenate'. It uses word boundaries so partial matches inside longer words are skipped.

Can I use regular expressions (regex) to find and replace?

Yes. Turn on 'Use regex' and your Find field is treated as a JavaScript regular expression. You can toggle the g (global), i (ignore case), and m (multiline) flags. In the Replace field you can reference capture groups with $1, $2, and so on. Invalid patterns show an error instead of crashing.

How do I use capture groups in the replacement?

With regex enabled, wrap parts of your pattern in parentheses to create capture groups, then reference them in the Replace field with $1, $2, etc. For example, find (\w+)@(\w+) and replace with $2.$1 to swap the two sides of an at-sign. Use $& to insert the entire match.

Does this tool change my original text?

No. Your original input stays untouched in the input box. The replaced version appears separately in the result area, so you can adjust your options and compare before copying. Nothing is overwritten until you choose to use the output.

How does match highlighting work?

Before replacing, the preview pane highlights every spot in your text that matches the current Find term using your active options. This lets you confirm you are targeting the right text. The highlight count and the replacement count are shown above the result.

What happens if I enter an invalid regular expression?

The tool catches the error and shows a clear message describing the problem, such as an unmatched parenthesis. Your text is left unchanged and the tool keeps working, so you can fix the pattern and continue without reloading the page.

Is there a limit on how much text I can process?

There is no fixed character limit. Because everything runs in your browser, very large inputs (hundreds of thousands of characters) combined with complex regex may feel slower on older devices, but typical documents, code files, and lists process instantly.

Does this find and replace tool upload my data?

No. All matching and replacing happens locally in your browser with JavaScript. Your text is never sent to a server, stored, or logged. You can even use the tool offline once the page has loaded.

Request a New Tool
Improve This Tool