What does find and replace do?
Find and replace takes every occurrence of a pattern in a block of text and substitutes something else. The pattern can be a literal string, in which case the tool simply looks for those characters, or a regular expression, in which case it can describe a shape — any four digits followed by a hyphen and two more digits, say — and capture parts of what it matched so they can be rearranged in the replacement.
Two options decide most of the outcomes. Case sensitivity determines whether the search catches the sentence-initial capital as well as the lowercase form, which is the difference between a tidy replacement and a document with one stray unchanged word in every paragraph. Whole-word matching determines whether changing “cat” also quietly changes “category” — a mistake that is invisible in the preview and obvious only when somebody reads the text.
The match list above the result is the part that makes the operation safe. It shows every occurrence found, with the surrounding words, before you copy anything. Replacements go wrong in predictable ways: a greedy quantifier matching far more than intended, a pattern containing an unescaped full stop matching any character, or a stray space inside the search term that silently narrows it to nothing. Seeing the count and the first fifty matches turns all three from a silent corruption into an obvious one.
How to replace text with or without regular expressions
- Paste the text to edit into the first box.
- Type what you are looking for. In plain mode every character is literal, so punctuation needs no escaping.
- Type the replacement. In regex mode $1 through $9 insert captured groups and $& inserts the whole match.
- Decide on case sensitivity first — it is the cause of most surprising results — then whole-word matching if the search term is a substring of other words.
- Read the match list. If the matches are not the ones you meant, adjust the pattern rather than copying a wrong result.
- Set a cap if only the first few occurrences should change, then copy the result or press Apply and keep going to chain another replacement.
Find and Replace limits and rules
| Item | Limit |
|---|---|
| Modes | Literal text or a JavaScript regular expression |
| Flags available | Global always; case-insensitive unless Match case is ticked |
| Whole word | Wraps a literal search in word boundaries; ignored in regex mode |
| Group references | $1 to $9 and $& in regex mode |
| Replacement cap | Any number; 0 replaces every match |
| Match list | The first 200 matches are counted, the first 50 shown with context |
| Regex flavour | The browser's own — no lookbehind below Safari 16.4, no named groups in the capped branch |
| Undo | Use Apply and keep going, or keep the original text in another window |
When to use it
- Renaming a product or a person across a long document without missing the sentence-initial capital.
- Converting a date format throughout a spreadsheet export with a single pattern.
- Stripping tracking parameters from a list of URLs by matching the query string.
- Fixing a consistent typo — an unusual double space, a wrong apostrophe — across thousands of words.
- Replacing only the first mention of a term while leaving later references as they were.
Is it private?
Everything happens in this page. The search, the substitution and the match list are all computed in JavaScript in your browser; the text is never uploaded and there is no server involved, no account and no stored history of what you pasted.
Frequently asked questions
Literal mode treats every character as itself: searching for “a.b” finds the three characters a, full stop, b and nothing else. Regex mode interprets special characters, so “a.b” matches a, then any single character, then b — which is usually not what somebody typing that string intends. The tool escapes your input automatically in literal mode, so switching to regex should be a deliberate decision rather than an accident.
Put parentheses around the part of the pattern you want to keep, then refer to it in the replacement as $1 for the first group, $2 for the second and so on. To turn 2026-10-25 into 25/10/2026, search for (\d{4})-(\d{2})-(\d{2}) and replace with $3/$2/$1. Groups are numbered from the left by the position of their opening parenthesis, including nested ones, and $& stands for the entire match including anything not captured.
Three causes cover almost all of it. A pattern without word boundaries matched a substring of a longer word. Case insensitivity was on when you wanted an exact match, or off when you did not. Or a quantifier was greedy — “.*” takes as much as it can, so a pattern meant to match within one line happily runs across the entire document; making it lazy with “.*?” stops at the first opportunity instead. The match list is there to show you which of the three happened before you commit.
Lookahead works everywhere; lookbehind does not, below Safari 16.4. That matters because a regular expression is parsed when the script loads, so a pattern containing an unsupported construct does not merely fail — it can stop the page from running at all. This tool builds the pattern from your input at the moment you type it, inside a try/catch, so an unsupported construct is reported as an invalid pattern instead of breaking the page.
Yes, but only in regex mode and only deliberately. The search term can contain newlines if you paste them, and “\n” in a pattern matches a line break. The common mistake is “.*”, which does not match newlines by default in JavaScript — so a pattern meant to span lines quietly fails, or, if the text has been joined into one line, matches far too much. Being explicit about where line breaks are allowed is the reliable approach.
Not automatically — there is no undo stack beyond your browser's own form history. The Apply and keep going button overwrites the input with the result, which is convenient and irreversible, so keep the original in another tab if the text is valuable. For anything you cannot retype, run the replacement on a copy and compare the two with the text diff tool before pasting anywhere important.
Related tools
Written and maintained by Md. Nur Hossain Repon.