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] |
Worked examples
Reformat dates
Inputs: find (\d{2})/(\d{2})/(\d{4}) · replace $3-$1-$2
Result: 12/31/2025 → 2025-12-31
Strip HTML tags
Inputs: find <[^>]+> · replace with empty
Result: <p>Hi</p> → Hi
Collapse spaces
Inputs: find \s{2,} · replace with single space
Result: "a b" → "a b"
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
Why use Find and Replace Text?
- Full regex support with capture groups and back-references enables complex pattern-based transformations
- Live match highlighting counts all occurrences before any replacement is committed
- Whole-word mode prevents partial substitutions that would corrupt compound identifiers or URLs
- Replace-Next stepping lets you review and approve each individual match before making it permanent
Common use cases
- Update a domain name across every URL in a bulk-exported sitemap text file in one operation
- Reformat MM/DD/YYYY dates to ISO 8601 YYYY-MM-DD format across a large data export using a regex
- Strip residual HTML tags from text pasted from a web page into a plain-text document
- Convert Windows CRLF line endings to Unix LF in a config snippet before uploading to a Linux server
- Replace smart curly quotes with straight ASCII quotes in code pasted from a word processor
Get weekly tool tips & updates
New tools, power-user tips, and productivity hacks — delivered free every Friday.
No spam, ever. Unsubscribe with one click.
Related Text Tools
Text Diff Checker
Compare two texts line by line and highlight added, removed, and unchanged content instantly for copy review, QA checks, and revision auditing.
Case Converter
Convert text to camelCase, PascalCase, snake_case, kebab-case, UPPERCASE, lowercase, Title Case, and Sentence case instantly.
Remove Duplicate Lines
Remove duplicate lines from text online. Case-sensitive or insensitive matching. Preserves order or sorts alphabetically. Free online tool.
Remove Line Breaks
Remove line breaks and paragraph breaks from text online. Replace breaks with spaces, keep paragraphs, and strip extra spaces. Free and private.
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 by paragraph, sentence, or word count. Optionally output wrapped HTML paragraph tags.
Explore all Text Tools.