Find & replace
Find and replace text in bulk, with regex support.
When using regex, you can reference capture groups like $1, $2 in the replacement.
Renaming a variable across a config file, fixing a company name that was misspelled forty times, stripping trailing commas out of an export — all the same job, and all tedious by hand.
Paste the text, say what to find and what to put in its place, and every occurrence changes at once. Your original stays in the top box so you can adjust and run again.
How it works
The basic pass
Paste text into the input box, fill in Find and Replace with, then press Replace. Every occurrence changes — there is no replace-one-at-a-time mode. A message reports how many were affected, such as 7 replaced, and the result appears in its own box so the original is never overwritten.
The two checkboxes
- Ignore case —
Apple,APPLE, andappleall match. The replacement is inserted exactly as you typed it, so casing is not preserved from the original. - Regex — treats Find as a regular expression instead of a literal string.
With Regex off, characters like ., *, (, and $ are escaped for you and match themselves. That means searching for 3.14 finds only 3.14, not 3x14.
Regex mode and capture groups
With Regex on, JavaScript regular expression syntax applies and parentheses create capture groups you can reference in the replacement as $1, $2, and so on.
| Find | Replace with | Effect |
|---|---|---|
\s+$ | (empty) | trims trailing whitespace on each match |
(\w+), (\w+) | $2 $1 | turns Smith, John into John Smith |
<[^>]+> | (empty) | strips HTML tags |
If the pattern is malformed the tool says Regex error with the reason and changes nothing.
Things that catch people out
A $ in the replacement is literal when Regex is off, but special when Regex is on — there, write $$ if you want a real dollar sign. Leaving Find empty does nothing and shows a prompt. Because every match is replaced at once, check the count before copying: a much larger number than expected usually means the pattern is broader than you intended.
Terms explained
- Find
- The text or pattern being searched for. Required — an empty value stops the run.
- Replace with
- What each match becomes. Leave it empty to delete matches instead of swapping them.
- Regex
- Regular expression — a pattern language that describes a shape of text (any digit, end of line, one or more spaces) rather than one fixed string.
- Ignore case
- Makes matching blind to uppercase and lowercase differences on the search side only.
- Capture group
- A parenthesised part of a regex whose matched text is reusable in the replacement as `$1`, `$2`, in left-to-right order.
Frequently asked questions
How do I replace only the first occurrence?
You can't directly — every pass is global. To target one instance, make the search string long enough to be unique by including the surrounding words, then replace that whole phrase.
Can I replace a line break?
Yes, in Regex mode. Use `\n` for a newline and `\r\n` for Windows line endings. In literal mode you cannot type a newline into the single-line Find box, so regex is the way to do it.
Why did my replacement drop a dollar sign?
In Regex mode `$` starts a group reference, so `$5` is read as "capture group 5" and disappears when that group doesn't exist. Write `$$5` to output a literal `$5`, or turn Regex off.
Is my text sent to a server?
No. Everything runs in your browser, so the text never leaves your device — safe for configuration files, drafts, and internal notes.
What does "Regex error" mean?
Your pattern isn't valid regular expression syntax — usually an unclosed bracket or parenthesis, or a stray backslash. The message includes the reason, and your text is left untouched until you fix it.
Tell us what went wrong and we'll fix it fast. (Leave an email if you'd like a reply.)