Find & Replace
Find and replace text with regex support. Bulk text replacement for code, content, and data processing.
Input
Paste text here. Output updates automatically as you type.
Find & Replace
Tip: If "Use regex" is ON, enter pattern without slashes (example: foo\d+).
fox, \bfox\b, [A-Z]+$1, $2… for capture groups. Output
Result is read-only. Use "Copy Result" to grab it.
What It Does
Find and Replace tool searches for text patterns in your content and replaces them with different text. It supports simple text matching, case-sensitive/insensitive search, whole word matching, and advanced regex (regular expression) patterns for complex find-and-replace operations. Essential for bulk editing, code refactoring, document cleanup, and text transformation. The tool highlights all matches before replacement, shows match count, supports find-only mode (no replace), and handles multi-line text. Use it to rename variables across code, update terminology in documents, clean up formatting inconsistencies, convert data formats, remove or modify patterns, and perform advanced text transformations using regex capture groups and backreferences.
Key Features:
- Simple text find and replace with match highlighting
- Case-sensitive or case-insensitive search modes
- Whole word matching: find "cat" but not "category"
- Regular expression (regex) support for advanced patterns
- Replace all occurrences or selective replacement
- Match count and position indicators before replacing
- Multi-line text support with line number references
- Regex capture groups and backreferences ($1, $2, etc.)
How To Use
Enter your text, specify what to find, what to replace it with, select search options (case sensitivity, whole word, regex), preview matches, then replace.
Enter Text and Search Pattern
Paste your text into the main input area. In "Find" field, enter the text or pattern to search for. For simple text, just type it. For complex patterns, enable "Regex" and use regular expressions—like \d+ for numbers, \w+ for words, or [A-Z]+ for uppercase letters. The tool highlights all matches in real-time showing where replacements will occur.
Configure Search Options
Select options: "Case Sensitive" to match exact letter casing (Find "Hello" won't match "hello"), "Whole Word" to match complete words only (Find "cat" won't match "category"), "Regex" to enable regular expression patterns, and "Multi-line Mode" for patterns spanning line breaks. Preview shows match count and positions: "Found 15 matches" with highlighting.
Replace and Verify Results
In "Replace With" field, enter replacement text. For regex, use $1, $2 for capture groups (parentheses in pattern). Click "Replace All" for all matches, or click individual highlighted matches for selective replacement. Review results: tool shows "Replaced 15 occurrences" and highlights changes. Use "Undo" to revert if needed. Copy modified text to clipboard.
Benefits
Use Cases
Code Refactoring and Variable Renaming
Rename variables, functions, or classes across code files using find-and-replace with whole word matching. Enable "Whole Word" to ensure "user" becomes "customer" but "username" stays unchanged. Essential for: refactoring codebases (improving naming conventions), updating deprecated API calls (old function names to new), changing configuration variable names, replacing library names after migration, and standardizing coding style (camelCase to snake_case). Use regex for advanced cases: find "get(\w+)" replace with "fetch$1" converts getUser → fetchUser, getData → fetchData. Most IDEs have built-in refactoring, but this tool works for: multiple file preparation, non-code text files, or quick experimentation before applying to actual code.
Document Terminology Updates
Update product names, company terms, or terminology across long documents when branding changes or terminology evolves. Marketing teams rebrand "Widget Pro" to "Widget Plus"—find-replace updates all mentions in documentation, help articles, marketing copy, and presentations. Use cases: company rebranding (old name → new name throughout materials), product version updates (v1.0 → v2.0), terminology standardization (ensure consistent term usage), legal compliance (updating required language), and internationalization prep (replacing culture-specific terms). Enable case-sensitive for proper nouns. Preview match count ensures comprehensive coverage: "Found 147 matches" confirms all instances found before replacing. For large documents, work section-by-section to verify accuracy.
Data Format Conversion
Convert data between formats using regex find-and-replace: CSV to TSV (tab-separated), date format changes (MM/DD/YYYY to YYYY-MM-DD), phone number formatting ((555) 123-4567 to 555-123-4567), or ID format standardization. Regex examples: find "(\d{2})/(\d{2})/(\d{4})" replace with "$3-$1-$2" converts dates; find "\((\d{3})\) (\d{3})-(\d{4})" replace with "$1-$2-$3" removes phone parentheses. Use for: preparing data for import (matching target format), cleaning exported data (fixing formatting), batch ID updates, and converting between data interchange formats. For production data conversion, test on sample first to verify regex accuracy. Combine with validation tools to ensure conversions succeeded correctly.
Text Cleanup and Formatting Fixes
Remove or fix formatting inconsistencies in documents: excessive whitespace (multiple spaces to single space), line break standardization (Windows \r\n to Unix \n), remove invisible characters, fix smart quotes to straight quotes, or strip special formatting from pasted content. Common regex patterns: find " +" (2+ spaces) replace with " " (single space) to normalize spacing; find "\r\n" replace with "\n" for line ending conversion; find regex pattern for smart quotes and replace with straight quotes for standardization. Essential when: copying text from PDFs (often has weird spacing), consolidating documents from different sources (mixed formatting), preparing text for code (removing non-ASCII), and cleaning up word processor artifacts (hidden formatting characters). Significantly improves text consistency and readability.
Template and Placeholder Replacement
Replace template placeholders with actual values in email templates, code generation, document templates, or configuration files. Find "{{NAME}}" replace with "John Smith", find "{{DATE}}" replace with "2024-12-16", etc. Use for: personalizing email templates (replace merge fields), generating code from templates (fill in class/variable names), creating customized documents (proposals, contracts with client details), and configuration file generation (replace placeholders with actual values). For multiple placeholders, replace one at a time or use regex for batch: find "{{(\w+)}}" and provide specific replacements per capture group. More sophisticated than mail merge, handles any text format: code, documents, configurations, or data files. Verify before sending/deploying to prevent unreplaced placeholders.
Frequently Asked Questions
1 When should I use regex mode vs simple text search?
2 Why do some replacements change unintended text?
3 How do I use capture groups and backreferences in replacements?
4 Can find-replace work across multiple files?
5 How do I replace line breaks or special characters?
Related Tools
Word / Character Counter
Count words, characters, sentences, and paragraphs instantly. Track reading time, keyword density, and text statistics for writing, SEO, and content creation.
Whitespace Tools
Remove extra spaces, trim whitespace, normalize line breaks, and clean up text formatting. Essential for code and content cleanup.
Line Tools
Sort lines, remove duplicates, add line numbers, shuffle lines, and manipulate text by lines. Perfect for processing lists and data.
Slug Generator
Generate URL-friendly slugs from text. Convert titles to SEO-optimized URLs for websites, blogs, and web applications.
Text Diff
Compare two texts side-by-side with word-level highlighting. Find differences, track changes, and review document revisions.
JSON Formatter/Validator
Format, validate, and beautify JSON data. Minify JSON, check syntax errors, and make JSON readable for developers.