Find and Replace Text

Type what to find and what to replace it with, and every match in your text is replaced as you type. Use plain text for simple swaps, or regex mode for patterns such as dates, emails and repeated spaces; the tool shows how many matches it replaced.

Characters
0
Words
0
Lines
0

Your text never leaves your device.

How to use

  1. Paste your text, then type the word or pattern in Find and the new text in Replace with. Leave Replace with empty to delete every match.
  2. Choose Plain text or Regex, and turn on Match case if "Colour" and "colour" must be treated differently.
  3. Check the match count, then copy or download the result.

Examples

  • Before
    Find: colour → Replace with: color The colour of the Colour chart
    After
    The color of the color chart
  • Before
    Regex: (\d{2})/(\d{2})/(\d{4}) → $3-$2-$1 Due 25/12/2026 and 01/03/2027
    After
    Due 2026-12-25 and 2027-03-01
  • Before
    Regex: ", " → \n a, b, c
    After
    a b c

Plain text or regex?

Plain text finds exactly the characters you type. A period means a period and $1 means a dollar sign and a one. Use it for renaming a product, fixing a misspelled name or changing British to American spelling.

Regex treats the search as a pattern. A few that solve common cleanup jobs:

Find Replace with Effect
{2,} one space collapse repeated spaces
^\s+ nothing remove indentation from every line
-\n nothing rejoin words hyphenated at line ends
\n{3,} \n\n at most one empty line between paragraphs
@example\.com @example.org change a domain in a list of emails
(\w+), (\w+) $2 $1 swap “Smith, Anna” to “Anna Smith”

Without Match case, both modes ignore capitalization. Regex mode understands Unicode, but \w and [A-Za-z] still mean the 26 Latin letters only. Use \p{L} to match letters in any alphabet, including é, ж and ß.

Common mistakes

  • Forgetting to escape special characters in regex mode. A period matches any character, so “example.com” also matches “exampleXcom”. Write example\.com, or use plain text mode when you do not need a pattern.
  • Replacing a short word inside longer words. Replacing “cat” also changes “category” and “concatenate”. In regex mode, add word boundaries: \bcat\b.
  • Greedy patterns. ".*" on a line with two quoted words matches from the first quote to the last. Use ".*?" or "[^"]*" to match each quote separately.
  • Expecting the replacement to copy the match’s case. The replacement text is inserted as typed. Check the count and the result before copying.
  • Running a slow pattern on a big file. Nested repeats like (a+)+ can take exponential time. The tool stops them after a moment and shows an error; rewrite the pattern without nested quantifiers.

Frequently asked questions

How do I find and replace text online?

Paste the text, type the word to find and its replacement in the two fields above the result. All matches are replaced at once and the status shows how many there were. Nothing is changed in your original until you copy the result.

How do I use capture groups like $1?

In regex mode, parts of the pattern in parentheses are numbered from the left, and $1, $2 and so on insert them into the replacement. The pattern (\d{2})/(\d{2})/(\d{4}) with the replacement $3-$2-$1 turns 25/12/2026 into 2026-12-25. Named groups work too: (?<year>\d{4}) and $<year>. $& inserts the whole match.

How do I replace text with a line break?

Switch to regex mode and type \n in Replace with; \t inserts a tab. To find line breaks, use \n in the pattern: for example find \n and replace with ", " to turn a column of values into a comma-separated line.

Why did "Colour" become lowercase "color"?

With Match case off, the search finds every capitalization, but the replacement is inserted exactly as you typed it. Turn Match case on and replace "Colour" and "colour" in two passes if capitals matter.

Which regex syntax is supported?

JavaScript regular expressions with the Unicode flag, as in modern browsers. \p{L} matches any letter in any alphabet, ^ and $ match at the start and end of every line, and lookbehind (?<=…) works. Patterns that would run for too long, such as (a+)+ on a long input, are stopped after a moment with an error instead of freezing the page.