toolqik

159 · Text

Find & Replace

Find and replace text, with optional regex, capture groups and whole words.

Runs in your browser
Options
Result

  

    About this tool

    Replace words, phrases or patterns across a whole document at once. Type what to find and what to replace it with, and the result updates live with a count of matches and a list of where they are. Plain text works out of the box; switch on Regular expression for pattern-based replacements with capture groups.

    Options

    • Replace all: on by default; turn it off to replace only the first match.
    • Match case: off by default, so “apple” also finds “Apple”.
    • Whole words: “cat” won’t match inside “category”.
    • Use \n and \t in replacement: type \n to insert a line break, which turns a, b, c into one item per line when you replace , with \n.
    • Use result as input: apply several replacements one after another.

    Regex replacements

    With regular expressions on, use $1, $2… (or $<name> for named groups) in the replacement to reuse captured text, and $& for the whole match. Examples:

    FindReplaceEffect
    (\d{4})-(\d{2})-(\d{2})$3/$2/$12025-03-14 → 14/03/2025
    ^- Prefix every line (with the m flag)
    \s+$(empty)Remove trailing spaces on each line
    (\w+)@(\w+)$1 [at] $2Obscure email addresses
    \n{2,}\nCollapse blank lines

    Patterns use JavaScript regex syntax and run in a background worker with a time limit, so a runaway pattern can’t freeze the page. Build and debug patterns with the regex tester or understand them with the regex explainer.

    FAQ

    How do I find and replace text online?

    Paste your text, type the word to find and its replacement. All matches are replaced instantly; copy or download the result.

    How do I replace with a new line?

    Type \n in the Replace field with “Use \n and \t in replacement” on. For example, replace “, ” with \n to put each item on its own line.

    Can I use regular expressions?

    Yes. Turn on Regular expression to use JavaScript regex syntax, with $1, $2 or $<name> to insert captured groups in the replacement.

    How do I replace only whole words?

    Turn on Whole words, so “cat” is not replaced inside “category”.

    How do I delete every match?

    Leave the Replace field empty. Every match is removed.

    esc
    ↑↓ navigate↵ open