Text Replacer: Free Online Find and Replace

String/Text Replacer

Advanced find and replace with Regex support.

The String/Text Replacer is a free text replacer that finds a word, phrase or pattern in your text and swaps it for new text, or deletes it. Paste your content, type what to find, choose Match Case, Whole Word or Regex Mode, and get the edited result with match and replacement counts.

What Is Find and Replace for Text?

Find and replace is an edit that searches a block of text for a specific string and substitutes another string for every place it appears. A string is just a run of characters: a word, a number, a symbol or a whole phrase.

There are two ways to search. A literal search looks for exactly what you typed, so a period is a period and a dollar sign is a dollar sign. A pattern search (regular expressions, or regex) describes a shape instead, such as "any run of digits" or "any email address". Literal search is faster to set up. Pattern search is what you need when the text you want to change is not identical each time.

This tool supports both. Leave Regex Mode off for plain searches, or turn it on to use patterns and capture groups.

How Do You Use the Text Replacer?

You use it by pasting text, entering a search term and replacement, picking your options and clicking Replace. The edited text appears in a separate box, so your original stays untouched.

  1. Paste or type your content into the Input Text box.
  2. Enter the text or pattern you want to locate in the Find field.
  3. Enter the new text in Replace With. Leave it empty if you want to delete every match.
  4. Tick Match Case, Whole Word or Regex Mode as needed. Replace All is ticked by default.
  5. Click Replace. The result appears in Output Text, with a line such as "5 matches found" and "5 replacements made" beside the boxes.
  6. Click Copy to copy the output (the button briefly shows "Copied!"), or Clear to empty both boxes and start over.

If you click Replace while Find is empty, the output simply mirrors your input. Nothing is changed.

What Do Match Case, Whole Word, Regex Mode and Replace All Do?

Each checkbox changes how the Find field is interpreted. By default the search ignores letter case, matches partial words and replaces every match.

OptionEffectDefault
Match CaseTreats Cat and cat as different stringsOff
Whole WordSkips matches inside longer wordsOff
Regex ModeReads Find as a patternOff
Replace AllChanges every match, not only the firstOn

Whole Word is switched off automatically when Regex Mode is on. In a pattern you control word edges yourself, for example by wrapping a term in \b markers. If you untick Replace All, only the first match in the text is changed, and the counter reports one replacement.

Worked Example: Switching Spelling Across a Paragraph

Suppose you are converting a US draft to British spelling. Your input is: Color, color and COLOR. The colorful sign said colorless. You enter color in Find and colour in Replace With, then click Replace.

With Match Case and Whole Word both off, the tool finds five matches: Color, color, COLOR, and the start of colorful and colorless. The output reads: colour, colour and colour. The colourful sign said colourless. The counters show "5 matches found" and "5 replacements made". Notice that every match becomes the lowercase replacement you typed, so the capital C in the first word is lost.

Now tick Whole Word and click Replace again. Only the three standalone words match, so you get "3 matches found" and the output colour, colour and colour. The colorful sign said colorless. That is the right setting when you want to change a single word without touching longer words that contain it.

How Do You Use Regex Mode and Capture Groups?

Tick Regex Mode and the Find field is treated as a pattern. A row of Common Patterns buttons also appears: Email, URL, Numbers, Whitespace, Line Start, Line End, HTML Tags and Punctuation. Clicking one fills the Find field with a ready-made pattern and switches Regex Mode on.

Swap Names With Capture Groups

Parentheses in a pattern create capture groups. In Replace With, $1 means the first group, $2 the second, and so on. Find (\w+), (\w+) and replace with $2 $1. The line Smith, John becomes John Smith. Run it on a whole list and every line is reordered at once.

Clean Up Whitespace

Choose the Whitespace button (\s+) and set Replace With to a single space. Runs of spaces, tabs and line breaks collapse into one space. Be aware that line breaks count as whitespace, so your paragraphs will merge into one line. To trim only trailing spaces at the end of each line, use [ \t]+$ and leave Replace With empty.

Add a Prefix or Suffix to Every Line

In Regex Mode, ^ and $ match the start and end of each line, not just the whole text. Find ^ and replace with - to turn a list of lines into bullet points. Find $ and replace with a semicolon to end every line with one.

Strip Markup or Extract Clean Text

The HTML Tags pattern, <[^>]+>, with an empty Replace With field removes tags and leaves the visible text. It is a quick cleanup for pasted snippets, though it will not decode special characters such as &amp;.

How Do You Read and Act on the Results?

