Find & Replace Text

Search and replace words, phrases or patterns across any amount of text. Add several find-and-replace rules at once, match whole words or exact case, or switch on regular expressions with capture groups for powerful edits. Matches are highlighted and counted before you copy the result.

  • 100% free
  • No sign-up
  • Private & local
  • Works on mobile

Replacement rules (applied in order)

Regex presets:
Drop a text or code fileor browse files · or paste below

Highlight matches of the first rule

Private by design: every calculation runs locally in your browser. Nothing you type is sent to a server or stored by us.

What Is a Find and Replace Tool?

A find and replace tool searches text for a word, phrase or pattern and swaps every occurrence for something else. It's a basic feature of word processors and code editors, but an online version is handy when you're working with text from anywhere: fixing a repeated typo in an article, updating a product name across a description, changing British to American spelling, anonymising names and email addresses before sharing a document, reformatting data exported from a spreadsheet, or cleaning up code and configuration files without opening an editor.

This free tool lets you apply several replacement rules in one go, applied in order. You can match exact case or whole words only, so "cat" doesn't change "category". Switch on regular expressions for advanced pattern matching, with capture groups ($1, $2, named groups) in the replacement. Each rule shows how many matches it found, and the first rule's matches are highlighted in the original text.

How to Find and Replace Text

  1. Paste your text into the input box, or drop a file.
  2. Enter what to find and what to replace it with. Leave "Replace with" empty to delete matches.
  3. Add more rules if you need several changes at once.
  4. Choose options: match case, whole words, regex or first match only.
  5. Copy or download the result.

Regular Expression Cheat Sheet

PatternMatchesExample
\dAny digit\d+ matches 2024
\wLetter, digit or underscore\w+ matches words
\sWhitespace (space, tab, newline)\s+ matches runs of spaces
.Any character except newlinea.c matches abc, a-c
^ / $Start / end of a line^# matches lines starting with #
(...)Capture group, reused as $1(\w+) (\w+) → $2 $1 swaps words
a|bEither a or bcolou?r|gr[ae]y
{2,}Two or more of the previous item {2,} matches double spaces

Useful Examples

  • Swap first and last names: find ^(\w+) (\w+)$, replace with $2, $1.
  • Reformat dates: find (\d{4})-(\d{2})-(\d{2}), replace with $3/$2/$1.
  • Remove everything in brackets: find \s*\([^)]*\), replace with nothing.
  • Put each sentence on a new line: find ([.!?]) , replace with $1\n.
  • Wrap lines in quotes for a list: find ^(.+)$, replace with "$1",.

Features

  • Multiple rulesApply a whole series of replacements at once.
  • Case and whole-word matchingPrecise control over what matches.
  • Full regular expressionsJavaScript regex with Unicode, multiline, capture and named groups.
  • Match counts and highlightingSee exactly what will change.
  • Escape sequencesInsert new lines and tabs with \n and \t.
  • PrivateYour text is processed locally and never uploaded.

Tips

  • Order matters: rules run top to bottom, and each works on the result of the previous one.
  • Test on a sample first when using regular expressions on important text, and check the highlight view.
  • Escape special characters such as . ? * + ( ) [ ] with a backslash in regex mode, or simply turn regex off to match them literally.

Find and Replace vs Word Processor Search

Word processors and code editors have excellent find-and-replace features, but they're tied to the document you have open. An online tool is quicker for text that lives elsewhere, such as a chunk of data from an email, a spreadsheet column, a snippet of configuration, or text you're about to paste into a website. Multiple rules make it easy to repeat the same clean-up routine: paste new text, and all your rules are applied at once in the same order every time.

Regular expressions add real power. With a single pattern you can reformat every date, phone number or product code in a document, remove all bracketed notes, add quotes around every line, or swap the order of words. If you're new to regex, start with the presets and the cheat sheet above, and watch the highlight view to see what your pattern matches before relying on the result.

Frequently Asked Questions

How do I replace a word everywhere in my text?

Enter the word in Find and the new word in Replace with. All occurrences are replaced instantly; tick "Whole words only" to avoid changing parts of longer words.

How do I delete a word or phrase?

Enter it in Find and leave Replace with empty.

How do I replace text with a new line?

Type \n in Replace with (keep "Interpret \n and \t" ticked).

What regex flavour is used?

JavaScript regular expressions with Unicode support; ^ and $ match at the start and end of each line.

Is my text uploaded?

No. All searching and replacing happens in your browser.