Find and Replace
Find and replace text online with regex support and case-sensitive matching. Free search and replace tool for bulk text editing.
About Find and Replace
Find and replace text with support for regular expressions. Use regex for powerful pattern matching.
How to Use Find and Replace
Paste your text
Drop your content into the input box — long documents, code snippets pulled from a Slack thread, scraped data, exported text, anything that came in as plain text. The tool works the same way regardless of source, and there's no size limit beyond your browser's memory.
Configure find pattern
Type the literal text you want to find, or toggle the regex switch for pattern matching when you need shape-based searches. The auxiliary toggles cover case sensitivity, whole-word boundaries (so a search for 'cat' won't match inside 'category'), and the standard regex flags like /m for multiline mode and /g for global matching.
Set replacement
Type the replacement text. With regex enabled, you can reference capture groups using $1, $2, and so on — a pattern like /(\w+)@(\w+)/ with replacement '$2/$1' swaps the parts of an email and turns user@domain into domain/user. Special characters in the replacement string need escaping when they should appear literally.
Preview and replace
The match count and preview pane let you sanity-check before pulling the trigger. If you expected forty matches and see zero, your search pattern is wrong; if you expected forty and see four hundred, your pattern is too greedy. You can replace one match at a time or run replace-all once you're confident, then copy the result somewhere safe before doing anything else with the document.
When to Use Find and Replace
Bulk text editing
Renaming a brand across a long document, swapping out terminology that changed mid-project, or fixing the same typo someone repeated forty times — all of these turn into a thirty-second job once you have a tool with regex support. Writers, editors, and content folks reach for it constantly because the alternative is manual editing or reading through a document until your eyes glaze over.
Code refactoring
Modern IDEs have find-replace built in, but sometimes you've copied a snippet out of an email or a Slack message and want to clean it up before pasting it into a project. The web tool handles that case well, plus it gives you a quick preview pane for testing regex patterns before you trust them on real code. It's a useful complement to your editor rather than a replacement.
Data cleaning
Pre-processing scraped CSVs and database exports usually means a few standard transformations — replacing 'NULL' with an empty cell, normalizing phone numbers to a single format, stripping non-printing characters that crept in from somewhere. Doing this in a real text editor is fiddly; doing it in a regex-aware tool that previews matches takes seconds.
Email/document templating
Mail merge and personalized communications often boil down to swapping placeholders like {{name}} or {{date}} for real values. When you need to do it once for a single recipient (not a whole list), find-replace beats setting up a templating engine. Sales reps, recruiters, and anyone preparing one-off personalized documents tend to use it this way.
Find and Replace Examples
Simple replace
Find: 'old company name'. Replace: 'NewCo'Every instance of 'old company name' becomes 'NewCo' across the document, with a count showing 47 replacements were made.The basic case. The match count up front tells you whether you searched for the right thing — zero matches means a typo in the search term, a wildly high count means your pattern was too broad. Useful for rebrands, terminology changes, and global typo fixes.
Regex pattern
Find: /\b\d{3}-\d{4}\b/, Replace: 'XXX-XXXX'Phone numbers in the 555-1234 format get redacted to XXX-XXXX, leaving the rest of the text untouched.Once you reach for regex, you can match shape rather than literal text. Three digits, a dash, four more digits, with word boundaries on both sides — that's a phone number, regardless of which specific number it is. Common for anonymizing logs or sanitizing data before sharing it.
Capture groups
Find: /(\w+)@(\w+)/, Replace: '$2/$1' (swap parts)An email like user@example becomes example/user, with the local part and domain swapped.Capture groups let you keep parts of the match and rearrange them in the replacement. $1 references the first parenthesized group, $2 the second, and so on. It's the difference between regex as a search tool and regex as a transformation tool.
Tips & Best Practices for Find and Replace
- 1.Run a small test first when the pattern is non-trivial. A regex that's slightly wrong can turn a thousand-line document into garbage in one click, and there's no undo on raw text once you've copied it back somewhere.
- 2.Use the match count or preview pane before committing. If you expected forty matches and you see zero, your search is wrong. If you expected forty and see four hundred, your pattern is too greedy. Either way, finding out before the replace saves you a recovery job.
- 3.Watch your case sensitivity. 'CEO', 'ceo', and 'Ceo' are three different things to a case-sensitive search. Plain text mode is usually insensitive by default, regex usually requires the /i flag — verify which mode you're in.
- 4.Use word boundaries for whole-word matches. Searching for 'cat' will happily replace it inside 'category' or 'concatenate' unless you wrap it in regex word boundaries — /\bcat\b/ — which most regex engines support.
- 5.Keep a backup of important content before bulk replacements. Especially for legal documents, production code, and anything that took real work to produce. Most disasters happen during a 'quick' replace that turned out not to be quick.
- 6.Learn the regex character classes. Even a small handful — \d for digits, \w for word characters, \s for whitespace — multiplies what you can do. The investment pays back the first week you spend doing serious text processing.
Frequently Asked Questions
Related Tools
Email Extractor
Extract email addresses from any text online. Free email extractor that finds and lists all valid email addresses from content.
URL Extractor
Extract URLs and links from any text online. Free URL extractor that finds all web addresses, domains, and hyperlinks in content.
Number Extractor
Extract numbers from any text online. Free number extractor that finds integers, decimals, and numeric values from mixed content.
Word Counter
Count words, characters, sentences, and paragraphs online. Free word counter with reading time estimation and keyword density.
Character Counter
Count characters with and without spaces online. Free character counter for Twitter, SMS, titles, and other length-limited content.
Line Counter
Count lines in text online with blank line detection and statistics. Free line counter for code, logs, and text file analysis.