Skip to content
Processing locally — files never leave your device

Find and Replace Text Online

Find and replace inside a body of text. Supports regular expressions, capture groups, and case-insensitive search.

How to use Find & Replace

  1. Paste the text you want to edit into the input box.
  2. Type the term to find and the text to replace it with. The output and match count update live as you type.
  3. Leave Regex off for a plain literal swap, or turn it on to match patterns and reuse capture groups like $1 in the replacement.
  4. Toggle Case-insensitive to match regardless of capitalisation, and Multiline so ^ and $ anchor to each line instead of the whole text.
  5. Read the match count, then click Copy to grab the result. The substitution is run by your browser's own regex engine, so the document stays on your machine.

Find and replace, from a simple swap to full regex

Find and replace is the workhorse of text editing, but doing it inside a word processor or code editor often means losing your place, triggering autocorrect, or being limited to literal matches. This tool gives you a focused, distraction-free box with a live match count and the full power of the JavaScript regular-expression engine your browser already ships with.

Literal mode: the safe default

With Regex turned off, whatever you type in the Find box is matched character for character. Special characters such as ., (, and * are escaped automatically, so searching for example.commatches the literal domain and not "exampleany charactercom". This is the right mode for renaming a term, fixing a recurring typo, or swapping a placeholder for a real value.

Regex mode: match patterns, not just strings

Turn Regex on and the Find box becomes a full pattern. A few practical examples:

  • \s+$ with Multiline on — strip trailing whitespace from every line.
  • (\d4)-(\d2)-(\d2)$3/$2/$1 — reformat ISO dates to DD/MM/YYYY.
  • <[^>]+> → (empty) — remove every HTML tag from pasted markup.
  • ^- with Multiline on — turn lines into a bulleted list.

Capture groups in parentheses can be reused in the replacement with $1,$2, and so on, which is what makes reordering and reformatting possible in a single pass.

Case-insensitive and multiline flags

Case-insensitivematches a word regardless of how it is capitalised — useful when the same term appears as "Color", "color", and "COLOR". Multiline changes what the anchors ^ and $ mean: instead of the start and end of the whole text, they match the start and end of every line, which is essential for line-by-line edits like adding a prefix or suffix.

Read the match count before you trust the result

The output header shows how many matches were replaced. Glancing at that number is the quickest sanity check — if you expected to change five occurrences and it says fifty, your pattern is too broad; if it says zero, your pattern is too specific or has a typo. Adjust and watch the count update live.

Related text tools

Frequently asked questions

Can I use backreferences like $1 in the replacement?
Yes — with Regex enabled. Wrap part of your find pattern in parentheses to create a capture group, then insert it into the replacement with $1, $2, and so on. For example, find ([a-z]+)@([a-z]+) and replace with $2.$1 to swap the two halves of every match.
Does it replace every occurrence or just the first?
Every occurrence. The global (g) flag is always applied, so all matches in the text are replaced at once. There is no "replace one at a time" mode — this is built for bulk edits.
What is the difference between literal and regex mode?
In literal mode the find text is matched exactly, and special characters like . ( ) * are treated as ordinary characters (they are auto-escaped for you). In regex mode those characters become operators, letting you match patterns — digits with \d, word boundaries with \b, optional parts with ?, and so on.
What does the Multiline toggle do?
It adds the m flag. With Multiline on, the anchors ^ and $ match the start and end of each line rather than the start and end of the entire input. Turn it on when you want to, say, add a prefix to every line by replacing ^ with your prefix.
Why does my regex show an error?
JavaScript regular-expression syntax is strict: unbalanced parentheses, an unclosed character class, or an invalid escape will throw. The exact engine error appears below the inputs so you can see precisely what went wrong, and the original text is left unchanged until the pattern is valid.
How do I delete text instead of replacing it?
Leave the Replace field empty. Every match of your find pattern is removed. This is the fastest way to strip a recurring word, an HTML tag, or trailing whitespace (with regex \s+$ and Multiline on) from a whole document.
Does it handle very large text?
It works on anything your browser can hold in memory, which is comfortably tens of thousands of lines. Because the replacement runs locally with no network round-trip, even large inputs update almost instantly.
Is my text sent anywhere?
No. The find pass and the replace pass both use the regular-expression engine built into your browser, working on text that never leaves the tab — so confidential documents, source code, and private notes are safe to edit here.

More tools you might find useful in the same flow.

Built by Muhammad Tahir · About