Find & Replace
Find and replace text, with optional regex support.
Use on any page (bookmarklet)
Want Find & Replace without leaving the page you're on? Drag the button below to your bookmarks bar, then click it on any website to open Find & Replace right there — it runs entirely in your browser.
Use responsibly: a bookmarklet runs on whatever page you click it on. Avoid sensitive sites such as online banking, payment, or healthcare pages — you run it at your own risk. Everything is processed locally and no data is sent anywhere. See our Terms.
- Show your bookmarks bar if it's hidden — Ctrl+Shift+B (⌘+Shift+B on Mac).
- Drag the button above onto the bookmarks bar.
- Open any website and click the bookmark — the Find & Replace panel appears in the top-right corner. Use ✛ to move it between corners, or ›/‹ to tuck it against the edge and pull it back out.
- Click the bookmark again (or the ✕) to close it.
Note: a few sites with strict security policies may block bookmarklets.
Examples
Replace every occurrence
Input
Find: cat · Replace: dog The cat sat on the mat. The cat was happy.
Output
The dog sat on the mat. The dog was happy. (2 matches)
Regex with a capture group
Input
Regex on · Find: (\w+)@ · Replace: $1[at]
Output
name@example.com → name[at]example.com
About this tool
This free online find and replace tool swaps text across a whole document at once. Type what to find and what to replace it with, and the result updates live with a match count. Switch on regex for pattern matching and capture groups, ignore case, or limit matches to whole words. Everything runs in your browser with no upload.
How to use
- Enter your Find and Replace-with terms.
- Paste your text into the Text box (or click Sample to try it).
- Toggle Regex, Ignore case, or Whole word as needed.
- Copy the result — every match is already replaced.
Capture groups: rearranging instead of just swapping
Plain find and replace substitutes one fixed string for another. Regex with capture groups lets you keep parts of what you matched and put them back in a different order. Wrap a portion of the pattern in parentheses and reference it in the replacement as $1, numbered by the order the opening brackets appear.
Searching for (\w+)@(\w+) and replacing with $2 at $1 flips both halves of every address in one pass. Use $& for the whole match, and $$ when you need a literal dollar sign — a bare $ before a digit is always read as a group reference, which is a common cause of mangled currency output.
Why a replacement damages words you didn't mean to touch
Because a plain search matches anywhere, including inside longer words. Replacing cat with dog also rewrites “category” and “concatenate”. Whole word requires a word boundary on each side and fixes this without needing regex at all — it is the option to reach for whenever you are replacing a short term.
Two related habits worth adopting: check the live match count before copying the result, since an unexpected number means the pattern is catching more or less than you intended, and keep the original text somewhere until you have confirmed the output, because there is no undo once you have pasted over the source.
Stripping invisible characters
One of the most useful jobs here is removing characters you cannot see — the non-breaking spaces and zero-width spaces that arrive with text copied from web pages and PDFs, and which quietly break sorting, deduplication, and comparison. Paste the offending character into the Find field and leave Replace empty. If you need to identify which character it is first, the Unicode converter will name it by code point.
Common uses
Bulk-editing code or configuration, cleaning exported data, renaming a term consistently across an article, reformatting lists, masking email addresses before sharing a log, and restructuring text with capture groups. For line-level cleanup afterwards, pair it with remove empty lines and remove duplicate lines.
Frequently asked questions
How do I use a captured group in the replacement?
Reference it with $1, $2 and so on, numbered by the order the opening parentheses appear. Searching for (\w+)@(\w+) and replacing with $2 at $1 swaps the two halves of every match. Use $& for the whole match, and $$ when you need a literal dollar sign in the output — a bare $ followed by a digit is always read as a group reference.
Why did my replacement break some words?
Almost always because the search term appears inside longer words. Replacing "cat" with "dog" also rewrites "category" and "concatenate". Turn on Whole word to require a word boundary on each side, which stops partial matches without needing a regex. The same problem in reverse catches people replacing short abbreviations, where the safest fix is to include the surrounding punctuation in the search.
Does it support regular expressions?
Yes. Turn on Regex to use full regular-expression patterns in the Find field and capture-group references like $1 in the replacement.
Can it replace all matches at once?
Yes. Every match is replaced and the result shows a live match count, so there's no need to click through replacements one by one.
What does 'Whole word' do?
It only matches your term when it stands alone as a word, so replacing 'cat' won't touch 'category' or 'concatenate'.
Is my text uploaded anywhere?
No. Find and replace runs entirely in your browser with no upload, so your text never leaves your device.
Why is my regex showing an error?
The pattern isn't valid JavaScript regex — often an unmatched bracket or parenthesis. The error message tells you what went wrong; fix the pattern and the result updates instantly.
Learn more
Naming Case Styles: camelCase, snake_case, kebab-case & More
GuideWhat Is a URL Slug? How to Make Clean, Readable URLs
GuideRegular Expressions for Beginners: A Gentle Introduction
ReferenceRegex Cheat Sheet: Regular Expression Syntax Reference
ReferenceCommon Regex Patterns: Email, URL, Phone and More (Copy-Paste)
Related tools
Regex Tester
Test regular expressions with live match highlighting, groups, and replace.
Word Counter
Count words, characters, sentences, and reading time.
Case Converter
Convert text between upper, lower, title, camel, and snake case.
Character Counter
Count characters and stay under tweet, SMS, and meta tag limits — live.