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
- Paste the text you want to edit into the input box.
- Type the term to find and the text to replace it with. The output and match count update live as you type.
- Leave Regex off for a plain literal swap, or turn it on to match patterns and reuse capture groups like $1 in the replacement.
- Toggle Case-insensitive to match regardless of capitalisation, and Multiline so ^ and $ anchor to each line instead of the whole text.
- 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
- Remove Line Breaks — for blanket newline removal that find-and-replace can also do.
- Case Converter — change capitalisation after a substitution.
- Remove Duplicate Lines — clean a list once you have normalised it.
- Text Statistics — confirm how many times a word appears before replacing it.
Frequently asked questions
Can I use backreferences like $1 in the replacement?
Does it replace every occurrence or just the first?
What is the difference between literal and regex mode?
What does the Multiline toggle do?
Why does my regex show an error?
How do I delete text instead of replacing it?
Does it handle very large text?
Is my text sent anywhere?
Related tools
More tools you might find useful in the same flow.
Extract Emails
Extract email addresses from any pasted text online — pulls out every address, removes duplicates, and sorts the list. Free, and runs in your browser.
Word Counter
Word counter online: count words, characters, sentences, and paragraphs in real time, with reading and speaking time estimates. Free, and no signup needed.
Sort Lines
Sort lines of text online — alphabetically A to Z or Z to A, numerically, or by length, with an option to drop blanks. Free and instant in your browser.
Remove Line Breaks
Remove line breaks from text online — strip every newline, collapse extra spaces, or replace each break with a custom separator. Free, instant, no signup.
Built by Muhammad Tahir · About