FormatterHQ

Text Replacer (Find and Replace)

Find every occurrence of a word, phrase or regex pattern and replace it in one pass, with options for case, whole words and capture groups.

Input TEXT
Output TEXT
Ready.

How to use the Text Replacer

  1. Paste the text you want to edit.
  2. Enter the text or pattern to find and what to replace it with.
  3. Turn on case sensitive, whole words or regular expression matching if you need them.
  4. Check the number of replacements reported, then copy the result.

Find and replace with the text replacer

The text replacer finds every occurrence of a word, phrase or pattern in your text and swaps it for something else in one pass. It reports how many replacements it made, so you can confirm the edit did what you expected. You can make matching case sensitive, restrict it to whole words, or switch on regular expressions.

How matching works by default

With every option off, the search is a plain, case-insensitive substring match. Characters such as ., * or ( are treated literally, and all matches are replaced, not just the first.

Text:    The quick brown fox jumps over the lazy dog.
         The Fox is quick; foxes are quicker.
Find:    fox        Replace with: cat

Result:  The quick brown cat jumps over the lazy dog.
         The cat is quick; cates are quicker.
         (3 replacements made)

Notice that "foxes" became "cates". Substring matching ignores word boundaries, and this is the most common find-and-replace mistake.

Options explained

  • Case sensitive – only exact-case matches count. In the example, "Fox" is left alone and 2 replacements are made.
  • Whole words only – a match may not touch a letter, digit or underscore on either side. "fox" and "Fox" change, "foxes" does not. The check understands accented and non-Latin letters.
  • Regular expression – the find field becomes a JavaScript regular expression. In the replacement, $1, $2 and so on insert capture groups and $& inserts the whole match.

In the replacement field, \n inserts a line break and \t a tab, in both plain and regex mode. Replacing , with \n turns a comma-separated list into one item per line.

Regex example: reformat dates

Find:     (\d{4})-(\d{2})-(\d{2})
Replace:  $3/$2/$1
Text:     2024-03-15 and 2025-12-01
Result:   15/03/2024 and 01/12/2025

Patterns run with the global and Unicode flags, and case-insensitive unless you tick case sensitive. There is no multiline flag, so ^ and $ match only the start and end of the whole text, and . does not match line breaks. To prefix every line, find (^|\n) and replace with $1- . An invalid pattern, such as an unclosed parenthesis, shows an error and leaves your text untouched.

Outside regex mode, a $1 in the replacement is inserted literally, which is what you want when replacing prices or variable names.

Related tools

For renaming terms, the word replacer has whole-word matching switched on from the start. To review exactly what changed, compare the before and after versions in the diff checker. To delete entire lines that contain a term instead of editing them, use remove lines containing.

Privacy

The processing runs entirely in your browser. The text you enter is not uploaded to a server.

Frequently asked questions

Does the text replacer support regular expressions?
Yes. Turn on regular expression mode and write JavaScript regex syntax, including groups, lookaheads and Unicode property escapes. Use $1, $2 for capture groups and $& for the full match in the replacement.
How do I replace text with a line break?
Type \n in the replacement field; it is converted to a real line break. \t works the same way for tabs, with or without regex mode.
Why did it change part of a longer word?
Plain matching looks for the characters anywhere, so "fox" also matches inside "foxes". Turn on whole words only to change the word only where it stands alone.
Can ^ and $ match the start of each line?
No, the pattern is not run in multiline mode, so ^ and $ refer to the whole text. Match line breaks directly instead, for example find (^|\n) and replace with $1 plus your prefix.
Is find and replace case sensitive?
Not by default: "fox" matches "Fox" and "FOX" too. Tick case sensitive when capitalization matters, for example to leave the brand name "Apple" alone while replacing "apple".

Last updated October 3, 2026

Related tools

Word Replacer Rename a word or name across a document with whole-word matching, optional case sensitivity and a count of replacements. ASCII Art Text Generator (FIGlet) Turn text into large ASCII art banners with 30 FIGlet fonts. Wrap them as code comments for README files, CLIs and source headers. Delimited Text Extractor Extract one or more columns from CSV, TSV, pipe or any delimited text by column number. HTML to Text Converter Extract readable plain text from HTML: keeps paragraphs, headings, lists and tables, drops tags, scripts and styles. JSON to Text Converter Convert JSON to Text online for free. Readable key: value output for reports and tickets. Small Text Generator Convert text into small caps, superscript or subscript Unicode letters you can copy and paste. Text to Speech Read text aloud with the voices in your browser. Choose a voice and language, set speed, pitch and volume, and follow the highlighted words. Upside Down Text Flip text upside down (ʇxǝʇ uʍop ǝpᴉsdn) using Unicode characters you can paste anywhere. URL Extractor Extract URLs and links from text or HTML, including href and src attributes. Remove duplicates, sort, keep only domains, and copy the list. Word Counter Count words, characters, sentences, paragraphs and lines, and estimate reading and speaking time. Word Frequency Counter Count how often each word appears in a text and rank them by frequency with percentages. Word Repeater Repeat one word or a short phrase N times with a space, comma, new line or no separator, for drills, filler text and length tests.