How to find and replace text online
- Paste your text into the box. Insert example loads a short letter.
- Type the text to find and what to replace it with. Leave the replacement empty to delete the match.
- Check the result on the right: the number of matches replaced is shown under it. Copy it or download it.
Replacements apply to every match in the text at once. Press Clear or edit the box to start again, and use Use as input to chain a second replacement on the result.
Match case and whole words
By default the search ignores capitals, so acme, Acme and ACME all match. Match case restricts it to your exact spelling. Whole words only avoids changing words that merely contain your text. Replacing cat with dog in cat concatenate Cat category:
| Setting | Result |
|---|---|
| Whole words only | dog concatenate dog category |
| Any match | dog condogenate dog dogegory |
Without whole words, concatenate turns into condogenate and category into dogegory. The whole-word option counts letters, digits and the underscore as part of a word.
Many replacements in one pass
Switch to Many rules and write one rule per line as old => new. The rules run from top to bottom on the result of the one before. Changing British to American spelling:
The colour of my favourite grey car
The color of my favorite gray car
Because rules run in order, a later rule can change what an earlier one produced. Put the longer or more specific phrase first.
Regular expressions: patterns, groups and line breaks
Tick Regular expression to search with a pattern. In the replacement, $1, $2 and so on insert what the matching brackets captured, $& inserts the whole match, and \n and \t insert a line break and a tab. Turning the dates 12/03/2026 from day/month/year into year-month-day uses the pattern (\d{2})/(\d{2})/(\d{4}) and the replacement $3-$2-$1:
Dear {name}, your order #1234 ships on 2026-03-12.
Thanks, the team at Acme Inc. Acme loves you.
A pattern can also match a line break. Searching \n and replacing with / joins lines:
first line / second line / third line
The syntax is JavaScript's. A pattern that is not valid shows an error instead of changing your text. Patterns with nested repeats on very long text can be slow; if the page stops answering, shorten the text or simplify the pattern. For only joining lines, remove line breaks is easier.
Tips and pitfalls
- In plain mode your text is taken literally:
.,$and(have no special meaning, and$1in the replacement is inserted as typed. - An empty Find box changes nothing.
- Always skim the result before you copy it. Rules such as he => she without whole words also change the, other and when.
- The replacement is applied to the text in the box, not to a file, and the original stays in the box until you press Use as input, so you can change the search and try again as often as you like.
- To compare the original and the edited text, open both in text compare.
Ready-made patterns to copy
Tick Regular expression, paste the pattern into Find and the replacement into Replace with:
| Job | Find | Replace with |
|---|---|---|
| Delete trailing spaces on every line | [ ]+$ | (empty) |
| Collapse repeated spaces | {2,} | one space |
| Squeeze blank lines into one |
{3,} |
|
| Put every line in quotes | ^(.*)$ | "$1" |
| Swap "Last, First" to "First Last" | ^(\w+), (\w+)$ | $2 $1 |
| Remove all digits | \d+ | (empty) |
The pattern applies to the whole text with line anchors, so ^ and $ match at the start and end of every line.
Related tools
- Remove line breaks
- Remove duplicate lines
- Case converter – change the capitalization after replacing
- Text compare – check exactly what changed between two versions
Find and replace FAQ
How do I find and replace text online?
Paste your text, type the word or phrase to find and the replacement, and the result is shown at once with the number of matches replaced. Copy it or download it.
How do I replace many words at once?
Choose Many rules and write one rule per line as old text => new text. The rules run from top to bottom.
How do I match whole words only?
Tick Whole words only. Then cat matches the word cat but not concatenate or category.
Does it support regular expressions?
Yes. Tick Regular expression to use JavaScript patterns, with $1 for captured groups, $& for the whole match, \n for a line break and \t for a tab in the replacement.
How do I replace line breaks?
Tick Regular expression, search for \n and type the replacement, for example a space or a comma. For the common case, the remove line breaks tool has ready-made options.
Is the search case sensitive?
Not by default. Tick Match case when capitals matter.
Is my text uploaded anywhere?
No. All replacing happens in your browser; nothing is sent to a server or stored.