🔍 Find & Replace
Find and replace text with support for regex and case sensitivity.
Replaced Result
How to Use Find & Replace
Enter your source text in the main text area. Type the term you want to search for in the "Find" field and the replacement in the "Replace with" field. The tool replaces all occurrences instantly and shows a count of replacements made. Click "Copy Result" to copy the modified text.
Plain Text vs Regex Mode
By default, the tool runs in plain text mode: every character in your search term is matched literally. Special characters like ., *, +, (, ), and [ are all treated as regular characters.
Enable Regex Mode to unlock pattern-based matching using JavaScript regular expression syntax. Regex allows you to match not just specific text, but patterns like "any digit", "any whitespace", "start of line", or "word boundary". This is one of the most powerful text manipulation techniques available.
Useful Regex Patterns
\d+— Matches one or more consecutive digits (0-9). Use to find or remove all numbers in a document.\s+— Matches one or more whitespace characters (spaces, tabs, newlines). Replace with a single space to collapse multiple spaces.\n— Matches a newline character. Replace with a space or comma to join lines into a single line.\t— Matches a tab character. Replace with spaces or commas to convert tab-separated values.^— Matches the start of each line (in multiline mode). Use to add a prefix to every line.$— Matches the end of each line. Use to add a suffix to every line.[aeiou]— Matches any vowel. Replace with empty string to remove all vowels.<[^>]+>— Matches HTML tags. Replace with empty string to strip HTML from text.\b(\w+)\s+\1\b— Matches repeated consecutive words (like "the the"). Replace with$1to fix the duplicate.
Practical Use Cases
- Brand/product name changes: After a rebranding, replace every occurrence of an old product name across a large document in one step. Enable case-insensitive mode to catch all capitalization variants.
- Data format conversion: Convert date formats (e.g., MM/DD/YYYY to YYYY-MM-DD), phone number formats, or currency symbols throughout structured data exports using regex replacement.
- Code refactoring outside an IDE: Rename variables, function names, or CSS class names across a code snippet. This is useful when you want to clean up code before pasting into a PR description or documentation.
- Content standardization: Fix consistent spelling variants (“colour†→ “colorâ€), standardize terminology, or replace informal contractions (“don’t†→ “do notâ€) for formal documents.
- Removing unwanted content: Strip all HTML tags, remove all numbers, delete all punctuation, or remove a specific word from a document by leaving the Replace field empty.
- CSV and data manipulation: Change delimiters (comma to tab, tab to pipe), add quotation marks around values, or clean up improperly formatted exported data.
- Markdown cleanup: Remove Markdown formatting symbols, convert Markdown headings to plain text, or reformat code fences for a different documentation system.
Tips for Better Replacements
- In regex mode, special characters like
.,*,+,(,),[,],{,},^,$,|, and\must be escaped with a backslash (\.,\*, etc.) if you want to match them literally. - Use capture groups (
(pattern)) and backreferences ($1,$2) in your replacement string to rearrange matched content. For example, to swap two words: Find =(\w+) (\w+), Replace =$2 $1. - Test your regex on a small sample first before applying to large documents to ensure it matches what you expect.
Related Tools
- Case Converter — Change text case after your find & replace operations.
- Whitespace Cleaner — Remove extra spaces and normalize whitespace after replacement.
- Duplicate Line Remover — Remove duplicate lines that may appear after batch replacements.
- Word Counter — Count words before and after to verify your replacements worked as expected.
Frequently Asked Questions
How does Find and Replace work?
Enter the text you want to search for in the "Find" field, type the replacement in the "Replace with" field, and the tool instantly replaces all matching occurrences in your source text. Results update in real time as you type.
Does it support Regular Expressions (Regex)?
Yes! Check the "Use Regular Expressions" option to use regex patterns. For example: \d+ matches any sequence of digits, \b\w+@\w+\.\w+\b matches email-like patterns, ^\s+ matches leading whitespace at the start of each line, and (\w+)\s+\1 matches repeated words. Regex follows JavaScript RegExp syntax.
Is my data secure?
Yes — all replacements run locally in JavaScript in your web browser. No text is sent to any server. This makes the tool safe to use with sensitive documents, source code, passwords, or confidential data.
What does case sensitive mean?
When case sensitive is enabled, "Hello" and "hello" are different strings and only the exact case match will be replaced. When disabled (the default), the search is case-insensitive: searching for "hello" will match "Hello", "HELLO", and "hello".
Can I use this to replace text with nothing (delete)?
Yes. Leave the "Replace with" field empty to delete all occurrences of the search term. This is useful for stripping out unwanted characters, removing HTML tags with regex mode, or deleting specific keywords from a document.
How do I replace a newline or tab character?
In Regex mode, use \n to match newline characters and \t to match tab characters. For example, to join all lines into one, set Find to \n and Replace with a space. To remove all tabs, set Find to \t and leave Replace empty.
What are some practical regex replacement examples?
Remove all numbers: Find = \d+, Replace = empty. Remove HTML tags: Find = <[^>]+>, Replace = empty. Replace multiple spaces with one: Find = \s+, Replace = " ". Add "https://" prefix to URLs: Find = (www\..+), Replace = https://$1. Extract first word of each line: more complex — see our regex guide blog post.