Find & Replace Tool
Find and replace text instantly online with regex, whole word, case matching, preserve case, and batch rules. 100% client-side.
Updated
What is the Find & Replace Tool?
Tired of manually editing the same word hundreds of times? This free Find & Replace Tool lets you search and replace text in seconds, right in your browser. It works like the find/replace in VS Code or Google Docs, but with pro features most online tools skip.
Paste any text – articles, code, logs, CSV data, or chat transcripts – then define one or multiple rules. You get a live preview, match counts, and line-by-line highlighting before you commit.
Why it's better than basic replacers
- Regex support with full flags (g, i, m, s, u), capture groups (2), &,`, $', and named groups
- Batch rules – chain multiple find/replace pairs top-to-bottom for complex cleanups
- Smart options – case-sensitive, whole word, replace all vs first only, multiline, dotAll
- Preserve Case – automatically converts FOO→BAR, Foo→Bar, foo→bar without extra rules
- Live stats – see matches, replacements, and lines affected instantly
- Private by design – 100% client-side, nothing uploads or leaves your device
Perfect for writers fixing typos, developers refactoring code, marketers updating brand names, data cleaners normalizing spreadsheets, and anyone who needs reliable search and replace without installing software.
How it works
The tool processes your text locally using JavaScript RegExp, giving you IDE-level control with zero setup.
Paste your input – Drop text into the left editor. Line numbers help you track changes.
Create a rule – Enter what to find and what to replace.
- Toggle Regex off for literal text, on for patterns like
\d{3}-\d{4}. - Use 2 in the replace field to insert capture groups.
- Choose options – Click the toggles:
- Aa = case-sensitive
- Whole word = adds word boundaries (\b)
- Preserve case = matches original casing
- Replace all = g flag; turn off to replace first match only
- m, s, u = multiline, dotAll, unicode flags
Add more rules – Click "Add rule" to chain operations. Rules run sequentially, so you can first clean whitespace, then rename terms, then reformat dates.
Review live output – The right editor shows the result instantly. Matching lines are highlighted, and the stats bar shows total matches and replacements.
Copy or download – Use the copy button or download as .txt. No data is saved.
Under the hood, each rule builds a RegExp (escaping literals automatically), finds all matches, interpolates replacements, applies preserve-case logic if enabled, and feeds the result to the next rule.
Examples
Replace product names
Swap an old brand name for a new one across a document
Reformat dates with regex
Convert MM/DD/YYYY to YYYY-MM-DD using capture groups
Preserve case while replacing
Replace foo with bar and keep FOO, Foo, and foo casing intact
Frequently asked questions
Is my text sent to a server?
Is my text sent to a server?
No. Everything runs 100% in your browser using JavaScript. Your text never uploads, is not stored, and disappears when you close the tab. This makes it safe for private notes, code, or client data.
Does it support regular expressions?
Does it support regular expressions?
Yes. Turn on the Regex toggle to use full JavaScript regex. You get flags for global (g), case-insensitive (i), multiline (m), dotAll (s), and unicode (u). Invalid patterns show a clear error message instead of failing silently.
How do I use capture groups like 2?
How do I use capture groups like 2?
In Regex mode, wrap parts of your find pattern in parentheses. For example, find (\d{2})/(\d{2})/(\d{4}) and replace with $3-$1-$2 to convert 07/04/2026 to 2026-07-04. You can also use & for the whole match,` for text before,
What does Preserve Case do?
What does Preserve Case do?
Preserve Case keeps the original capitalization. If you replace "cat" with "dog", it automatically produces DOG for "CAT", Dog for "Cat", and dog for "cat". It's ideal for renaming code variables, brands, or terms without writing three separate rules.
Can I replace only the first occurrence?
Can I replace only the first occurrence?
Yes. Turn off the "Replace all" toggle. The tool will replace just the first match per rule, which is useful for headers or one-time fixes.
What is Whole Word matching?
What is Whole Word matching?
Whole Word adds word boundaries so "cat" won't match "catalog" or "scatter". It's perfect for avoiding accidental partial replacements. It works in both literal and regex modes.
Can I run multiple find and replace operations at once?
Can I run multiple find and replace operations at once?
Yes. Click "Add rule" to create a stack of operations. Rules process top-to-bottom, so you can clean data in stages. Disable any rule with the checkbox without deleting it.
Why is my regex showing an error?
Why is my regex showing an error?
The tool validates patterns before running. Common issues are unclosed parentheses, invalid character classes, or stray backslashes. The error message points to the exact problem, like "Invalid regex: Unterminated group".
Does it work with large files?
Does it work with large files?
Yes, for most documents up to several hundred thousand characters it stays instant because processing is local. For very large logs, turn off "Replace all" or split into smaller chunks to keep the browser responsive.
Related tools
More utilities you might find handy.
Anagram Checker
Check if two strings are anagrams with customizable normalization options.
Case Converter
Convert text to various cases like uppercase, lowercase, title case, camelCase, snake_case, and more, with additional text cleaning features.
Free Word Counter Online – Count Words, Characters & More Instantly
A fast, free word counter tool that counts words, characters, sentences, and paragraphs in real time. Includes reading time, keyword density, and optional word goal tracking.