Find and Replace Text
Replace all occurrences of any text instantly. Supports regex patterns, case sensitivity, and whole-word matching. See match count and replacements made.
How to use Find and Replace Text
The Find & Replace tool performs bulk search-and-replace operations on any block of text, with support for literal string matching, case-insensitive matching and full regular expression patterns. It shows a live preview of every match before applying changes, displays a replacement count, and handles multi-line text and Unicode characters correctly — making it ideal for bulk editing data exports, template files and large documents without opening an IDE.
- Paste the text you want to edit into the main text area.
- Enter the search string (or regex pattern) in the "Find" field.
- Enter the replacement string in the "Replace" field (use $1, $2 etc. for captured groups in regex mode).
- Toggle "Case sensitive", "Whole word" and "Use regex" options as needed.
- All matches are highlighted in the text area; the match count is shown above.
- Click "Replace All" to apply all replacements, or use "Replace Next" to step through them one at a time.
Your data never leaves your device — 100% private processing.
Regex replace patterns and back-references
When using regex mode, the replacement string can reference captured groups from the search pattern. A capture group is a portion of the pattern wrapped in parentheses. In most replacement engines (JavaScript, Python re.sub, sed), $1 or \1 inserts the text matched by the first capture group, $2 the second, and so on. Named groups (?<year>\d{4}) can be referenced as $<year>. For example, the pattern (\w+)\s(\w+) with replacement $2 $1 swaps two space-separated words. The special replacement $& inserts the entire matched string, useful for wrapping matches in markup.
Common bulk-editing use cases
Find & Replace is most powerful for repetitive transformations across large texts. Common tasks include: updating a domain name across hundreds of URLs (find https://old-domain.com, replace with https://new-domain.com); reformatting dates from MM/DD/YYYY to YYYY-MM-DD using a capturing regex; stripping HTML tags from copied web content; converting Windows line endings (\r\n) to Unix line endings (\n); replacing smart/curly quotes with straight ASCII quotes in code or CSV files; and normalising phone number formats across a contact list.
| Task | Find (regex) | Replace |
|---|---|---|
| Swap date MM/DD/YYYY → YYYY-MM-DD | (\d{2})/(\d{2})/(\d{4}) | $3-$1-$2 |
| Strip HTML tags | <[^>]+> | |
| Collapse multiple spaces | \s{2,} | |
| Convert CRLF to LF | \r\n | \n |
| Remove blank lines | ^\s*$\n | |
| Wrap numbers in brackets | (\d+) | [$1] |
Glossary
- Back-reference
- A replacement token ($1, \1) that inserts the text matched by a capture group into the replacement string.
- Whole word match
- A search mode that only matches the pattern when it appears as a complete word, bounded by non-word characters.
- Greedy match
- A regex quantifier behaviour that matches as many characters as possible, which can cause unintended over-matching.
- Non-greedy (lazy)
- A regex quantifier (*?, +?) that matches as few characters as possible, useful in HTML tag patterns.
- Global flag
- The g regex flag that causes a pattern to match all occurrences rather than stopping at the first.
Related reading
Frequently Asked Questions
Get weekly tool tips & updates
New tools, power-user tips, and productivity hacks — delivered free every Friday.
No spam, ever. Unsubscribe with one click.
Why use Find and Replace Text?
- Instant results with no signup or account creation
- Works offline once the page is loaded
- Supports Unicode and multilingual text
- Copy results to clipboard with a single click
Common use cases
- Count words in an essay before submission
- Sort a list of items alphabetically
- Remove duplicate lines from CSV exports
- Change the case of text copied from PDFs
- Find and replace text across large documents
Related Text Tools
Text Diff Checker
Compare two texts and see the differences highlighted. Line-by-line diff with added, removed, and changed lines clearly marked.
Case Converter
Convert text to camelCase, PascalCase, snake_case, kebab-case, UPPERCASE, lowercase, Title Case, and Sentence case instantly.
Word Counter
Count words, characters, sentences, and paragraphs, and estimate reading time. Free, instant, and private — ideal for essays, articles, and posts.
Lorem Ipsum Generator
Generate Lorem Ipsum placeholder text in paragraphs, sentences, or words. Optionally wrap in HTML paragraph tags.
Remove Duplicate Lines
Remove duplicate lines from text online. Case-sensitive or insensitive matching. Preserves order or sorts alphabetically. Free online tool.
Word Frequency Counter
Analyze word frequency in any text. Find the most common words with their count and percentage of the total — great for SEO and writing analysis.
Explore all Text Tools.