Skip to content
Case Converter Online
en

Replace Text Online

Type what to find and what to put in its place, and every match in your text is replaced as you type. Match case, whole words and regular expressions are built in.

Options
Characters
0
Words
0
Lines
0

Runs in your browser. Your text is never uploaded.

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

  1. Paste your text into Your text.
  2. Type the word, phrase or symbol you want to change into Find.
  3. Type the new text into Replace with. Leave it empty to delete every match.
  4. Choose any options: Match case, Whole words only or Use regular expressions.
  5. 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, $2 and so on for the text captured by brackets in your pattern
  • $& for the whole match
  • $<name> for a named group
  • \n for a line break and \t for 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).

Find and Replace: questions and answers

How do I replace a word everywhere in my text?

Paste your text into the Your text box, type the word in Find and the new word in Replace with. Every match is replaced at once and the result appears on the right. The note under the tool tells you how many replacements were made.

Is the search case sensitive?

Not by default, so finding "colour" also matches "Colour" and "COLOUR". Switch on Match case to replace only the exact capitalization you typed.

How do I stop it changing parts of longer words?

Switch on Whole words only. Then finding "cat" replaces the word cat but leaves category and concatenate alone.

Can I replace text with a line break?

Yes. Switch on Use regular expressions and type \n in Replace with. You can also type \t for a tab. For example, finding a comma followed by a space and replacing it with \n puts each item of a list on its own line.

How do I delete a word instead of replacing it?

Leave Replace with empty. Every match is removed. You may want to run the result through the whitespace remover afterwards to tidy any double spaces left behind.

More text tools

See all tools