Find and Replace
Find and replace words or patterns in any text, with case-sensitive, whole-word and regular expression options, a replacement count and a live preview.
In the replacement: $1, $2… insert a captured group, $<name> a named group, $& the whole match, $$ a dollar sign, \n a line break and \t a tab. ^ and $ match at the start and end of each line.
Warning: a repeated group contains another open-ended quantifier, for example (a+)+. Such patterns can be extremely slow on some texts.
Preview (removed text struck through, new text highlighted)
How to find and replace text
- Paste your text in the Text box.
- Type what you are looking for in Find and the new text in Replace with. Leave Replace with empty to delete every match.
- Choose Plain text to search for the exact characters you typed, or Regular expression to search with a pattern.
- Tick Case sensitive if “Paris” and “paris” must be treated differently, and Whole words only if “cat” must not match inside “concatenate”.
- Check the count of replacements and the preview, where removed text is struck through and new text is highlighted.
- Copy the Result, or click Use the result as the new text to run another replacement on it.
The result updates as you type. Replace all simply runs the replacement again.
Plain text mode
In plain text mode, every character is taken literally: dots, brackets, asterisks and dollar signs have no special meaning, in the search and in the replacement alike. This is the right mode for everyday edits such as renaming a product in a document, fixing a misspelled name everywhere, or swapping one URL for another.
Whole words only treats letters from every alphabet as parts of words, so searching for “été” as a whole word will not match inside “étés” or “comité”, and a hyphen counts as a word boundary: “chat” matches in “chat-bot”.
Regular expression mode
Regular expressions describe patterns instead of fixed text. The tool uses the JavaScript syntax, with two conveniences for editing documents:
^and$match at the start and end of each line, so^with the replacement-turns every line into a list item.- In the replacement,
\ninserts a line break and\ta tab.
The replacement can reuse parts of the match: $1, $2… insert captured groups, $<name> a named group, $& the whole match, and $$ a literal dollar sign. A few useful examples:
| Find | Replace with | Effect |
|---|---|---|
(\d{4})-(\d{2})-(\d{2}) |
$3/$2/$1 |
2026-09-30 → 30/09/2026 |
[ \t]+$ |
(empty) | removes trailing spaces from every line |
{2,} |
|
collapses runs of spaces |
(?<first>\w+) (?<last>\w+) |
$<last>, $<first> |
Jean Dupont → Dupont, Jean |
\bcolour\b |
color |
British to American spelling |
Unicode classes such as \p{L} (any letter) work. Older syntax that is only valid without Unicode mode, such as \-, is accepted too.
Safety with slow patterns
Some patterns, such as (a+)+, can take an exponential amount of time on text that almost matches. To keep your browser responsive, regular expressions run in a background worker and are stopped after 1.5 seconds, with a clear message. The tool also warns you when it detects nested quantifiers. An invalid pattern shows the error reported by the browser instead of a result.
Frequently asked questions
Is my text uploaded anywhere?
No. The search and the replacements run entirely in your browser. Nothing is sent to a server or saved.
How do I delete every occurrence of a word?
Type the word in Find, leave Replace with empty and copy the result. Tick Whole words only to avoid deleting it inside longer words.
Why does my dollar sign disappear in regular expression mode?
In regex mode, $ introduces a reference such as $1 or $&. Write $$ to insert a single dollar sign. In plain text mode, the replacement is always literal.
Can I replace line breaks?
Yes, in regular expression mode. Search for \n to find line breaks, and use \n in the replacement to insert them. For example, find \n and replace with , to join a list into one line.
How large can the text be?
Up to 2 million characters. The preview highlights the first 2,000 replacements; the result box always contains the complete text.
Related tools
- Regex Tester Test JavaScript regular expressions live with highlighted matches, capture groups, replacement and a plain-English explanation of every token.
- Remove Line Breaks and Extra Spaces Remove line breaks and extra spaces from text copied from a PDF or an email. Keep paragraphs and lists, rejoin hyphenated words, strip quote marks.
- Text Diff Checker Compare two texts and see every difference side by side or inline, by line, word or character. Private diff checker that runs in your browser.
- Case Converter Free online case converter to change text to uppercase, lowercase, title case, sentence case, camelCase, snake_case, kebab-case and more.