What this tool does
Find and replace is one of the most useful editing tools there is, but it is not always to hand. You might be working in a web form, a chat app, a content management system or a plain text box that has no replace feature at all. Paste your text here, tell the tool what to change, and copy the result back.
It replaces every match in one go, shows you how many changes it made and updates live as you type, so you can see the effect of each setting immediately.
How to use it
- Paste your text into Your text.
- Type the word, phrase or symbol you want to change into Find.
- Type the new text into Replace with. Leave it empty to delete every match.
- Choose any options: Match case, Whole words only or Use regular expressions.
- Check the result on the right, then press Copy or Download.
The tool opens with an example: it finds “Monday” and replaces it with “Tuesday” in a short note, so you can see how it works before pasting your own text.
The options
Match case makes the search case sensitive. Without it, “hello” matches Hello, hello and HELLO. With it, only the exact form you typed is changed.
Whole words only matches your search only when it stands as a whole word. A match must not have a letter, digit or underscore directly before or after it. This stops “cat” from changing the start of “category”.
Use regular expressions treats the Find box as a pattern instead of plain text. Regular expressions can match any digit, any word, a set of characters or text at the start of a line. In this mode you can use these in Replace with:
$1,$2and so on for the text captured by brackets in your pattern$&for the whole match$<name>for a named group\nfor a line break and\tfor a tab
If the pattern has a mistake, such as an unclosed bracket, the tool tells you instead of changing anything.
Examples
Every result here came from the tool.
| Text | Find | Replace with | Options | Result |
|---|---|---|---|---|
| Our team meets on Monday. Monday meetings start at 9am. | Monday | Tuesday | None | Our team meets on Tuesday. Tuesday meetings start at 9am. |
| colour, Colour, COLOUR | colour | color | None | color, color, color |
| colour, Colour, COLOUR | colour | color | Match case | color, Colour, COLOUR |
| The cat sat in the category aisle. | cat | dog | None | The dog sat in the dogegory aisle. |
| The cat sat in the category aisle. | cat | dog | Whole words only | The dog sat in the category aisle. |
| Smith, John | (\w+), (\w+) |
$2 $1 |
Regular expressions | John Smith |
| Order 2024-03-15 | (\d{4})-(\d{2})-(\d{2}) |
$3/$2/$1 |
Regular expressions | Order 15/03/2024 |
| Call 555 0101 | \d |
# | Regular expressions | Call ### #### |
| red, green, blue | , |
\n |
Regular expressions | red, green and blue on three lines |
The “dogegory” row shows why Whole words only matters. Without it, the tool changes every place the letters appear.
Handy regular expressions
| To find | Use this pattern |
|---|---|
| Any digit | \d |
| A whole number | \d+ |
| Two or more spaces | {2,} |
| A blank line | ^\s*$ (with care) |
| Text in brackets | \([^)]*\) |
| An email address (simple) | [\w.+-]+@[\w-]+\.[\w.]+ |
| Any word starting with “re” | \bre\w* |
Patterns follow JavaScript rules, which match those used in most programming languages and code editors.
Tips
- Test on a small sample before pasting a long document, especially with regular expressions.
- Use Whole words only for names. Replacing “Al” with “Alan” without it would also change “Alice” and “also”.
- Run several replacements in a row. Copy the result, paste it back into Your text, and change Find and Replace with again.
- For common clean-up jobs there are dedicated tools. The underscore remover turns snake_case names into words. The em dash remover handles all the different dash characters at once. The duplicate line remover deletes repeated lines.
Limits
- Replacements happen on the whole text at once. There is no step-by-step “replace next” mode, so check the count in the note.
- Formatting such as bold and links is not kept, because the box holds plain text.
- Very large texts are processed after a short pause in typing.
Other ways to find and replace
Microsoft Word: press Ctrl+H. The More button reveals Match case, Find whole words only and Use wildcards, which is Word’s own pattern syntax.
Google Docs: press Ctrl+H, or use Edit, then Find and replace. It supports Match case and regular expressions.
Excel and Google Sheets: Ctrl+H replaces across cells. For a formula, use =SUBSTITUTE(A1,"old","new").
Code: in JavaScript, text.replaceAll('old', 'new') replaces plain text, and text.replace(/pattern/g, 'new') uses a regular expression. In Python, use text.replace('old', 'new') or re.sub(pattern, 'new', text).