Read the two counters first. "Matches found" tells you how many places your Find value appears, and "replacements made" tells you how many were changed. These numbers are your fastest sanity check.

  • Zero matches: Check spelling, hidden spaces, and whether Whole Word or Match Case is excluding what you expect. In Regex Mode, check that special characters are escaped.
  • Far more matches than expected: Your term is probably appearing inside longer words. Turn on Whole Word or tighten the pattern.
  • Output looks identical to the input: The Find field may be empty, or the replacement may equal the original text.
  • A red "Regex error" message: The pattern is invalid, often because of an unclosed bracket or parenthesis. Fix it and click Replace again.

For anything important, paste the original and the output into a text compare tool to see every change side by side before you publish or import the result.

Who Uses a Text Replacer and When?

Anyone who edits repeated text benefits, because doing it by hand is slow and misses instances. Common situations include:

  • Content and SEO teams: Update a product name, brand spelling or outdated term across a long draft or a pasted list of meta descriptions.
  • Developers and analysts: Reformat log lines, rename identifiers in a snippet, or remove tags and stray characters from exported data.
  • Spreadsheet and list work: Replace line breaks or tabs with other separators, then tidy the result with a comma separating tool.
  • Writers and students: Fix a name misspelled throughout a document, or standardize punctuation.
  • Data cleanup: Delete unwanted digits, URLs or punctuation before running a character frequency counter on the cleaned text.

Best Practices, Common Mistakes and Troubleshooting

The safest habit is to test on a small sample first, then run the full text. A pattern that works on three lines may behave very differently on three thousand.

Test Before You Commit

Keep the original in the Input Text box, since the output is separate. If the result is wrong, change the settings and click Replace again. The tool has no undo for the output, so copy anything you want to keep before running a new replacement.

Escape Special Characters in Regex Mode

Characters such as ., ?, *, +, ( and [ have special meaning in patterns. To find a literal period, write \.. If you only want a literal match, leave Regex Mode off and you do not need to escape anything.

Watch the Case of Your Replacement

The replacement is inserted exactly as typed. Replacing color with colour will not preserve capital letters. If you need a different case afterward, run the output through a text case changer.

Be Careful With Dollar Signs

A dollar sign followed by a number in Replace With is read as a group reference. If you are replacing text with prices, check the output to confirm the amounts came through unchanged.

Whole Word and Symbols

Whole Word relies on word boundaries, which are defined by letters, digits and underscores. A term that starts or ends with a symbol, such as C++ or #tag, may not match with Whole Word on. Turn it off for those terms.

Multiple Replacements

The tool performs one find and one replacement per run. For several changes, run them in sequence, feeding the previous output back into Input Text each time. Order matters: replacing cat with dog and then dog with bird would turn every original cat into a bird.

Limitations to Keep in Mind

This tool works on plain text you paste in. It does not open files, edit formatting such as bold or links in a word processor, or keep a history of past replacements. Matching ignores case unless you tick Match Case, so check that setting when capital letters matter.

Greedy patterns can also surprise you. A pattern like <.*> grabs everything between the first and last angle bracket on a line. Prefer specific patterns such as <[^>]+>.

Once your text is edited, you can sort the lines or explore more utilities in the text utility tools collection. To make your first replacement, paste your text into the box above, enter your Find and Replace With values, and click Replace.

Frequently Asked Questions

How do I replace text in a string online?
Paste your text into Input Text, type the word or phrase in Find, enter the new text in Replace With, and click Replace. The edited version appears in Output Text, with counts of matches found and replacements made.
Can I delete text instead of replacing it?
Yes. Leave the Replace With field empty and click Replace. Every match of your Find value is removed from the output. For example, finding a double space and leaving the replacement blank deletes all of them.
Does the String/Text Replacer support regex and capture groups?
Yes. Tick Regex Mode to use patterns, and refer to capture groups in Replace With using $1, $2 and so on. Finding (\w+), (\w+) and replacing with $2 $1 turns Smith, John into John Smith.
What is the difference between Match Case and Whole Word?
Match Case makes the search treat capital and lowercase letters as different, while Whole Word only matches complete words. With Whole Word on, searching for cat will not change the word category. Whole Word is unavailable in Regex Mode.
Why does the tool say 0 matches found?
Zero matches usually means the Find value does not appear exactly as typed. Check spelling and spaces, and see whether Match Case or Whole Word is excluding it. In Regex Mode, an unescaped special character such as a period or bracket can also cause it.
Is the text replacer free, and can I undo a replacement?
The text replacer is free and needs no sign-in. It has no undo, but your original stays in Input Text while the result appears in Output Text, so you can change the settings and click Replace again.
Recommended

Explore VPN options

A VPN changes your network exit. It does not guarantee anonymity.

Hide Your IP Encryption Network coverage
Protect My IP Now