Find and Replace Text

Replace literal words or phrases with a live preview. Choose whole-word boundaries and whether to change every match or only the first.

Letters, numbers, combining marks and underscores cannot touch either end of the match.

Text is processed locally in your browser and is not uploaded.

Replacements
2
Matches found
2
Page guide

How to use this tool

  1. Paste the source text, enter a nonempty Find phrase, and set the replacement. An empty replacement removes matches.
  2. Choose case matching, whole-word boundaries and first-match-only replacement; inspect the live preview and counts.
  3. Copy or download the output. Use output as input applies another pass; Undo last replacement restores the text before that replacement or Clear text.

Understanding the output

Find and Replace with are literal text: regex punctuation and dollar-sign sequences do not become instructions. Matches do not overlap. Matches found counts all eligible occurrences; Replacements counts all of them or only the first, depending on the option. Whole-word mode requires both ends of the phrase to be separated from letters, numbers, combining marks and underscores.

Replacing a color in a short list

Replacing red with green in red apple, red pear produces green apple, green pear and reports two replacements. An empty replacement would remove both occurrences of red.

Check the scope of a replacement

With whole-word matching off, a literal phrase can match inside a longer word: cat also matches catalog. Enabling whole-word matching excludes that example, but punctuation still acts as a boundary. Review changes in quotations or identifiers where boundary matching may not reflect the intended scope.

Case-insensitive matching is useful when a name appears with inconsistent capitalization, but the replacement uses exactly the spelling you enter. It does not automatically preserve title case at the beginning of a sentence.

Use a reversible editing workflow

Keep the original text until you have checked the result. A broad replacement can alter quotations, identifiers, or examples that were meant to remain unchanged. For a long document, test a representative paragraph containing both intended and unintended matches first. This tool handles plain text only; it does not preserve rich-text formatting or edit the contents of an uploaded document file.

Replace one occurrence before a wider pass

Use Replace the first match only when one occurrence needs changing and the later ones should remain. The preview shows the complete source with that edit, while Matches found still reports every eligible occurrence. Reusing the output lets you make another pass; the undo button keeps one replacement of input history rather than saving a full document revision history.

Method and supported input

The literal phrase is escaped before constructing a global Unicode regular expression. Optional boundary checks exclude matches touching Unicode letters, numbers, marks or underscores. Case-insensitive matching uses JavaScript regex behavior.

A replacement callback inserts the replacement literally. First-match mode changes only the first eligible occurrence. Before producing output, the selected replacements are checked against a one-million-character output limit.

  • Matches do not overlap.
  • The whole pasted text is within the intended editing scope.

Limitations

  • The search and replacement are literal text; there is no user-supplied regular-expression mode.
  • Complex linguistic case folding can differ from a language-specific editor.

Common questions

Can I remove a phrase entirely?

Yes. Leave Replace with empty and run the replacement.

Does an asterisk act as a wildcard?

No. Find and replacement fields are literal text, including punctuation and dollar signs.

Can I replace cat without changing catalog?

Yes. Enable Match whole words or phrases only. Letters, numbers, combining marks and underscores at either end prevent that match.

Sources and further reading

Reviewed on