Find and Replace Text Online
Paste your text, type what to look for, and see every match listed with its line number before you commit to the replacement. Regular expressions are supported, including capture groups in the replacement.
Where the matches are
Plain text mode is not the simple one
Under the hood there is only a regular expression engine. Plain mode works by escaping every character your pattern contains that the engine would otherwise treat as an instruction — the dot, the question mark, the brackets, the plus sign — so that searching for price (USD) looks for exactly that instead of a group containing the word USD. Tick Regular expression and the escaping stops, and your pattern reaches the engine as written.
The reason this matters: if you paste something with a dot in it into a tool that forgot to escape, the dot matches any character. Searching for 3.14 would also hit 3x14 and 3,14. It is a quiet bug and it produces quietly wrong output.
The dollar sign in the replacement box
This one catches almost everybody. In JavaScript — and in most find-and-replace implementations that build on it — the replacement string is not literal. A dollar sign followed by a digit inserts a capture group, $& inserts the whole match, and two more sequences insert everything before or after it. So replacing something with $100 silently inserts capture group 1 followed by two zeroes, which is usually nothing followed by 00.
In plain mode this tool doubles every dollar sign for you, so $100 comes out as $100. In regex mode it does not, because that is the whole point of regex mode — write $$ when you want a literal dollar there.
Whole words only, and where the boundary is
The Whole words only option wraps your pattern in \b, the regex word boundary. A boundary sits between a word character and a non-word character, and JavaScript's definition of a word character is narrow: letters A to Z, digits, and the underscore. Nothing else.
The consequence is worth knowing before you trust it. Searching for café with whole words on will fail, because é is not a word character, so there is no boundary after it to match. The same applies to any accented or non-Latin word, and to anything with an apostrophe in it. For those, turn the option off and add your own context to the pattern.
Hyphens cut the other way. Because a hyphen is not a word character, searching for up as a whole word does match the up inside follow-up. That is the standard behaviour, not a quirk of this tool, but it surprises people.
Things regular expressions will not do here
- The dot does not cross lines. By default
.matches any character except a newline. To match across lines use[\s\S], which means "whitespace or not whitespace" and therefore everything. - No case conversion in the replacement. sed has
\Uand Vim has\ufor uppercasing a capture group. JavaScript replacement strings have no equivalent, so neither does this tool. Run the replacement first, then a case converter. - Lookbehind needs a recent browser. Patterns using
(?<=…)work in Chrome, Firefox and Edge, and in Safari from version 16.4 onward. On anything older the pattern is reported as invalid.
A pattern can freeze this page
Regular expression matching is normally fast, but certain patterns take exponential time on certain inputs. The classic shape is nested repetition — something like (a+)+b run against a long string of a's with no b. The engine tries every possible way to split the a's before concluding there is no match, and the number of ways doubles with each character.
This is called catastrophic backtracking, and there is no way to interrupt it from inside the page. If you write such a pattern the tab will stop responding and your only option is to close it. The text is not sent anywhere, so nothing is lost but the text in the box — which, since nothing is saved, is worth keeping a copy of if it took effort to assemble.
What you get and what you do not
The match list shows the first 100 hits with line and column numbers, so you can sanity-check a pattern before trusting its output. There is no undo: the input box is yours to edit and the result box is regenerated from scratch on every keystroke, so the original is only gone if you overwrite it with Use result as input. There is no multi-file mode and no folder mode — for those you want sed, ripgrep or your editor's project-wide search.
Frequently asked questions
How do I replace a line break?
Leave "Read \n and \t as escapes" ticked and type \n in the Find box. A single-line text field cannot hold a real newline, so the escape sequence is the only way to express one. The same works in the Replace box to insert line breaks.
Why did my replacement insert strange characters?
Almost certainly a dollar sign. In regex mode $1, $2 and $& are instructions that pull in the match or a capture group. Write $$ to get one literal dollar sign. Plain mode handles this for you automatically.
Can I use capture groups?
Yes, in regex mode. Wrap part of the pattern in parentheses and refer to it as $1, $2 and so on in the replacement. Searching for (\w+), (\w+) and replacing with $2 $1 swaps two comma-separated words.
Why does "whole words only" not find my accented word?
Because the regex word boundary only recognises A-Z, digits and the underscore as word characters. An accented letter counts as a separator, so there is no boundary next to it. Turn the option off for anything outside plain ASCII.
Is my text uploaded?
No. Everything runs as JavaScript inside your browser tab. Nothing is sent to a server and nothing is stored, which also means there is no undo and no recovery if you close the page.
Last updated September 19, 2026