webtools

Find and Replace

Private: nothing leaves your browser

Result
output

                  

Type something in Find and the result appears here

Paste a block of text, type what to find and what to put in its place, and read the result as you type. Plain text by default, with a regex toggle when you need capture groups. The status line counts the replacements so you know it did what you meant.

About find and replace

Every editor has find and replace, and none of them is open when you need it. This is for the in between job: text on the clipboard, a change to make everywhere, and no wish to open a project, create a scratch file and save it somewhere. Paste, type the two words, copy the result.

Plain text is the default because it is what most people want and because a plain search cannot go wrong. Characters like ., *, ( and ? are searched for literally, so looking for "1.50" finds "1.50" and not "1050". The same care goes into the replacement: a $ you type is a dollar sign, not an instruction, which is a detail that bites people using a language's replace function directly.

Tick Regular expression and both of those rules change on purpose. The pattern becomes a real regex, and $1, $2 and $& in the replacement stand for your capture groups and the whole match, which is how you reorder a date or wrap every match in something. ^ and $ match the start and end of each line rather than of the whole block, since the box usually holds a list. If a pattern is half typed and will not compile, the status line says so and your text is left exactly as it was. To build a complicated pattern with its matches highlighted before you let it loose on real text, work it out in the regex tester first.

How to find and replace text

  1. Paste your text into the left box.
  2. Type what to look for in Find and what should take its place in Replace with.
  3. Read the count in the status line to confirm it matched what you expected.
  4. Tick Match case, Whole word only or Replace the first match only to narrow it down.
  5. Tick Regular expression for patterns and capture groups.
  6. Press Copy, or Result to input to run a second replacement on the result.

Common questions about find and replace

What happens if my regular expression is wrong?

Nothing bad. The status line tells you why it will not compile, for example an unterminated group, and the Find box is marked as invalid. Your text is left untouched until the pattern is valid again, so you can type a long pattern without the page flickering between broken states.

Can I use $1 to reuse part of the match?

Yes, in regex mode. Put brackets round the part you want to keep and refer to it as $1, the second as $2, and the whole match as $&. To turn 2026-09-19 into 19/09/2026, find (\d{4})-(\d{2})-(\d{2}) and replace with $3/$2/$1. In plain mode a dollar sign is just a dollar sign.

Why did nothing change when there are clearly matches?

Check Match case and Whole word only first, since either can rule out the matches you are looking at. After that, the usual cause is an invisible character: a non-breaking space pasted from a web page, a tab where you typed spaces, or a curly quote where you typed a straight one. Copy the text out of your own document rather than retyping it and it will match.

Does whole word work with regular expressions?

The option is only offered for plain text, because a regex can already say where its own boundaries are and wrapping extra ones round a pattern gives confusing results. In regex mode write \bword\b yourself, which is the same thing and leaves you in control of where the boundaries go.

Can it replace a line break?

In regex mode, yes: find \n to match a line break, or \s*\n\s* to also swallow the spaces around it. A single line Find box cannot hold a real line break, so the escape is how you type one. To join every line into one, replace \n with a single space.

Can I run this over a file of customer data?

Yes. The replacement is JavaScript running on this page, so a contract, a config file or an export full of customer data stays on your own device. Nothing is sent, logged or saved, and the page keeps working with your connection switched off.

Next

Related tools

All Text tools