Find & Replace
Trending 🔥Find and replace text with optional regex support.
How to Use Find & Replace
- 1Paste your text in the main input area
- 2Enter the text to find and what to replace it with
- 3Toggle case-sensitive or regex options if needed
- 4Click Replace All to apply changes
- 5Copy or download the result
About Find & Replace
Find & Replace Text gives you a powerful browser-based find-and-replace editor for any block of text. Options include case-sensitive matching, whole-word matching, and full JavaScript regular expression (regex) support with capture group references in the replacement string.
All occurrences of the search term are replaced at once with a single click. This makes it ideal for bulk text editing operations such as renaming a variable throughout a file, fixing systematic typos, reformatting date strings, or applying structural transformations using regex capture groups.
All processing runs locally in your browser with no server upload. For complex pattern-based edits that would take minutes to apply manually, a well-crafted regex can apply the change to every matching occurrence in your entire document in milliseconds.
Key Features of Find & Replace
- Find and replace all occurrences in one operation
- Case-sensitive and case-insensitive matching modes
- Whole-word match option to avoid partial matches
- Full JavaScript regex support with capture group references
- Real-time match count showing how many occurrences were found
- One-click copy button for the result
- Download result as a plain .txt file
- Runs entirely in-browser with no data transmission
Examples
Replace all occurrences of an old function name
Rename every occurrence of a deprecated function name in a code snippet.
Input
getUserData(id) fetchUserData(id) getUserData(userId)
Output
fetchUser(id) fetchUserData(id) fetchUser(userId)
Reformat dates using regex capture groups
Convert dates from MM/DD/YYYY format to YYYY-MM-DD format using a regex replacement.
Input
Invoice date: 05/15/2025 Due date: 06/01/2025
Output
Invoice date: 2025-05-15 Due date: 2025-06-01
Common Use Cases
- Bulk renaming a variable, function, or class name throughout a code snippet
- Fixing systematic typos that appear multiple times in a document
- Reformatting dates, phone numbers, or data values to a new format
- Removing unwanted patterns like trailing commas or extra markup
- Adding or removing formatting characters across all matching lines
- Converting between naming conventions using regex word boundary matches
Troubleshooting
Regex special characters in the search term causing unexpected matches
Solution
When using regex mode, characters like ., *, +, (, ), [, ], and ? have special meaning. Escape them with a backslash (\.) to match them literally. In plain text mode, these characters are treated literally without escaping.
Capture groups in the replacement not working
Solution
Capture groups in the replacement string use $1, $2, etc. (not \1, \2). For example, a regex of (\w+)-(\w+) with replacement $2-$1 swaps the two captured words. Ensure you are in regex mode for capture group references to work.
Case-insensitive replacement making all output lowercase
Solution
Case-insensitive matching finds patterns regardless of case, but the replacement is inserted exactly as typed. The matched text is replaced verbatim with your replacement string — the case of the replacement depends on what you typed, not the original matched text.
Frequently Asked Questions
Does it support regular expressions?
Yes. Enable the "Use Regex" option to use full JavaScript regular expression syntax for advanced matching. The replacement string supports $1, $2 capture group references when regex mode is active.
Does it replace all occurrences at once?
Yes. When you click Replace All, every occurrence of the search term in the entire text is replaced simultaneously. There is no single-occurrence "Replace" mode — all matches are replaced in one operation.
How do I use capture groups in the replacement?
In regex mode, capture groups in the pattern (\w+) are referenced in the replacement string as $1, $2, etc. For example, search for (\d{2})/(\d{2})/(\d{4}) and replace with $3-$1-$2 to reformat dates from MM/DD/YYYY to YYYY-MM-DD.
What does "whole word" matching do?
Whole-word mode adds word boundaries around your search term, so it only matches the term as a complete word rather than as part of a longer word. For example, searching for "cat" with whole-word mode will not match "concatenate".
Is matching case-sensitive by default?
Yes, matching is case-sensitive by default. Toggle the case-insensitive option to match text regardless of uppercase or lowercase differences.
Is there a text length limit?
No. Processing runs locally in your browser with no server overhead. Large documents with thousands of replacements are processed instantly.
Is my text sent to a server?
No. All find-and-replace operations run in client-side JavaScript. Your text is never uploaded, stored, or transmitted anywhere.
Can I undo a replacement if it went wrong?
There is no built-in undo button. However, the original text remains in the input area — the replacement result appears in the output. If the replacement is incorrect, edit your search or replacement terms and click Replace All again.