Skip to content

Find and replace text online

Find and replace text with plain or regex matching, capture groups, whole-word and case options, plus a live highlighted preview.

  • Runs in your browser
  • Files are never uploaded
  • Free, no account

Nothing is sent anywhere — the search runs against the copy of the text held in this tab.

Match mode

Plain text matching. Escapes such as \n and \t are still understood in both fields.

Off matches “acme” and “ACME” alike.

“cat” will not match inside “category”.

Anchors match at every line, not just the whole text.

The . wildcard also spans line breaks.

Matches
0
Characters before
0
Characters after
0
Difference
+0
Result
Enter some text and a search term to see the replacement.

How to find and replace text

  1. Paste your text, or drop a file onto the box.
  2. Type what you are looking for. The match count and highlighted preview update as you type — before anything is changed.
  3. Type the replacement. Leave it empty to delete every match.
  4. Switch to regular-expression mode when you need patterns rather than literal text.
  5. Check the before/after preview and the match table, then copy, download, or press “Apply to input” to keep editing.

Plain text mode

Plain mode matches exactly what you type — no special characters to escape. Two conveniences are still available in both fields: escape sequences (\n for a line break, \t for a tab, \uXXXX for any Unicode character) and the whole-word option, which stops cat from matching inside category. A literal $1 in the replacement stays a literal $1.

Regular expressions and capture groups

Regex mode uses the JavaScript flavour, including lookahead, lookbehind, named groups and Unicode property escapes. Anything you wrap in parentheses is captured and can be referenced in the replacement.

Goal Find Replace with
Renumber invoicesInvoice (\d+)INV-$1
Swap “Last, First” to “First Last”(\w+), (\w+)$2 $1
US date to ISO(\d{2})/(\d{2})/(\d{4})$3-$1-$2
Delete trailing spaces[ \t]+$(empty)
Collapse repeated blank lines\n{3,}\n\n
Strip HTML tags<[^>]+>(empty)
Wrap every line in quotes^(.+)$"$1",
Keep only the domain.*@(.+)$1

Special replacement tokens follow the JavaScript standard: $& is the whole match, $1–$99 are numbered groups, $<name> is a named group, and $$ inserts a literal dollar sign.

The option switches

Option Effect
Case sensitiveOff adds the i flag, so ACME, Acme and acme all match.
Whole words onlyRequires a non-word character (or the start/end of the text) on both sides of the match.
MultilineAdds the m flag so ^ and $ anchor to each line rather than the whole text.
Dot matches newlineAdds the s flag so . also matches line breaks — needed for patterns that span lines.

Why the preview matters

A bad regex can quietly destroy a document. The before/after panels show your matches highlighted in place, and the match table lists the first twenty matches with the exact text each will become and the line it is on. Nothing is committed to the input box until you press “Apply to input”, so you can iterate on a pattern with no risk. If the pattern is invalid the tool explains what the engine objected to instead of silently doing nothing.

Handling large files

Matching runs in chunks with the interface allowed to repaint between them, so a multi-megabyte file stays responsive. The highlighted preview is capped at the first few thousand characters for speed; the result box and the download always contain the complete text. Everything is processed inside your browser, so confidential documents never leave the machine.

Questions

How do capture groups work?

Wrap part of your pattern in parentheses, then reference it in the replacement with $1, $2 and so on. For example, matching "Invoice (\d+)" and replacing with "INV-$1" turns "Invoice 1042" into "INV-1042". Named groups work too, via $<name>.

Which regex flavour is supported?

JavaScript regular expressions, including lookahead, lookbehind, named groups and Unicode property escapes such as \p{L}. Global matching is always on; case-insensitivity, multiline anchors and dot-matches-newline are toggles.

Can I replace a tab or a line break?

Yes. Both fields understand \n, \r, \t and \uXXXX escapes even in plain-text mode, so you can replace every tab with a comma without touching regular expressions.

What does whole words only do?

It wraps your pattern in boundaries so "cat" matches the word cat but not "category" or "concatenate". The boundary is Unicode-aware, so accented words behave correctly.

Is there an undo?

The original text stays in the input box until you press "Apply to input", so nothing is destroyed. Clearing the Find field instantly restores the untouched text in the result box.