Find & Replace Text
Search and replace words or phrases in any text in bulk. Supports full JavaScript regex patterns with capture groups, case-sensitive matching, and replace-first-only mode.
How to Use Find & Replace
Features
Plain Text vs Regex: When to Use Each
Plain text mode (the default) treats your search term as a literal string. Every character you type is searched for exactly. This is appropriate for most common replacements: swap a brand name, correct a misspelling, replace a placeholder like [COMPANY_NAME], or change a repeated phrase across a long document.
Regex mode unlocks pattern-based replacement. Instead of matching one specific string, you match any string that fits a pattern. Common real-world uses: replace all phone number formats in a contact list with a standardised format, strip all HTML tags from a block of content, replace all email addresses with [REDACTED], or restructure dates from MM/DD/YYYY to YYYY-MM-DD using capture groups. For bulk case normalisation of words (not patterns), the Text Case Converter is faster for that specific task.
Using Capture Groups for Text Restructuring
Capture groups are one of the most powerful features in regex-based find and replace. They let you extract parts of a match and rearrange them in the replacement. The syntax is straightforward: parentheses in the Find pattern create numbered groups, and $1, $2 in the Replace field insert the captured content.
Practical example: you have dates formatted as MM/DD/YYYY (American format) and need to convert them to YYYY-MM-DD (ISO format). Set Find to (\d{2})/(\d{2})/(\d{4}) and Replace to $3-$1-$2. Every date in the text gets restructured in one pass. This kind of transformation would take hours manually across a long document. Named capture groups ((?<year>\d{4}) referenced as $<year>) are also supported for more readable replacement patterns.
Swapping word order is another common capture-group pattern: with Find set to (\w+),\s*(\w+) and Replace set to $2 $1, a list of "Last, First" names becomes "First Last" throughout an entire document in one operation β the kind of restructuring that would otherwise mean manually editing every single line, or writing a small script for what is genuinely a one-off task.
Regex Mistakes That Waste the Most Time
The single most common one: forgetting that characters like ., *, +, (, and ? mean something specific in regex and have to be escaped with a backslash to match them literally. Searching for a literal period in a filename like report.pdf using . unescaped matches any character in that position, not just a period β which usually goes unnoticed until the replacement touches text it shouldn't have.
The second: greedy matching grabbing more than intended. A pattern like <.*> written to match a single HTML tag will instead match from the first < all the way to the last > in the text, swallowing everything in between, because * is greedy by default. Adding a ? after it (<.*?>) makes it lazy instead, matching the shortest possible span β the fix is one character, but it's an easy one to not know about until a replacement goes badly wrong on real text.
The third is subtler: expecting "Replace all" to behave the way it sounds when the underlying regex isn't actually global. This tool adds the g flag automatically when Replace All is on, so it's handled for you here β but it's worth knowing that in raw JavaScript, calling .replace() with a regex that lacks the g flag only ever replaces the first match, silently, with no error. That gap between what a pattern looks like it should do and what it actually does is one of the most common regex debugging sessions in any language that uses this style of pattern matching.
Common Find and Replace Use Cases
Content editing: Replace a product name across a long article when the brand is rebranded. Update a version number in release notes. Replace placeholder text like [Name], [Date], and [Company] with actual values in a template.
Data cleaning: Standardise inconsistent date formats. Normalise phone number formats. Remove prefixes or suffixes from lists of identifiers. Strip dollar signs or currency symbols from financial data before importing into a spreadsheet. Remove HTML tags from text that was copied from a web source β though the HTML to Text tool handles that specific case with better precision.
Code refactoring: Rename a variable across a code snippet. Update an API endpoint URL in documentation. Convert one logging function name to another. Change a configuration key across a config file paste. For a genuinely large codebase this is a job for your IDE's project-wide rename, which understands scope and won't touch unrelated matches β this tool is better suited to a single file or snippet where a quick pattern-based pass is faster than opening a project.
Why Browser-Based Find and Replace Has Advantages
The Ctrl+H dialog in most text editors handles find and replace well for files you have open locally. This browser tool is useful for text you cannot easily open in a local editor β content copied from a web form, pasted from a database result, received in an email, or typed directly into a browser-based form. It also handles multi-line text with no file loading step: paste, replace, copy, done.
For cleaning up the replaced text further β removing extra spaces introduced by the replacement, or trimming line margins β use Remove Extra Spaces as a follow-up. For sorting the resulting lines after replacement, Sort Lines handles that in one click.
It's also genuinely faster for one-off jobs than opening a code editor purely to run a find and replace on text that isn't a file yet β a chunk copied from a PDF, a block pasted from a Slack message, or a paragraph typed straight into a web form's textarea. Round-tripping that through a local editor just to use its Ctrl+H dialog and copy the result back out is more steps than pasting it here once and being done.
Before running a replacement across a long document, it's worth a quick check of the match count badge against what you expect. A count far higher than anticipated usually means the pattern is matching more broadly than intended β an unescaped special character, or a plain-text search term that happens to appear inside other words too. Catching that before clicking through to the output saves having to redo the whole pass with a tightened pattern. A count of zero is worth checking too β it usually means a typo in the Find field or, in regex mode, a pattern that's syntactically valid but doesn't actually match the format the real text uses.